Re: Reflection, how to understand
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 18:04:03 GMT
"John_Woo" <john_woo@xxxxxxxxxx> wrote in message news:1157044317.744253.105310@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm trying understand jdk 5 reflection.
I know it's for loading/invoking method on the fly. I'm wondering, any
simple core-java example (not sort of EJB, rmi) illuestrated how an app
re-compile then invoke the newly classes/methods, and why need to do
that (recompile)?
Reflection isn't nescessarily related to recompilations. I think the name "reflection" is supposed to convey the image of a Java program looking at itself in a mirror, or in other words, to look at itself.
For example, you might have an object which is an instance of Class. You can query this object to find out what methods it has, and invoke these methods. This would be using reflection, even if no (re)compilation was involved.
- Oliver
.
- Follow-Ups:
- Re: Reflection, how to understand
- From: John_Woo
- Re: Reflection, how to understand
- References:
- Reflection, how to understand
- From: John_Woo
- Reflection, how to understand
- Prev by Date: Re: jview vs java.exe (speed)
- Next by Date: Re: Configuration params for a webapp - best practice?
- Previous by thread: Reflection, how to understand
- Next by thread: Re: Reflection, how to understand
- Index(es):
Relevant Pages
|
|