In our opinion, Reflection, when used with caution, can be very useful. For example, in FEST-Swing, there are a couple of special cases where we don't have enough platform-related information to simulate user input on a Swing component. To achieve our goal, our last resource is to access the UI delegate of such component (e.g.
JTree) using reflection.
One of the problems with Reflection is that its API is not very intuitive and quite verbose. For example, to call the method:
using reflection, we need the following code:
and with FEST-Reflect:
which, in our opinion, is more compact, readable and type safe.