RE: [picocontainer-dev] child container API
"Michael Rimov" <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Organization | Centerline Computers, Inc. |
| Message-ID | <00a501c7a7b0$c49e2650$4dda72f0$@com> |
How about something more along the lines of:
parent = new PicoBuilder().with().with().with().build();
child = new PicoBuilder(parent).with().with().build();
That would be consistent with the v1.0 GroovyContainerBuilder:
child = builder.container(parent: parent) {
component()
component()
component()
}
-Mike
From: Paul Hammant [mailto:[email protected]]
Sent: Friday, June 01, 2007 6:35 PM
To: dev-qxt/[email protected]
Subject: Re: [picocontainer-dev] child container API
parent = new PicoBuilder().with().with().with().build();
child = parent.makeChildContainer();
?
Until .build() is called there is not container to have a child of ... an
confused.
- Paul
On Jun 1, 2007, at 3:26 PM, Putrycz, Erik wrote:
Thanks. Makes sense gc wise.
Would it make sense to anyone else to add a "clone" feature to the builder
to create a child container? In every of my child container I need to add
the same CAFs and CAs than the parent.
Erik.
_____
From: Paul Hammant [mailto:[email protected]]
Sent: June 1, 2007 18:06
To: dev-qxt/[email protected]
Subject: Re: [picocontainer-dev] child container API
Its so that you can garbage collect session and request scopes for web apps
where Pico is controlling things. Amongst other things.
- Paul
On Jun 1, 2007, at 2:11 PM, Putrycz, Erik wrote:
Currently I find the child API rather confusing. There are too many ways to
create a child container:
pico.makeChildContainer()
new PicoBuilder(parent)
pico.addChildContainer
new DefaultPicoContainer(parent)
I'm not totally sure what the purpose of pico.addChildContainer is. It
doesn't set the parent on the child container and this could lead to an
incoherent state.
And now that there is the picobuilder, why not restrict the creation of
child containers to it?
Erik.