[jdom-interest] Why don't Comment, Element, Text, etc extend common jdom object?

Ken Rune Helland kenh at csc.no
Tue May 28 01:24:13 PDT 2002


[SNJIP]
> This would also make an argument for a common interface which includes
> the detach() method.  If unsupported (ie, Document.detach()), it'd be
> legal to throw an UnsupportedOperationException.
> 
> Then again, I could be completely wrong.
> 
> 	-bob

I dont see any reason _ALL_ JDOM classes needs to implement a single
interface. I woud have several interfaces/base classes describing what an 
object can do.

For exsample a IJDOM interface coud define a public clone() metod without
trows cloneable since all JDOM objects are clonebale.
A (I)JDOMContent interface/base-class coud extend/implement IJDOM and
add a detach() and getParent() metod and all classes that are legal 
content of Document or Element woud extend/implement this. 
Attributes are handled separate from content and woud not 
exstend/implement (I)JDOMContent.


Just my 2 cents.
KenR





More information about the jdom-interest mailing list