This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Spring and the fly likes object which knows runtime parameters and spring bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "object which knows runtime parameters and spring bean" Watch "object which knows runtime parameters and spring bean" New topic
Author

object which knows runtime parameters and spring bean

Pavel Kazlou
Ranch Hand

Joined: Sep 07, 2009
Posts: 33
Hi.
I use spring 2.5 and in my application I need to create object which depends on some runtime parameters.
The problem is that I can't use constructor

because MyObject uses spring bean to perform some actions.

So MyObject should be aware of both runtime parameters and spring bean.
Of course it is possible to solve the problem by using the extended constructor

but in this case i need to inject mySpringBean in the bean which creates MyObject. A kind of "dirty" solution...

Is there a way to instantiate MyObject so that it knows both runtime parameters and bean ?
 
 
subject: object which knows runtime parameters and spring bean