PicoContainer
  1. PicoContainer
  2. PICO-216

Refactor ComponentParameter and GenericCollectionComponentAdapter

    Details

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

      Description

      SITUATION:
      ========

      The current support for GenericCollections is hacked into the ComponentParameter's dependencies resolution. Additionally we cannot support empty collections. Use case:

      class Observer{
      Observer(Listener[] listeners)
      }

      Now imagine the listeners are provided by configuration and none is configured ==> suddenly we have an unresolved dependency.

      PROPOSAL:
      ========

      Refactor out the resolution of non-collecting arguments into a SingleComponentParameter and derive ComponentParameter from this one supporting collections. Add an optional boolean ctor parameter to ComponentParameter to allow empty collections as valid result.

      BENEFITS:
      ========

      • Cleaned-up implementation of two separate resolution strategies.
      • User has the choice to drop the collection at all.
      • Entirely backward compatible

        Issue Links

          Activity

          Hide
          Jörg Schaible added a comment -

          PROPOSAL:
          ========

          Add a ParameterFactory as optional Parameter to DefaultPC and create the method PicoContainer.createDefaultParameter(Class type).

          BENEFIT:
          ========

          • User can influence or completly change the strategy for selecting the default parameters. With PICO-216 he can turn off collections, with Thomas' AutoConfigParameter he can use a configuration as default or with Nick's constraints PICO-206 create even more sophisticated strategies.
          Show
          Jörg Schaible added a comment - PROPOSAL: ======== Add a ParameterFactory as optional Parameter to DefaultPC and create the method PicoContainer.createDefaultParameter(Class type). BENEFIT: ======== User can influence or completly change the strategy for selecting the default parameters. With PICO-216 he can turn off collections, with Thomas' AutoConfigParameter he can use a configuration as default or with Nick's constraints PICO-206 create even more sophisticated strategies.
          Jörg Schaible made changes -
          Field Original Value New Value
          Link This issue is related to PICO-181 [ PICO-181 ]
          Hide
          Paul Hammant added a comment -

          Sounds good.

          Show
          Paul Hammant added a comment - Sounds good.
          Jörg Schaible made changes -
          Link This issue supercedes PICO-207 [ PICO-207 ]
          Hide
          Jörg Schaible added a comment -

          Backward-compatible refactoring done. Can now collect Collections and Maps though

          Show
          Jörg Schaible added a comment - Backward-compatible refactoring done. Can now collect Collections and Maps though
          Jörg Schaible made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 1.1 [ 10307 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Jörg Schaible
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: