[jdom-interest] Query regarding the Parent/Child interfaces.

Simon Gauld Simon.Gauld at three.co.uk
Wed Mar 17 09:19:40 PST 2004


sorry for the my oo-101 - that's always a bad idea amongst programmers - it
always reads back as being a bit lame, so sorry!!.. I revoke that bit!..

Anyway - my question is - what was the need to introduce the Parent and
Child interfaces on the Element, when you can derive relationships via
.getChild / .getChildren / .getParent logic anyway?

Alex: I find it interesting that you believe using instanceof should be
avoided or minimized - this is a technique I find quite useful to be able to
derive general functionality - I wasn't aware it was something that that
should be avoided, and am somewhat confused as to why you say minimize uses
of it.

With regards to putting an interface on something if it might be able to do
something in the future, again - that seems strange, especially in this
instance; an Element in future could be a "cousin" of another; you wouldn't
put a Cousin interface on it, would you - the ability to derive
relationships between elements such as an element being a child-of or
parent-of has been there since the start.  

What business case was there for putting Child and Parent into the model
that the original functionality didn't deliver?



This e-mail message (including any attachment) is intended only for the personal 
use of the recipient(s) named above. This message is confidential and may be 
legally privileged.  If you are not an intended recipient, you may not review, copy or 
distribute this message. If you have received this communication in error, please notify 
us immediately by e-mail and delete the original message.

Any views or opinions expressed in this message are those of the author only. 
Furthermore, this message (including any attachment) does not create any legally 
binding rights or obligations whatsoever, which may only be created by the exchange 
of hard copy documents signed by a duly authorised representative of Hutchison 
3G UK Limited.

More information about the jdom-interest mailing list