[jdom-interest] Design Patterns

philip.nelson at omniresources.com philip.nelson at omniresources.com
Wed May 2 09:12:42 PDT 2001

> 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?

No!  I don't know that the various definitions of Node flying around here
are at all compatible.  If the chosen implementation of Node doesn't do what
you need, you are sunk because it's at the top of the hierarchy and is not
extensible by a subclass for additional uses with Visitor or Decorator.

More information about the jdom-interest mailing list