|
From: Alexandru P. <apo...@ez...> - 2005-05-30 16:28:11
|
#: on behalf of Dain Sundstrom :: 5/30/2005 5:54 PM :#
> On May 30, 2005, at 12:19 AM, Alexandru Popescu wrote:
>
>> If you search the forum you will find different solutions to the
>> above problem. I was looking for
>> the same thing for a while, and currently i am quite happy with a
>> modified solution I've found on forum.
>
> Can you give me a hint on what to search for? I could spend hours
> looking for this.
>
1/ Run-time Dependency Injection
2/ Prototype bean constructor/factory runtime args
3/ JIRA issues SPR-334 and SPR-695
pls let me know if these are what you are looking for.
>> For the 2nd question: do you need another method call than the
>> after-init?
>
> I'm not sure what you mean. In geronimo the normal geronimo bean
> creation process is:
>
> 1) call constructor
> Foo foo = new Foo(a, b, c)
>
> 2) setter inject including dynamic properties (order is not important)
> foo.setBar(bar)
> foo.setAtttibute("baz", baz);
> foo.setCheese(cheese);
> foo.setAtttibute("donkey", donkey);
>
> 3) call initialization done method
> foo.doStart();
>
>
> So all injection must occur before the initialization method. I can
> think of two ways to support dynamic properties directly in spring:
>
> 1) specifically support them by a dynamicSetterName field to the bean
> definition, and either automatically assume that any property without
> a setter is a dynamic property, or have some way for a user to flag a
> property as dynamic
>
> 2) generically support additional initialization methods (with
> arguments) before the final after-init method is called. This would
> require adding a list of method names with args to invoke. For the
> args, you could just the same matching rules as constructor injection.
>
> The first option is simpler and cleaner, but the second is much more
> powerful (more complex and a bit ugly).
>
> -dain
>
>
I see. Take a look at the possible solutions and if those are not good enough maybe somebody else
will be able to provide another way to do it.
cheers,
:alex |.::the_mindstorm::.|
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|