Hi Simon,
If you have a look at the Javadoc for CharacterDataImpl it says: "Since ProcessingInstructionImpl inherits from this class to reuse the setNodeValue method, this class isn't declared as implementing the interface CharacterData. This is done by relevant subclasses (TexImpl, CommentImpl)." This was an implementation decision to reuse code in exchange for pushing down interface inheritence to subclasses. Since a ProcessingInstruction is not also CharacterData it shouldn't be accessible through this type. Also, keep in mind that both Text and Comment are subinterfaces of CharacterData, so explicitly specifying that their implmentors also implment CharacterData is just added sugar. Perhaps this isn't the cleanest way of doing this from an OO point of view, but it gets the job done.
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]
| Simon Bretin <[EMAIL PROTECTED]>
11/04/2003 09:19 AM
|
|
Hi Michael,
First thanks for the answer !
However I don't really get your point. If I'm not mistaken, all the
methods of CharacterData are already implemented by CharacterDataImpl
.... So the fact that ProcessingInstructionImpl doesn't implement
CharacterData does not seem relevant to me ...
What bugs me is that CommentImpl implements CharacterData but the
methods actually implementing this interface are coming from the
CharacterDataImpl which from a Hierarchy point of view has nothing to do
with the CharacterData interface ... The naming of the two classes,
whiwh must have been chosen appropriatly, adds even more to this point
because usually ClassImpl implements the Interface Class.
Do you see my point ?
Simon
