org.jcabi.xml.XML::node method should be deprecated/removed
skapral opened this issue · 2 comments
skapral commented
Originally, idea came from discussion raised in #131
Arguments for its removal:
- It exposes the details of how the framework operates inside - the DOM. It makes extending the framework harder: DOM is not the only way to process the XML document, but every implementation must deal with it until the method exist.
- It makes proper encapsulation harder for the implementors of
org.jcabi.xml.XML
and provokes to break it. Implementation can't just return theorg.w3c.dom.Node
instance wrapped inside it, because client may mutate the implementation by mutating the node received, - Taking into account the previous argument, it is impossible to implement this method so it strictly follows the contract defined in its javadoc, because following it literally would mean breaking encapsulation:
- Retrieve DOM node, represented by this wrapper.
- Removing it will significantly simplify XMLDocument implementation, because there will be no need in hiding original Node from client code anymore.