You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Sérgio Gomes <sg...@google.com> on 2008/04/23 18:51:04 UTC

Re: Polymorphism in Axis2/C ADB code generator

Hi Samisa,

I'm sorry I wasn't clear, I made it seem like an Axis2/C problem. I
was actually referring to the source code obtained from the ADB code
generator.

Cheers,
Sérgio

---
On Wed, Apr 23, 2008 at 5:41 PM, Samisa Abeysinghe <sa...@wso2.com> wrote:
> I think this is service implementation detail, and nothing to do with the
> engine. Axis2/C engine just needs AXIOM as input and will return AXIOM as
> output. So you are free to implement the business logic the way you want.
>
>  Samisa...
>
>  Sérgio Gomes wrote:
>
> >
> >
> >
> > Hi there,
> >
> > First of all let me explain what I'm trying to do and what's
> > happening. I have a method that receives an abstract type A. Of
> > course, being an abstract type, it's not meant to be instantiated;
> > there are instead other two types, A1 and A2, which are not abstract,
> > and inherit from A.
> >
> > The problem is, when I provide an object of type A1 or A2 to the
> > method, I have to cast it to A, and the serialization code will write
> > it to the XML document as an A, thereby losing all the specific
> > properties of the derived type and effectively sending an abstract
> > type as the method parameter. If the serialization code for the
> > derived type was used instead of the base class's, it would work. The
> > problem can be generalized to any hierarchy of abstract or concrete
> > types being passed as parameters or returned as results.
> >
> > I can see two solutions to this: one of them is by having each object
> > contain pointers to the serialization/deserialization functions of its
> > own type, and using those pointers every time we want to
> > serialize/deserialize. The other one is by making the objects aware of
> > their own type and having the superclasse's
> > serialization/deserialization functions call the appropriate type's
> > functions (this would likely get quite complex very quickly in
> > multi-level hierarchies).
> >
> > I'm willing to implement these changes myself, but I'd like to hear
> > some comments regarding the several options and the whole concept.
> >
> > Cheers,
> > Sérgio
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-c-user-help@ws.apache.org
> >
> >
> >
> >
> >
>
>
>  --
>  Samisa Abeysinghe Director, Engineering; WSO2 Inc.
>
>  http://www.wso2.com/ - "The Open Source SOA Company"
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org