Campbell Ritchie wrote:
Using reflection out of its intended purpose is cheating.
Ritesh raushan wrote:ok but already api given by sun ms and method for access fields and method then how cheating.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Campbell Ritchie wrote:Isn’t reflection intended for IDE writing and similar?
Jeff Verdegan wrote:It's very handy for plugins (into an IDE or whatever), for JavaBean manipulation, for hooking in with scripting languages...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Jeff Verdegan wrote:It's very handy for plugins (into an IDE or whatever), for JavaBean manipulation, for hooking in with scripting languages...
Hmmm. An IDE I could see, because it needs to be introspective - and maybe some sort of Bean manager too; but couldn't plugins (if properly designed) be handled by dependency injection?
Or indeed a custom ClassLoader?
Also, what's the chance of a question in the Beginners forum having to do with these sorts of things, which are pretty advanced? Seems much more likely to me that reflection is being used to save typing.
Jeff Verdegan wrote:DI definitely uses reflection.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Jeff Verdegan wrote:DI definitely uses reflection.
True, but from what I understand, frameworks like Guice use it only for instantiation, rather like the providers for things like JDBC. Everything else works through standard Java interfaces and classes.
However, it has to be said, I'm no expert; and I suspect there are lots of different "flavours" of DI.
Winston
Don't get me started about those stupid light bulbs. |