Venkat Reddy wrote:
On 4/19/05, Aleksander Slominski <[EMAIL PROTECTED]> wrote:
  
Venkat Reddy wrote:

    
why not call it node OMChildrenManagement interface and have OMDocument
and OMElement implement. no need for OMText to implement it ...
    

It works. Except that OMNode is still not well defined for its role
and the API for children, sibling and parent are scattered around all
the three interfaces.
  
OMChildrenManagement should just manage children (and siblings as well ...) 

an additional interface (for example OMContained { getParent() } ) could deal just with parental relations (attribute contained in element etc)
Well, this might make it look more like DOM, but nothing wrong in
taking the good things from it :-)
      
IMHO Node is not good thing - it was a dual interface for languages that
did not support OO so they could use one class to work with any type of
node. the preferred interface for Java should be proper hierarchy of
classes/interfaces and asking programmer to figure out which method are
usable in given context so they do not throw OMException or return
special error value is not making of easy to use API ...
    

I dont think Node is such bad thing to have as the root level
abstraction of a tree API. Also I feel an interface is designed for
more commonly used API by its derivatives and impls, but not for the
least common features. The balance is required to avoid duplication of
code and modularization of related API into same place.
  

let me just state this for record - requiring OMText to implement OMNode is confusing for non-DOM trained Java programmers (and just a bit less confusing for DOM-trained) - moreover if String could be used it would make for much smaller memory footprint (and simpler code) when DOM is not needed as it would be no need for wrapper class (OMTextImpl) that carries besides string value set of toher fields such as done, nextSibling, nodeType, parent, previousSibling (and people wonder why DOM is memory intensive ...) - based on: http://ws.apache.org/axis2/api/org/apache/axis/om/impl/llom/OMTextImpl.html

alek
-- 
The best way to predict the future is to invent it - Alan Kay

Reply via email to