axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshan Weerasuriya <ros...@opensource.lk>
Subject Re: setUri() API - Usage
Date Tue, 11 Jan 2005 12:36:59 GMT
hi James,

Well I think we might need.

For example when a user want to declare couple of Attributes in his/her
own namespace, user will need to set his/her namespace for a attribute,
so that the engine can put the correct prefix for all such attributes.

Or for example if a user is defining a attribute in his/her own
namespace, we should let the user set the namespce_uri when he declare
this attribute. So when the relavent Attribute object is serialized to
the wire we could automaicaly add the namespace declaration if it is a
new namespce.

We might also add the following to the IHeaderBlock class so that the
user can create a Attribute object and later use these setters to fill
it:
virtual IAttribute* createAttribute();

Roshan


On Tue, 2005-01-11 at 18:22, James Jose wrote:
> Roshan,
>    setUri() for an attribute does not change the SOAP Message. So if
> we going for separate class for namespace, then do we need this
> setUri() API in IAttribute class.
> 
> Regards
> James
> --------------------------------------------------
> James Jose
> Messaging Clients Team, WMQDDC
> IBM Software Labs, India
> Direct: 91-80- 25094331  Ext :2331
> E-mail: jamejose@in.ibm.com
> 
> 
> 
> 
> Roshan Weerasuriya
> <roshan@opensource.lk>
> 
> 11/01/2005 16:08
>          Please respond to
>   "Apache AXIS C Developers List"
>                To
> Apache AXIS C
> Developers List
> <axis-c-dev@ws.apache.org>
>                cc
> 
>           Subject
> Re: setUri() API
> - Usage
> 
> 
> 
> 
> hi Addrian,
> 
> >I agree with the INamespace and Namespace structure.  When it comes
> to
> > implementation, I believe the best aproach is for Namespace to
> encapsulate
> > an Attribute, such that Attribute::setValue is exposed as setURI
> while
> > Attribute::setURI is made unavailable. 
> 
> Your idea is cool, but will this lead to extra/unnecessory memeory
> usage, because Attribute class has :
> AxisString m_localname;
>    AxisString m_prefix;
>    AxisString m_uri;
>    AxisString m_value;
> 
> but a Namespace only requires the prefix and namespaceuri to be used. 
> 
> Also there will be two object being created when a user declares a
> namespace, ie. Namespace object and a Attribute object internaly.
> 
> May be also it improves the readability of the Attribute
> implemenatation
> if we have a seperate implemenation of Namespace without binding it
> with
> the Attribute class at all.
> 
> Roshan
> 
> On Tue, 2005-01-11 at 16:21, Adrian Dick wrote:
> > 
> > 
> > Roshan Weerasuriya <roshan@opensource.lk> wrote on 11/01/2005
> 09:47:59:
> > >
> > 
> > > So what I propose is to introduce a new class as a palce holder
> for
> > > namespaces (i.e actualy for namespace declarations). eg:
> > > class Namespace
> > > {
> > > public:
> > >         void setURI(AxisString asURI);
> > >         void setPrefix(AxisString asPrefix);
> > >         Namespace(AxisString asPrefix, AxisString asURI);
> > >         Namespace();
> > >         virtual ~Namespace();
> > >
> > 
> > > private:
> > >         AxisString m_asPrefix;
> > >         AxisString m_asURI;
> > >
> > 
> > > };
> > >
> > 
> > > And it will have its corrosponding INamespce interface as well.
> > >
> > 
> > > so the code would look like:
> > > IHeaderBlock
> > > *phb=ws.createSOAPHeaderBlock("TestHeader","http://axis.com");
> > > INamespace
> *namesp=phb->createNamespaceDecl("np","http://apache.com");
> > > namesp->setUri("new_uri");
> > >
> > 
> > > Please provide any of your ideas.
> > >
> > 
> > > Roshan
> > >
> > 
> > I agree with the INamespace and Namespace structure.  When it comes
> to
> > implementation, I believe the best aproach is for Namespace to
> encapsulate
> > an Attribute, such that Attribute::setValue is exposed as setURI
> while
> > Attribute::setURI is made unavailable.  Rather than duplicating the
> > implementation of the Attribute methods.
> > 
> > So Namespace would look more like:
> > class Namespace
> > {
> > public:
> >         void setURI(AxisString asURI)
> > ->          { m_Attribute.setValue(asURI) };
> >         void setPrefix(AxisString asPrefix)
> > ->          { m_Attribute.setPrefix(asPrefix) };
> >         Namespace(AxisString asPrefix, AxisString asURI);
> >         Namespace();
> >         virtual ~Namespace();
> > 
> > private:
> > ->        Attribute m_Attribute();
> > 
> > };
> > 
> > 
> > Regards,
> > Adrian
> > 
> > 
> 
> 


Mime
View raw message