PicoContainer
  1. PicoContainer
  2. PICO-193

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

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      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.

        Activity

        Paul Hammant made changes -
        Field Original Value New Value
        Assignee Paul Hammant [ paul ]
        Hide
        Thomas Heller added a comment -

        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.

        Show
        Thomas Heller added a comment - 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.
        Hide
        Paul Hammant added a comment -

        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.

        Show
        Paul Hammant added a comment - 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.
        Paul Hammant made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 1.1 [ 10307 ]
        Hide
        Aslak Hellesøy added a comment -

        http://www.picocontainer.org/Five+minute+introduction is out of date (lying). Can you fix that too?

        Show
        Aslak Hellesøy added a comment - http://www.picocontainer.org/Five+minute+introduction is out of date (lying). Can you fix that too?
        Aslak Hellesøy made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Aslak Hellesøy made changes -
        Fix Version/s 1.1 [ 10307 ]
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 1.2 [ 11330 ]

          People

          • Assignee:
            Paul Hammant
            Reporter:
            Paul Hammant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: