Issue Details (XML | Word | Printable)

Key: PICO-166
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Joerg Schaible
Reporter: Thomas Heller
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
PicoContainer

Verification needs "thinking/optimize"

Created: 02/Apr/04 08:16 AM   Updated: 08/Oct/04 10:03 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1

Time Tracking:
Not Specified

Issue Links:
Supercedes
 


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Konstantin Pribluda added a comment - 07/Jun/04 07:12 AM
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.

Joerg Schaible added a comment - 08/Oct/04 10:03 PM
?? Bug open and closed at same time ??

Joerg Schaible added a comment - 08/Oct/04 10:03 PM
Implemented by VerifyingVisitor.