Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 57257 invoked from network); 3 Jun 2005 07:09:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Jun 2005 07:09:17 -0000 Received: (qmail 53991 invoked by uid 500); 3 Jun 2005 07:09:12 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 53961 invoked by uid 500); 3 Jun 2005 07:09:12 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 53948 invoked by uid 99); 3 Jun 2005 07:09:12 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of vreddyp@gmail.com designates 64.233.170.196 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.196) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 03 Jun 2005 00:09:06 -0700 Received: by rproxy.gmail.com with SMTP id j1so527250rnf for ; Fri, 03 Jun 2005 00:08:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Vrf7BHs/IposfcV0HMe1/al9FbRR5n3vcTdw6yOjPlAkwiOKZxeOZHhOmTTtqx7Q37ou19Akn8OSw9yBy6FDpmrUKEQm5iV2msN0FRF4FrpVvL5d5erDC9sd5wKiGp+RmPQEfOSLXH7mvABnvhlDAzWrrBXltgxQBbiS3ynOWTQ= Received: by 10.38.104.24 with SMTP id b24mr753595rnc; Fri, 03 Jun 2005 00:01:13 -0700 (PDT) Received: by 10.38.89.4 with HTTP; Fri, 3 Jun 2005 00:01:13 -0700 (PDT) Message-ID: Date: Fri, 3 Jun 2005 12:31:13 +0530 From: Venkat Reddy Reply-To: Venkat Reddy To: axis-dev@ws.apache.org Subject: Re: [Axis2] Need for children API for OMDocument In-Reply-To: <429e9528.13ffcb3e.1099.6b31SMTPIN_ADDED@mx.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <429e9528.13ffcb3e.1099.6b31SMTPIN_ADDED@mx.gmail.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N just saw some more issues if we go with new Interface. The client API uses OMElement.addChild() to build the message. Even if we try to use setParent() instead of addChild() here, the user has to typecast the OMElement into OMElementImpl and pass it to setParent, which is not elegant. If we add a new method SOAPFactory.createOMParent(), then the entire client API has to deal with OMParent objects instead of OMElement objects while building the message, which looks weird. - Venkat=20 On 6/2/05, Eran Chinthaka wrote: > Didn't I gave my +1 for this. Ok here goes, +1 ;). >=20 > -- Chinthaka >=20 > > -----Original Message----- > > From: Venkat Reddy [mailto:vreddyp@gmail.com] > > Sent: Thursday, June 02, 2005 10:55 AM > > To: axis-dev@ws.apache.org > > Subject: Re: [Axis2] Need for children API for OMDocument > > > > Not another class, but OMElementImpl need to implement the new > > interface and all the child API be moved from OMElement to OMParent. > > Also note that OMNode.setParent() now receives OMPraent, instead of > > OMElement. > > > > So the result is - OMDocument now implements only child navigation API > > and avoids stuff like namaespaces and attributes. +1. > > > > - venkat > > > > On 6/2/05, Eran Chinthaka wrote: > > > I'm ok with having an "interface" for parent, but not another class. > > > > > > -- Chinthaka > > > > > > > -----Original Message----- > > > > From: jayachandra [mailto:jayachandra@gmail.com] > > > > Sent: Wednesday, June 01, 2005 7:32 PM > > > > To: axis-dev@ws.apache.org > > > > Subject: Re: [Axis2] Need for children API for OMDocument > > > > > > > > While duplicating the child API into OMDocument I got stuck at > > something. > > > > The addChild() method of in turn tries to setParent(), and the > > > > datamember parent is rigidly typed to be an OMElement only. > > > > /** > > > > * Field parent > > > > */ > > > > protected OMElementImpl parent; > > > > > > > > Now that OMDocument can also be a parent other than just OMElement,= my > > > > suggestion would be to have a wrapper interface OMParent that conta= ins > > > > in it the child API methods ( 6 of them). Its good to have child > > > > navigation API within OMParent than anywhere else (currently it's i= n > > > > OMElement). Subsequently OMElementImpl class and OMDocument class i= f > > > > they implement this OMParent all the existing code will remain to b= e > > > > intact with the additional desired functionality that OMDocument ca= n > > > > hold multiple entities in it. > > > > > > > > Thanks > > > > Jaya > > > > > > > > My idea boils down to something like > > > > > > > > //child navigation API methods will be shifted from OMElement to > > > > OMParent interface > > > > public interface OMParent { > > > > public void addChild(OMNode omNode); > > > > public Iterator getChildrenWithName(QName elementQName) throws > > > > OMException; > > > > public OMElement getFirstChildWithName(QName elementQName) throws > > > > OMException; > > > > public Iterator getChildren(); > > > > public void setFirstChild(OMNode node); > > > > public OMNode getFirstChild(); > > > > } > > > > > > > > //OMElementImpl should implement OMParent > > > > public class OMElementImpl extends OMNodeImpl implements > > OMParent,...{...} > > > > > > > > //OMDocument should implement OMParent > > > > public class OMDocument implements OMParent {...} > > > > > > > > //The parent datamember in OMNodeImpl will be typed as OMParent typ= e > > > > public class OMNodeImpl implements OMNode { > > > > ... > > > > protected OMParent parent; // << parent should no longer be > > OMElementImpl > > > > type > > > > ... > > > > ... > > > > } > > > > > > > > Thank you > > > > Jayachandra > > > > > > > > On 6/1/05, jayachandra wrote: > > > > > Yeah! that's a wise way rather than extending OMElement. Apart be= ing > > > > > more clear on the readability front it also reduces unnecessary > > > > > placeholders from creeping into OMDocument. > > > > > > > > > > Jaya > > > > > > > > > > On 6/1/05, Aleksander Slominski wrote: > > > > > > jayachandra wrote: > > > > > > > > > > > > >Can someone respond on this, plz. > > > > > > > > > > > > > > > > > > > > why not model it exactly as it is in XML Infoset - so have > > children > > > > API > > > > > > but do not extend OMElement just duplicate it (AFAICT Document = is > > not > > > > > > Element ...) > > > > > > http://www.w3.org/TR/xml-infoset/#infoitem.document > > > > > > > > > > > > alek > > > > > > > > > > > > >Thanks > > > > > > >Jaya > > > > > > > > > > > > > >On 5/31/05, jayachandra wrote: > > > > > > > > > > > > > > > > > > > > >>Hi devs, > > > > > > >> > > > > > > >>I have two suggestions regarding OMDocument > > > > > > >> > > > > > > >>First - a trivial one: > > > > > > >>--------------------------- > > > > > > >>It lacks an interface definition in the package > > org.apache.axis.om > > > > and > > > > > > >>a direct implementation class with name OMDocument.java is co= ded > > in > > > > > > >>the o.a.a.om.impl.llom package. In line with how rest of the > > code is > > > > > > >>arranged, I suggest we have in o.a.a.om package an interface > > with > > > > name > > > > > > >>OMDocument.java listing out the setter and getter methods for > > > > > > >>rootElement. And in the OMFactory interface we will add an ex= tra > > > > > > >>signature something like createOMDocument so as to enable oth= er > > than > > > > > > >>llom factory to be able to provide OMDocument implementation. > > Let > > > > the > > > > > > >>implementation class in impl.llom package be named as > > > > > > >>OMDocumentImpl.java > > > > > > >> > > > > > > >>Second - this is a critical design issue: > > > > > > >>-------------------------------------------------------- > > > > > > >>Looking at the current OMDocument support I've realized that = it > > > > > > >>doesn't have a child navigation API. We might be doing away > > without > > > > it > > > > > > >>as far as soap processing is considered. But without the chil= d > > > > > > >>navigation API in it, XMLInfoset can never be fully supported > > > > because > > > > > > >>in an XML document other than the unique root element, at the > > same > > > > > > >>level we can have several other nodes like documentation > > comments, > > > > > > >>processing instructions, DTD element etc. > > > > > > >>Enabling child API in OMDocument, implementation wise is not = any > > > > > > >>difficult. It can be just making it extend OMElement. Somethi= ng > > like > > > > > > >>public interface OMDocument extends OMElement ; > > > > > > >> > > > > > > >>Semantically if the above looks confusing and weird (OMDocume= nt > > > > being > > > > > > >>an OMElement !!??!!), alternatively we can copy paste the > > already > > > > > > >>coded child API functionality of OMElementImpl into > > OMDocumentImpl > > > > > > >>letting OMDocument to stand on its own without extending any > > other > > > > > > >>interface. Also, performance wise these changes are not going= to > > add > > > > > > >>any significant overhead. > > > > > > >> > > > > > > >>Anticipating thoughts, ideas, suggestions > > > > > > >> > > > > > > >>Regards > > > > > > >>Jaya > > > > > > >> > > > > > > >> > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > The best way to predict the future is to invent it - Alan Kay > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > -- Jaya > > > > > > > > > > > > > > > > > -- > > > > -- Jaya > > > > > > > > > > > > >=20 >=20 >=20 >