-
Oct 11th, 2011, 01:54 PM
#1
Spring - java reflection
Hi,
Does spring use java reflection for IOC and any other config setting? If yes, please list some examples.
Thanks
-
Oct 12th, 2011, 10:29 AM
#2
Of course it uses reflection...
- for xml Ioc, just think of how the setter method (or the constructor) of the bean that gets the injection is called...yes the answer is obviously by using Java reflection (for setter, get name of property from xml -> prepend a "set" and switch the first letter to uppercase -> by using reflection, call a method that has that name passing property value);
- for annotation IoC (@Autowired etc) well if you know how annotation processing works then you know it can't be done but by using reflection!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules