Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0-beta-4, 2.1, 3.0
    • Fix Version/s: 2.8
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      0

      Description

      So sayeth Thomas Heller:

      "Why are they stored in the ComponentAdapter? I never found them to be any useful to the adapter itself and the only one using it is the container for a key->adapter map / lookups. "

      http://lists.codehaus.org/pipermail/picocontainer-dev/2004-January/002230.html

      Probably a good idea.

        Issue Links

          Activity

          Aslak Hellesøy made changes -
          Field Original Value New Value
          Link This issue is depended upon by PICO-115 [ PICO-115 ]
          Hide
          Aslak Hellesøy added a comment -

          I´m -1 on this. Do a search for usages of getComponentKey() and you´ll discover that many ComponentAdapter implementations actually use the key. (One example is the remoting one).

          Show
          Aslak Hellesøy added a comment - I´m -1 on this. Do a search for usages of getComponentKey() and you´ll discover that many ComponentAdapter implementations actually use the key. (One example is the remoting one).
          Hide
          Thomas Heller added a comment -

          I'm still +1 on this but its really not a big deal. Most of the circumstances where an adapter is interested in its key actually couple the whole thing to a specific architecture. IMHO a key should be the responsibility of the Service Locator. Pico currently combines both Patterns (Instance Factory with DI, Service Locator) in one class and its fine but oftentimes a key is only required for the Service Locator and not for the actual Component.

          I don't think a change is required before v1.0 (or perhaps not at all).

          Show
          Thomas Heller added a comment - I'm still +1 on this but its really not a big deal. Most of the circumstances where an adapter is interested in its key actually couple the whole thing to a specific architecture. IMHO a key should be the responsibility of the Service Locator. Pico currently combines both Patterns (Instance Factory with DI, Service Locator) in one class and its fine but oftentimes a key is only required for the Service Locator and not for the actual Component. I don't think a change is required before v1.0 (or perhaps not at all).
          Hide
          Aslak Hellesøy added a comment -

          If we decide to do this (I doubt it) it won't be before post 1.0.

          Show
          Aslak Hellesøy added a comment - If we decide to do this (I doubt it) it won't be before post 1.0.
          Aslak Hellesøy made changes -
          Fix Version/s 1.0.1 [ 10307 ]
          Hide
          Konstantin Pribluda added a comment -

          From one point of view, removing key is good - it's not a adapter business to know under which key it is registered.

          From the other poiint , there is some logic behind the key (
          explicit / implicit from class / assignable by component class ) - and this logic is resided in component adapters.

          This means that logic must go somewhere.

          Show
          Konstantin Pribluda added a comment - From one point of view, removing key is good - it's not a adapter business to know under which key it is registered. From the other poiint , there is some logic behind the key ( explicit / implicit from class / assignable by component class ) - and this logic is resided in component adapters. This means that logic must go somewhere.
          Hide
          Jörg Schaible added a comment -

          But this is axactly the point: A key is a key and should not have whatever additional logic semantic. While a basic concept of pico is to use the class type as key, there should not be involved anything else. If the CA needs additional info, you can provide it with the ctor, like it is done for PoolableCA or DelegatingCA.

          Show
          Jörg Schaible added a comment - But this is axactly the point: A key is a key and should not have whatever additional logic semantic. While a basic concept of pico is to use the class type as key, there should not be involved anything else. If the CA needs additional info, you can provide it with the ctor, like it is done for PoolableCA or DelegatingCA.
          Hide
          Thomas Heller added a comment -

          Keys can't go away unless we do some serious refactoring about how the container resolves Parameters. And that is by far more complex then just leaving the key as it is.

          I changed my mind on this topic when I tried to get rid of the key. Its possible but to do so, you'll need quite some Parameter magic and thats not as easy as it seems at first.

          Show
          Thomas Heller added a comment - Keys can't go away unless we do some serious refactoring about how the container resolves Parameters. And that is by far more complex then just leaving the key as it is. I changed my mind on this topic when I tried to get rid of the key. Its possible but to do so, you'll need quite some Parameter magic and thats not as easy as it seems at first.
          Hide
          Aslak Hellesøy added a comment -

          Does having the key in the adapter incur a real problem for anyone? If so, what's the problem?

          Show
          Aslak Hellesøy added a comment - Does having the key in the adapter incur a real problem for anyone? If so, what's the problem?
          Hide
          Jörg Schaible added a comment -

          Basic architecture. To be reviewed later.

          Show
          Jörg Schaible added a comment - Basic architecture. To be reviewed later.
          Jörg Schaible made changes -
          Environment
          Fix Version/s 2.0 [ 10411 ]
          Fix Version/s 1.2 [ 11330 ]
          Michael Rimov made changes -
          Fix Version/s 2.0 [ 10411 ]
          Fix Version/s 2.2 [ 14251 ]
          Hide
          Michael Rimov added a comment -

          Perhaps this is a "to be reviewed for Pico 3?"

          Show
          Michael Rimov added a comment - Perhaps this is a "to be reviewed for Pico 3?"
          Michael Rimov made changes -
          Affects Version/s 2.1 [ 14250 ]
          Michael Rimov made changes -
          Fix Version/s 2.3 [ 14303 ]
          Fix Version/s 2.2 [ 14251 ]
          Michael Rimov made changes -
          Fix Version/s 2.3 [ 14303 ]
          Fix Version/s 2.4 [ 14362 ]
          Michael Rimov made changes -
          Fix Version/s 2.5 [ 14424 ]
          Fix Version/s 2.4 [ 14362 ]
          Paul Hammant made changes -
          Affects Version/s 3.0 [ 14410 ]
          Mauro Talevi made changes -
          Fix Version/s 2.5 [ 14424 ]
          Fix Version/s 2.6 [ 14481 ]
          Michael Rimov made changes -
          Fix Version/s 2.7 [ 14663 ]
          Fix Version/s 2.6 [ 14481 ]
          Michael Rimov made changes -
          Fix Version/s 2.8 [ 14920 ]
          Fix Version/s 2.7 [ 14663 ]

            People

            • Assignee:
              Aslak Hellesøy
              Reporter:
              Aslak Hellesøy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: