--- Bob Lee <[EMAIL PROTECTED]> wrote:
> I'm aware of the container per scope pattern. The > first time I saw it was > when Joe Walnes did it with WebWork's DI container > (before Spring and Pico > existed). > > I actually tried the container per scope approach > with Guice first. It > worked fine for hierarchical scopes, but not so well > for others, i.e. thread > local, transaction, etc. If we are speaking of web environment, there is no real need for thread local - since request scope is kind of thread local. Servlet environment is hierarchical by nature. Transaction scope can be implemented by silbing containers too ( say, we place an "startable" transaction object into this container, and its lifecycle is bound to that container. then everybody who likes access to it just specifies transaction as dependency - on the end of lifecycle transaction gets commited or rolled back ) Drawback of hierarchical approach is difficulty ( or impossibility ) to inject something from child container into component residing in parent. But such demands are really rare and should be questioned. > I may add support for this somehow, but maintenance > is a big concern here. > Right now, the primary goal is to help users design > their own code well and > avoid boilerplate and repetition and static > dependencies. Resolving ambiguitites is a important concern, because they are pretty common. (like having more than one hibernate session). And flexible configuration is essential in DI environment to be able to effective reuse code without changing it. And placing special annotations on managed objects introduces dependency to container, which is a really ugly antipattern. I must also admit, that none of configuration systems used by pico/nano is really perfect. It's difficult to provide flexible and easy to use configuration scripting. > So, there is definitely no need to invent yet > another > > DI container for xwork unless you have fun of it > ;) > > > I respectfully disagree. :) > You do not have any fun with guice? ;) regards, ----[ Konstantin Pribluda http://www.pribluda.de ]---------------- Still using XDoclet 1.x? XDoclet 2 is released and of production quality. check it out: http://xdoclet.codehaus.org ____________________________________________________________________________________ Sponsored Link Mortgage rates near 39yr lows. $510k for $1,698/mo. Calculate new payment! www.LowerMyBills.com/lre --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]