Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-5
    • Fix Version/s: 1.1
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Several real world packages use factories (see GoF pattern) to create new instances of a type. These are hard to integrate into Pico, since there is neither a ctor nor a setter interface for initialization. Leo Simons proposed a nice light weight wrapper on the list as a common solution to this problem:

      http://lists.codehaus.org/pipermail/picocontainer-dev/2004-April/003470.html

        Activity

        Hide
        Stephen Molitor added a comment -

        I think this could be useful for a lot of real world situations. This is a clean and lightweight solution.

        Show
        Stephen Molitor added a comment - I think this could be useful for a lot of real world situations. This is a clean and lightweight solution.
        Hide
        Jörg Schaible added a comment -

        Next use case:
        MBeanServer server = MBeanServerFactory.createMBeanServer();

        Aslak / Paul,
        can I add this adapter to Pico?
        Assign me this issue ...

        – Jörg

        Show
        Jörg Schaible added a comment - Next use case: MBeanServer server = MBeanServerFactory.createMBeanServer(); Aslak / Paul, can I add this adapter to Pico? Assign me this issue ... – Jörg
        Hide
        Paul Hammant added a comment -

        This looks OK to me. It qualifies for PicoContainer (no external package deps, no reflection, no meta-data).

        Should it go in a package other than default ?

        Aslak ?

        Show
        Paul Hammant added a comment - This looks OK to me. It qualifies for PicoContainer (no external package deps, no reflection, no meta-data). Should it go in a package other than default ? Aslak ?
        Hide
        Konstantin Pribluda added a comment -

        I think subclassing ComponentAdapter would be more flexible solution.

        I'm playing with hibernate component adapters right now, and
        ( for example ) SessionFactoryComponentAdapter provides hibernate session factory, and has dependency to hibernate configuration.
        ( which is easily subclassed to be constructable )

        And this component adapter can be wrapped by caching one.

        The same is for hibernate session - dependency on SessionFactory.class
        ( which is provided by adapter ) and wrapping by caching / thread local adapter ( for example )

        Show
        Konstantin Pribluda added a comment - I think subclassing ComponentAdapter would be more flexible solution. I'm playing with hibernate component adapters right now, and ( for example ) SessionFactoryComponentAdapter provides hibernate session factory, and has dependency to hibernate configuration. ( which is easily subclassed to be constructable ) And this component adapter can be wrapped by caching one. The same is for hibernate session - dependency on SessionFactory.class ( which is provided by adapter ) and wrapping by caching / thread local adapter ( for example )
        Jörg Schaible made changes -
        Field Original Value New Value
        Assignee Joerg Schaible [ joehni ]
        Hide
        Jörg Schaible added a comment -

        Added StaticFactoryCA.

        Show
        Jörg Schaible added a comment - Added StaticFactoryCA.
        Jörg Schaible made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: