[jdom-interest] Element Reference from Attribute

Louis Tribble louis.tribble at metamata.com
Tue Nov 28 10:47:43 PST 2000


James Strachan wrote:
> However in most code everywhere (except in your own custom builder) you
> actually refer to the common base class most of the time. Its only when you
> want to do 'special things' that you cast. So I now favour the common base
> class being Element / Atttribute. Due to the polymorphic Node interface
> proposal, which only the doubly linked implementation would implement, my
> favoured naming scheme now is Attribute -> AttributeNode. The postfix of
> Node is an extra visual clue that the object is-a Node

_Everything_ here is a node, if not a Node. I don't find that using 
"Node" in the names is meaningful. Better to use "Double" or "Bi" or 
"2" or "Extended" on the one hand, or "Base" or "Single" on the other 
hand.

If the decision is taken to go to two tiers, I believe the doubly
linked one should be the default and have the "default" names:
that will allow presenters and casual users to deal with only one 
hierarchy. The singly linked hierarchy can be left for the
advanced (optimization) chapter...

Louis



More information about the jdom-interest mailing list