Java’s reflection API is obviously a very powerful tool, but not particularly object-oriented. What are some situations where it is appropriate (and conversely, inappropriate) to use reflection?
Java’s reflection API is obviously a very powerful tool, but not particularly object-oriented. What
Share
In my opinion…
Appropriate (clean):
Proxyto create a proxy or a mock implementation (may be better at compile time).Appropriate hacks:
Inappropriate:
Generally reflection is much easier than generating source which is much easier than creating bytecode.