Hi Bob,
That may be true for the general case, but it is not true for a
flyweight pattern. Flyweight are for reuse, and this equals should be
content based. 

The flyweight patern should have equals and hashCode, as that is the
logical method of implementing re-use of the nodes.

Unfortunatly, and inaccurately, the Flyweight* is a base class for the
default* implementation.   

As a DefaultElement is not a FlyWeightAttribute, so I think that the
inheritance tree is being abused for development ease, rather than
reflecting OO concepts

FYI This issue is related to the 'huge dom' thread.

Mike  

> -----Original Message-----
> From: bob mcwhirter [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday 26 February 2003 22:30
> To: Mike Skells
> Cc: [EMAIL PROTECTED]
> Subject: Re: [dom4j-dev] hashCode and equals for nodes
> 
> 
> > I note that hashCode() and equals are not implemented generally for 
> > any of the node implementations. IS this intentional, or an 
> oversight?
> 
> I think the idiom is that object identity is what should be 
> use for equality checking.  Two elements with the same name 
> and content are still 2 elements.
> 
>       -bob
> 
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to