Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

object which knows runtime parameters and spring bean

 
Pavel Kazlou
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic