Have something interesting to share with Java Eastern Europe community?
Become a speaker now

Reflection Madness

Abstract: Java reflection has some interesting abilities, not widely known, such as setting of final fields, discovering where in the call chain we are and the ability to make objects without calling a constructor. Based on topics from the Java Specialists Newsletter, it will make your ears ring and head explode.

In this presentation, we will look at some advanced uses of reflection to delegate method calls automatically, to determine where we are being called from and to create new enum values dynamically for unit test purposes, including modifying the switch statements on-the-fly. We will look at how we can use the stack information to determine the class type in a static context. We will demonstrate how Externalizable allows the private state of an object to be read and then modified. Lastly we will demonstrate how we can construct new objects without calling any of the available constructors. This talk will be aimed at the advanced Java specialist who does not shy away from reflection code. Topics from the Java Specialists Newsletter and related research.

Format: Online talk (50 minutes)
Language: English
Heinz Kabutz

Heinz Kabutz

JavaSpecialists.eu, Greece

Heinz Kabutz is the author of The Java Specialists’ Newsletter, a monthly publication that looks at advanced core Java topics. He has been programming and consulting on Java projects since 1997 and has trained thousands of programmers on advanced Java techniques.

Slides

You could find PDF version of slides here.

Video