[jdom-interest] Design Patterns

Frank Sauer Frank.Sauer at trcinc.com
Wed May 2 10:15:08 PDT 2001

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
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
To control your jdom-interest membership:

More information about the jdom-interest mailing list