PicoContainer
  1. PicoContainer
  2. PICO-166

Verification needs "thinking/optimize"

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Just so I don't forget it. The whole pico.verify() thing is a little eager. Add this to a TestCase of your choice to see what I mean:

      public static class VerificationCounterAdapter extends DecoratingComponentAdapter {
      public int counter = 0;

      public VerificationCounterAdapter(ComponentAdapter delegate)

      { super(delegate); }

      public int getCounter()

      { return counter; }

      public void verify()

      { super.verify(); counter++; }

      }

      public void testComponentVerificationCount() throws Exception

      { DefaultPicoContainer pico = new DefaultPicoContainer(); VerificationCounterAdapter vca = new VerificationCounterAdapter(new ConstructorInjectionComponentAdapter(Touchable.class, SimpleTouchable.class)); pico.registerComponent(new CachingComponentAdapter(vca)); pico.registerComponentImplementation(DependsOnTouchable.class); pico.registerComponentImplementation(DependsOnTwoComponents.class); pico.registerComponentImplementation("test", DecoratedTouchable.class); pico.verify(); // assertTrue(vca.getCounter() == 1); }

      You will see that vca.getCounter() == 5, so the poor little SimpleTouchable gets verified 5 times.

      I marked that for v2 since its in no way problematic (at least for me yet) it just a thing that could be optimized.

        Issue Links

          Activity

          Hide
          Konstantin Pribluda added a comment -

          I would propose change in ACA, so ACA handles basic
          verification ( check for cyclic , cache successfull verification )
          and delegates concrete verification stuff via abstract nethid further down.

          Show
          Konstantin Pribluda added a comment - I would propose change in ACA, so ACA handles basic verification ( check for cyclic , cache successfull verification ) and delegates concrete verification stuff via abstract nethid further down.
          Jörg Schaible made changes -
          Field Original Value New Value
          Link This issue is superseded by PICO-215 [ PICO-215 ]
          Hide
          Jörg Schaible added a comment -

          ?? Bug open and closed at same time ??

          Show
          Jörg Schaible added a comment - ?? Bug open and closed at same time ??
          Jörg Schaible made changes -
          Status Open [ 1 ] Reopened [ 4 ]
          Assignee Thomas Heller [ maniax ] Joerg Schaible [ joehni ]
          Hide
          Jörg Schaible added a comment -

          Implemented by VerifyingVisitor.

          Show
          Jörg Schaible added a comment - Implemented by VerifyingVisitor.
          Jörg Schaible made changes -
          Fix Version/s 2.0 [ 10411 ]
          Fix Version/s 1.1 [ 10307 ]
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: