[jdom-interest] (no subject)

Vadim.Strizhevsky at morganstanley.com Vadim.Strizhevsky at morganstanley.com
Sat May 31 13:32:59 PDT 2003


I guess I misunderstood the goals of Parent/Child interfaces. If they are
are just documentation, than sure there fine. I may disagree, but that's
fine, they don't bother me..

Buut the change in behavior of getParent and renaming of getChild
functions I think is unfortunate, and will give many jdom users a pause
when they decide to upgrade.

-Vadim

On Fri, 30 May 2003, Bradley S. Huffman wrote:

> Is it the interfaces that are the problem, or the fact that getParent, instead
> of always returning a Element, now returns a Parent node which could be either
> a Document or Element?
>
> The interfaces just define the relationships among the various JDOM objects.
> Do they now offer much, other than documentation, over b9 or the previous API?
> No.  Will they in the future? I'd say yes, especially when generics make their
> way into java.  Are there other methods that should/could go in them? Probably.
>
> The real issue seems to be the change in behaviour of getParent, and the
> name changes to getChildElement/getChildElements that break existing
> code.
>
> More specifically the issue seems to be down casting, and whether or not you
> should have to down cast to move up the tree. I don't think it's that big of
> deal. And if your worried about performance, I can argue it actually improves
> things in a more common use case, adding content.  With the old behaviour of
> getDocument/getParent we had to make 2 calls to determine if a object was
> attached, now it's just one, and this affects every document build.
>
> Eliminating as much casting as possible is good to a point.  But by many
> people's standards the JDOM API is already to big as it is, so adding methods
> to avoid a instanceof and a cast is not worth it in my book.
>
> Brad
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
>
>







More information about the jdom-interest mailing list