Jul 21st, 2010, 11:27 AM
dependency injection and beans
Ive got a newbie question.
If you develope a bigger project by using spring - do you then every object create by using beans?!
I mean, do you avoid to write in a class "Object o = new Object()", no matter in what context?
Im a little bit confused, because when I initialize every object using beans my applicationContext.xml is getting bigger and bigger and bigger.....
Jul 22nd, 2010, 01:35 AM
1) If you want to use other features like AOP on these beans then offcourse these beans have to be Spring managed.
2) You can always modularise or seperate your application-context.xml and configure it according to load all these files.
Hope this helps.
Jul 22nd, 2010, 07:15 AM
You are asking about dependency injection, right? So does your class have dependencies that you want to inject? If so, define it as a Spring bean. If it does not, then don't...
Originally Posted by jeeper
Aug 26th, 2010, 07:48 AM