[jdom-interest] Design Patterns
Trimmer, Todd
todd.trimmer at trizetto.com
Wed May 2 13:23:53 PDT 2001
You basically stated my assumption was wrong and then proceeded to give your
own interpretation that was exact assumption in different words. Weird :/
Visitable *is* the underlying interface in this case.
I'd rather have a Node interface, so that we can make both Visitors and
Decorators easier to implement.
Still, I see don't see who is responsible for walking the tree, I only see
how we can manipulate a Node, once there.
Todd Trimmer
-----Original Message-----
From: Frank Sauer <Frank.Sauer at trcinc.com>
To: "'jdom-interest at jdom.org'" <jdom-interest at jdom.org>
Subject: RE: [jdom-interest] Design Patterns
Date: Wed, 2 May 2001 13:15:08 -0400
I think you're mistaken there. All that the visitor
pattern requires is that all objects being visited
implement some kind of Visitable interface accepting
a Visitor (interface) in some kind of a visit method.
This does not require a common base class and each class
being visited can have completely different implementations
of the visit method. Personally I think a Visitor pattern
could be the answer to the tree walking issues in relation to
this common Node discussion.
Frank Sauer
The Technical Resource Connection, Inc.
a wholly owned subsidiary of Perot Systems
Tampa, FL
http://www.trcinc.com
-----------------------------------------------
Java: The best argument for Smalltalk since C++
-----Original Message-----
From: Trimmer, Todd [mailto:todd.trimmer at trizetto.com]
Sent: Wednesday, May 02, 2001 12:05 PM
To: 'jdom-interest at jdom.org'
Subject: [jdom-interest] Design Patterns
More than one request to add functionality has been responded with "Use a
Decorator for this" or "Use a Visitor for that."
Both of these patterns assume a base class for a hierarchy of objects to be
acted upon. Does anyone realize how much harder these patterns are to
implement without an underlying interface? Wouldn't Node solve this problem?
Todd Trimmer
More information about the jdom-interest
mailing list