axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Johnson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-241) AXIOM exposes interface functions that should be implementation details
Date Fri, 23 Sep 2005 23:22:28 GMT
    [ http://issues.apache.org/jira/browse/AXIS2-241?page=comments#action_12330326 ] 

Eric Johnson commented on AXIS2-241:
------------------------------------

OMNode.setParent() is only referenced from within the org.apache.axis2.om.impl.llom package.

I think if you change the impl of OMFactory.createOMElement() methods that take a parent,
you can do the "addChild()" in those cases, eliminate the need for the caller to setNextSibling()
on the lastSibling, or setPreviousSibling() on the node being added.

Not quite sure what to do about OMNode.setComplete(), as yet.  Just looking at the code for
the first time.

OMNode.setType() could be hidden by changing OMFactory.createText(parent, text) --> (parent,
text, type), or something like that.



> AXIOM exposes interface functions that should be implementation details
> -----------------------------------------------------------------------
>
>          Key: AXIS2-241
>          URL: http://issues.apache.org/jira/browse/AXIS2-241
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Improvement
>   Components: om
>     Versions: 0.91
>     Reporter: Eric Johnson

>
> The OMNode interface includes functions like:
>     public void setNextSibling(OMNode node);
>     public void setPreviousSibling(OMNode previousSibling);
>     public void setParent(OMContainer element);
>     public void setComplete(boolean state);
>     public void setType(int nodeType) throws OMException;
> OMContainer includes:
>     public void setComplete(boolean state);
>     public void setFirstChild(OMNode omNode);
> The availability of these functions in the interface means that clients can accidentally
or intentionally misbehave and corrupt the data structures.
> For example, intentional corruption:
> OMNode next = om.getNextSibling();
> om.detach();
> next.setPreviousSibling(om);
> Or the accidental:
> OMElement parent = theParent;
> OMNode lastChild = parent.getLastChild();
> lastChild.setNextSibling(theNewSibling);  // you might reasonably think that this will
insert into parent!
> Where possible, these functions ought to be defined in a package visible interface particular
to the implementation package, so that only the implementation can alter crucial details that
affect the integrity of the tree structure.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message