axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Dick <adrian.d...@uk.ibm.com>
Subject Re: setUri() API - Usage
Date Tue, 11 Jan 2005 11:25:45 GMT





I agree that my proposed solution will indeed use a little more memory.
But is it such a significant amount of memory to offset the simplicity and
ease of maintenance of this design?

Adrian

_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)

Roshan Weerasuriya <roshan@opensource.lk> wrote on 11/01/2005 10:38:04:

> 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