Issue Details (XML | Word | Printable)

Key: PICO-193
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Paul Hammant
Reporter: Paul Hammant
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
PicoContainer

Components should not get a ref to the Container that instantiates them via their ctor.

Created: 05/Jun/04 10:08 PM   Updated: 31/Oct/04 06:52 PM
Component/s: None
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified


 Description  « Hide
class CompA {
ClassA(PicoContainer pc) { // whoa, if registered with DefaultPicoContainer, this will get a handle on that PC itself. Waaay bad. }
}

People with complex needs should explicitly place an (arbitary) PicoContainer into another via registerComponentInstance(..). I do this in Jesktop and EnterpriseObjectBroker and do not want hosted component makers to have a hook to my kernel.

I hope I do not have to explain this one ... It will take a long time.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Thomas Heller added a comment - 05/Jun/04 11:14 PM
http://lists.codehaus.org/pipermail/picocontainer-dev/2004-April/003295.html

Is that close to what you mean?

I mean I aggree that it should be impossible (unless manually enabled) to get an instance of the hosting container in the ctor.


Paul Hammant added a comment - 06/Jun/04 10:02 AM
Fixed for 1.1-SNAPSHOT. There will be knock on effects for thescriptable NanoContainer impls. It won't be too much of a problem to upgrade them too.

Aslak Hellesoy added a comment - 08/Jun/04 05:36 AM
http://www.picocontainer.org/Five+minute+introduction is out of date (lying). Can you fix that too?