I need to get N instances of an object where I wonβt know N until launch, but I am also trying to avoid container calls inside my own code.
In Spring, you do the following ...
- Create an interface (which we will call IFactory) using a method such as CreateFoo ();
- Register the IFactory interface with Spring, but configure it so that it knows it as a factory.
- In your class, ask for IFactory, which Spring will certainly provide for you.
- Call CreateFoo () for IFactory. Spring will intercept your call and create an instance of Foo for you.
Does anyone know if this is possible in Windsor and how will I do it? Or even some way to achieve my goal (get N copies of something WITHOUT talking directly to the container).
Thanks!
source share