Details
-
Type: Wish
-
Status: In Progress
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 2.3
-
Fix Version/s: 3.0
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Number of attachments :
Description
One weaknesses in the current PicoVisitor design is that it does not allow for aborting the traversal.
For example, if you wish to traverse only the components in one container, then you should be able to: (pseudocode)
public OnePicoVisitor implements PicoVisitor {
private PicoContainer visitingPico;
public OnePicoVisitor (PIcoContainer target)
{ visitingPico = target; } public boolean visitContainer(PicoContainer pico) {
if (visitingPico.equals(pico))
//Stop traversal, we don't want more containers.
return false;
}
public boolean visitCA(CA componentAdapter)
{ //do stuff return true; } ///......
}
Without this 'continue' flag, you must traverse the entire pico hierarchy whether you want it or not. (With larger container hierarchies this can be time consuming)
Anyway, since its a significant API change in the visitor behavior I'll have to file this under "Wish", but I still want to get it in there.
Partially fixed for 2.4. Will revisit Visitor API for 3.0