PicoContainer
  1. PicoContainer
  2. PICO-86

addOrderedAdapter use across the system is inconsitent

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-4
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      3

      Description

      I recetly moved from playing around with component adapters to component lifecycle, and I made little investigation about the mysterious addOrderedComponentAdapter() method. I discovered that it is called from InstantiatingComponentAdapter, CachingComponentAdapter and DefaultPicoContainer, on behalf of InstanceComponentAdapter.
      This does not seem right to me, especially with the DecoratingComponentAdapter floating around (which I happen to use).

      I made a number of modifications to Pico with the following goals in mind:

      • addOrderedComponentAdapter(..) must be called for each component instantiated in the system, no matter wich type of adapter performs the instantiation
      • the instantiationOrderedComponentAdapters must contain only one entry per component (note that more than one adapter may participate in instantiating an object)

      I needed to make the following changes in MutablPicoContainer API

      • added componetnKey parameter to the addOrderedComponentAdapter(..) method, to relate together various adapters that participate in instantiation of a component
      • added a registerOrderedComponentAdapter(..) method, that must be called before add... The adapter that calls this methods first, becomes the orderedAdapter for the component.

      After these changes, ordered adapter registeration is performed in these classes:
      InstanceComponentAdapter
      InstantiatingComponentAdapter
      DecoratingComponentAdapter
      CachingComponentAdatper
      SynchronizedComponentAdapter

      the last two can be gotten rid of, provided that we make them extend DecoratingComponentAdapter, I decided file a separate issue for that, to keep the patch simpler.

      1. orderedComponentAdapter.diff
        15 kB
        Rafal Krzewski
      2. orderedComponentAdapter2.diff
        15 kB
        Rafal Krzewski
      3. orderedComponentAdapter3.diff
        15 kB
        Rafal Krzewski

        Activity

        Hide
        Rafal Krzewski added a comment -

        a patch introducing described changes

        Show
        Rafal Krzewski added a comment - a patch introducing described changes
        Rafal Krzewski made changes -
        Field Original Value New Value
        Attachment orderedComponentAdapter.diff [ 11165 ]
        Hide
        Rafal Krzewski added a comment -

        up to date patch against current HEAD (as of 2003-12-19 09:30 UTC)
        this patch REPLACES orderedComponentAdapter.diff

        Show
        Rafal Krzewski added a comment - up to date patch against current HEAD (as of 2003-12-19 09:30 UTC) this patch REPLACES orderedComponentAdapter.diff
        Rafal Krzewski made changes -
        Attachment orderedComponentAdapter2.diff [ 11170 ]
        Hide
        Rafal Krzewski added a comment -

        up-to-date patch against current HEAD as of 2003-12-19 14:00 UTC
        this patch REPLACES orderedComponentAdapter2.diff

        Show
        Rafal Krzewski added a comment - up-to-date patch against current HEAD as of 2003-12-19 14:00 UTC this patch REPLACES orderedComponentAdapter2.diff
        Rafal Krzewski made changes -
        Attachment orderedComponentAdapter3.diff [ 11177 ]
        Hide
        Aslak Hellesøy added a comment -

        Applied with minor changes (componentKey was redundant, as it's in the adapter)

        Show
        Aslak Hellesøy added a comment - Applied with minor changes (componentKey was redundant, as it's in the adapter)
        Aslak Hellesøy made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 1.0 [ 10145 ]
        Assignee Aslak Hellesoy [ rinkrank ]
        Resolution Fixed [ 1 ]
        Aslak Hellesøy made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Hide
        Aslak Hellesøy added a comment -

        This functionality has been removed lately

        Show
        Aslak Hellesøy added a comment - This functionality has been removed lately
        Aslak Hellesøy made changes -
        Fix Version/s 1.0 [ 10145 ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 1.0-beta-4 [ 10412 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: