You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by be...@agfa.com on 2007/05/15 11:30:59 UTC

polymorphic links

Hi all,

I've a general question concerning polymorphism and SDO.

Suppose I have a type A that contains a link "b" of type B. There also 
exists a subtype "SpecialB" which extends B.

I interpret this link to be a polymorphic link, i.e. instances of this 
link should be of type B or of a subtype of B.
This works fine when using the DataObject API (e.g. using the method 
DataObject.createDataObject(Property property, Type type)).

However I don't understand how this is mapped into XML/XSD.

If I generate an XSD for type A, how do I express that the link 'b' is 
polymorph? 

A straigtforward approach like

        <xsd:complexType name="A">
                <xsd:sequence>
                        <xsd:element name="b" type="B" maxOccurs="1" 
minOccurs="0"></xsd:element>
                ...
        ...

states that the type of B should be exactly 'B' (at least according to my 
incomplete XML knowledge :-). 

On the instance level, 

        <a><b>...</b></a>

is an xml piece for an object of type A with a link to some b. How would 
this look like in case the link is to a SpecialB instance?


So, my question is, how do polymorphic links work in an xml context?

I hope this is clear.


Bert

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


Re: SCA BPEL/EJB/JMS Example

Posted by haleh mahbod <hm...@gmail.com>.
Hi Rahul,
There is also a patch for EJB binding in the JIRA system that is based on M2
release. This also needs to be ported over to the new code base.

Haleh

On 5/15/07, Simon Laws <si...@googlemail.com> wrote:
>
> Hi Rahul
>
> You find use at the point where we are just getting to the end of a period
> of refactoring in the Tuscany SCA codebase to make the code a little
> easier
> to understand. If you look at the latest code in svn trunk you will see a
> set of modules (see java/sca/modules) that we have ported over to the new
> code, this includes
>
> Bindings
>   JsonRPC
>   RMI
>   WebServices (with Axis)
> Implementations
>   Java
>   Script, e.g. Ruby, Python etc.
>   Spring
>
> There are quite a few modules that we haven't yet ported over (see
> java/sca/contrib). This is where the BPEL implementation is at the moment
> so
> it won't run with the latest code.  I also notice that the JMS binding has
> made it into sca/modules but that it's not being built and tested
> regularly
> as part of our build so I imagine someone is working on that at the
> moment.
> Maybe someone can comment?
>
> We are just about to do a release with this basic set of functionality.
> Then
> I expect the Tuscany community will start looking at all the other modules
> in Contrib and any other new one people want to add. If you feel like
> getting your hands dirty now is a great time to get involved as there is
> no
> shortage of modules to fix/add.
>
> Hope that helps.
>
> Simon
>

Re: SCA BPEL/EJB/JMS Example

Posted by Simon Laws <si...@googlemail.com>.
Hi Rahul

You find use at the point where we are just getting to the end of a period
of refactoring in the Tuscany SCA codebase to make the code a little easier
to understand. If you look at the latest code in svn trunk you will see a
set of modules (see java/sca/modules) that we have ported over to the new
code, this includes

Bindings
  JsonRPC
  RMI
  WebServices (with Axis)
Implementations
  Java
  Script, e.g. Ruby, Python etc.
  Spring

There are quite a few modules that we haven't yet ported over (see
java/sca/contrib). This is where the BPEL implementation is at the moment so
it won't run with the latest code.  I also notice that the JMS binding has
made it into sca/modules but that it's not being built and tested regularly
as part of our build so I imagine someone is working on that at the moment.
Maybe someone can comment?

We are just about to do a release with this basic set of functionality. Then
I expect the Tuscany community will start looking at all the other modules
in Contrib and any other new one people want to add. If you feel like
getting your hands dirty now is a great time to get involved as there is no
shortage of modules to fix/add.

Hope that helps.

Simon

Re: polymorphic links

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Kelvin, You're confusing elements with types. A substitution group lets 
you control the element used in a serialization. Subtyping (polymorphism) 
is an orthogonal concept.

Bert, The answer to your question is that there's nothing special to 
indicate that a property is polymorphic. You can always assign a subtype 
to a property. In that case, the XML serialization will include an 
xsi:type attribute to indicate the subtype:

<a><b xsi:type="SpecialB">...</b></a>

Frank.

"kelvin goodson" <ke...@gmail.com> wrote on 05/15/2007 06:10:36 
AM:

> Bert,
>    I think the file at
> https://svn.apache.
> 
org/repos/asf/incubator/tuscany/java/sdo/tools/src/test/resources/subgroup.
> xsddemonstrates
> what you want.
> Regards, Kelvin.
> 
> On 15/05/07, bert.robben@agfa.com <be...@agfa.com> wrote:
> >
> > Hi all,
> >
> > I've a general question concerning polymorphism and SDO.
> >
> > Suppose I have a type A that contains a link "b" of type B. There also
> > exists a subtype "SpecialB" which extends B.
> >
> > I interpret this link to be a polymorphic link, i.e. instances of this
> > link should be of type B or of a subtype of B.
> > This works fine when using the DataObject API (e.g. using the method
> > DataObject.createDataObject(Property property, Type type)).
> >
> > However I don't understand how this is mapped into XML/XSD.
> >
> > If I generate an XSD for type A, how do I express that the link 'b' is
> > polymorph?
> >
> > A straigtforward approach like
> >
> >         <xsd:complexType name="A">
> >                 <xsd:sequence>
> >                         <xsd:element name="b" type="B" maxOccurs="1"
> > minOccurs="0"></xsd:element>
> >                 ...
> >         ...
> >
> > states that the type of B should be exactly 'B' (at least according to 
my
> > incomplete XML knowledge :-).
> >
> > On the instance level,
> >
> >         <a><b>...</b></a>
> >
> > is an xml piece for an object of type A with a link to some b. How 
would
> > this look like in case the link is to a SpecialB instance?
> >
> >
> > So, my question is, how do polymorphic links work in an xml context?
> >
> > I hope this is clear.
> >
> >
> > Bert
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> >
> >


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


Re: polymorphic links

Posted by kelvin goodson <ke...@gmail.com>.
Bert,
   I think the file at
https://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/tools/src/test/resources/subgroup.xsddemonstrates
what you want.
Regards, Kelvin.

On 15/05/07, bert.robben@agfa.com <be...@agfa.com> wrote:
>
> Hi all,
>
> I've a general question concerning polymorphism and SDO.
>
> Suppose I have a type A that contains a link "b" of type B. There also
> exists a subtype "SpecialB" which extends B.
>
> I interpret this link to be a polymorphic link, i.e. instances of this
> link should be of type B or of a subtype of B.
> This works fine when using the DataObject API (e.g. using the method
> DataObject.createDataObject(Property property, Type type)).
>
> However I don't understand how this is mapped into XML/XSD.
>
> If I generate an XSD for type A, how do I express that the link 'b' is
> polymorph?
>
> A straigtforward approach like
>
>         <xsd:complexType name="A">
>                 <xsd:sequence>
>                         <xsd:element name="b" type="B" maxOccurs="1"
> minOccurs="0"></xsd:element>
>                 ...
>         ...
>
> states that the type of B should be exactly 'B' (at least according to my
> incomplete XML knowledge :-).
>
> On the instance level,
>
>         <a><b>...</b></a>
>
> is an xml piece for an object of type A with a link to some b. How would
> this look like in case the link is to a SpecialB instance?
>
>
> So, my question is, how do polymorphic links work in an xml context?
>
> I hope this is clear.
>
>
> Bert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

SCA BPEL/EJB/JMS Example

Posted by Rahul Nandkumar Bindu <Ra...@sos.sungard.com>.
Hi all,
I wanted to try out BPEL, EJB and JMS with SCA. I could not find the
examples for these in the samples provided with Tuscany. Could someone
please tell me where I can find these samples?

Rahul. 

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