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 10:21:25 GMT




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