[jdom-interest] JDOM JSR

Amy Lewis amyzing at talsever.com
Fri May 18 15:03:05 PDT 2001


In fact, if String becomes Text or Content when you ask for children
(and when you build), then those of us interested in using interfaces
can:

1) create a set of custom subclasses that decorate the core classes,
and implement Node;

2) easily keep this set of custom classes synchronized with core;

3) provide a builder that returns these subclasses rather than core;

4) possibly compete with one another in contrib as to what a Node
really looks like, until large numbers of folks go Aha!  That's it!

In other words, this relatively simple change *enables* a number of
other possibilities, that might be enhanced by a standard interface,
but ... building a standard interface is one of the things that it
enables.

On Fri, May 18, 2001 at 12:36:28PM -0700, Jason Hunter wrote:
>Richard Baldwin wrote:
>> 
>> For example, I would like to be able to iterate on the
>> list returned by getMixedContent() and invoke
>> getParent() on any item in that list without having to
>> worry about the actual type of the object.  
>
>That can't be a serious use case.  getParent() on every item would be
>identical.  What's a more realistic use case you've encountered?
>
>Some background, covered before but I'll hit it again:
>
>The problem is that the number of methods which JDOM objects have in
>common or could have in common is close to zero.  Therefore to create a
>Node we have to either allow methods which don't make sense for all
>objects (like getMixedContent() on Attribute) or we have Node as really
>just a marker interface.  Myself, I don't want to see non-sensical
>methods because that's one of the core problems with DOM.  And I don't
>see sufficient value for Node as just a marker interface for reasons
>enumerated before.
>
>Some people propose to get more methods into Node by restricting the set
>of JDOM objects that would qualify as Nodes.  That tends to come at the
>cost of other people's desire for everything in JDOM to be a Node.

Amy!
-- 
Amelia A. Lewis          alicorn at mindspring.com          amyzing at talsever.com
  "You go on.  You just go on.  There's nothing more to it, and there's no
trick to make it easier.  You just go on."
  "What do you find on the other side?  When you go on?"
  She shrugged.  "Your life again.  What else?"
		-- Harra Csurik and Miles Vorkosigan



More information about the jdom-interest mailing list