PicoContainer
  1. PicoContainer
  2. PICO-151

Optimize algorithm of ConstructorInjectionComponentAdapter

    Details

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

      Description

      The current implementation of ConstructorInjectionComponentAdapter (former ConstructorComponentAdapter) is somewhat inefficient. The search for the best ctor is called at instantiation time two or three times. Also the search algorithm itself can be improved by preselection, smart search order and cutting the search if an optimal ctor was found.

      An upcoming patch will address this with just a very small change in behaviour: In case of a TooManySatisfiableConstructorsException all ctors that could have been satisfied are reported, not only the ones with the largest arity.

        Activity

        Hide
        Jörg Schaible added a comment -

        ConstructorInjectionComponentAdapter.java.diff

        Show
        Jörg Schaible added a comment - ConstructorInjectionComponentAdapter.java.diff
        Jörg Schaible made changes -
        Field Original Value New Value
        Attachment ConstructorInjectionComponentAdapter.java.diff [ 11597 ]
        Hide
        Jörg Schaible added a comment -

        InstantiatingComponentAdapter.java.diff

        Show
        Jörg Schaible added a comment - InstantiatingComponentAdapter.java.diff
        Jörg Schaible made changes -
        Hide
        Jörg Schaible added a comment -

        AbstractMultipleConstructorTestCase.java.diff

        Show
        Jörg Schaible added a comment - AbstractMultipleConstructorTestCase.java.diff
        Jörg Schaible made changes -
        Hide
        Jörg Schaible added a comment -

        ... and have a look at Clover now ...

        Show
        Jörg Schaible added a comment - ... and have a look at Clover now ...
        Hide
        Aslak Hellesøy added a comment -

        Very nice optimisations. However, code coverage has decreased slightly, but since all tests still pass, we;ll fix this later in a bigger code coverage overhaul.

        Show
        Aslak Hellesøy added a comment - Very nice optimisations. However, code coverage has decreased slightly, but since all tests still pass, we;ll fix this later in a bigger code coverage overhaul.
        Aslak Hellesøy made changes -
        Assignee Aslak Hellesoy [ rinkrank ]
        Fix Version/s 1.0-RC-1 [ 10461 ]
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: