RE: [picocontainer-dev] The Visitor on Pico

"Michael Rimov" <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Organization Centerline Computers, Inc.
Message-ID <005501c79cf2$67bd5af0$373810d0$@com>
> 	I've never liked this.  I mean I like the visitor pattern for
> things like ASM, but it seemed gratuitous to shove it into Pico back in
> the day.
> 
> 	Originally Lifecycle's breadth first start() was tied to it.
> Then we put in a more conventional traversal.
> 
> 	Why don't I like it ?
> 
> 	Consider that child containers can choose different CAF,
> Lifecycle, Montor to parents.  They can also not register themselves
> with parent, so even start/stop does not cascade.
> 	The visitor concept seems to transcend these choices.  Indeed, a
> container cannot block/veto visiting.
> 
> 	I know people use this - can they speak up and give real world
> examples?  Pete ?
> ________________________________
> 
> The visitor is not used for the LC anymore, but it is used e.g. in
> remoting to collect the JMX enabled components. But I have to admit,
> that even there the process is not optimal (have a look at the efforts
> to avoid double registration).
> 
> The visitor is great for inspecting the Pico related structure though
> and might help to build a GUI.

What about the VerifyingVisitor?  

I use that regularly, and I yes, I use it for GUI-ish work.

I also tended to use it when implementing simple custom lifecycles, but I'm
sure there's other (better!) ways to do that.

I certainly don't mind, however, demoting the acceptVisitor() methods to the
Mutable pico only.  To me, the visitor is only really good for
management/privileged operations, and shouldn't belong in the sealed
container.

Would that compromise work? 
	
-Mike
 




---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.