tg icon indicating copy to clipboard operation
tg copied to clipboard

Reflection with Method Handles

Open 01es opened this issue 2 years ago • 0 comments

Description

Reflection is used extensively in TG. And so its speed and safety is important. This issue should be used in researching the subject of Method Handles as a better way to do reflection in modern Java.

As a working example, dynamic property assignment and access should be modified to use Method Handles. More specifically, methods AbstractEntity.get and AbstractEntity.set should be reimplemented using Method Handles. It is important to consider inherited properties, overridden setters and getters, protected setters.

Resources

  1. https://blogs.oracle.com/javamagazine/post/java-reflection-method-handles

Expected outcome

Safer and faster reflection in TG.

01es avatar Aug 04 '23 01:08 01es