You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Nash <na...@apache.org> on 2008/07/21 00:16:24 UTC

EchoDataBinding.composite needs updating for TUSCANY-2324 fix

When testing my fix to TUSCANY-2324, I discovered a problem in
EchoDataBinding.composite in the databinding-echo sample.

The lines:

     <reference name="EchoReference" promote="ComponentB/echoReference">
         <!--
             <interface.java interface="dbecho.Echo"/>
         -->
         <interface.wsdl interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
             wsdli:wsdlLocation="http://example.com/echo.wsdl wsdl/echo.wsdl">
             <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement" />
         </interface.wsdl>
         <e:binding.echo/>
     </reference>

are causing a problem because the TUSCANY-2324 fix causes the <interface.wsdl>
definition to be copied down to the underlying promoted reference, and this doesn't
work (I get an exception reprting problems with databindings and wrappers).

 From looking at the test code, it doesn't seem that this <interface.wsdl>
definition is a necessary part of the test, so I changed the above to:

     <reference name="EchoReference" promote="ComponentB/echoReference">
         <interface.java interface="dbecho.Echo"/>
     <!-- Replaced interface.wsdl by interface.java because TUSCANY-2324 fix uses the interface specified here
         <interface.wsdl interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
             wsdli:wsdlLocation="http://example.com/echo.wsdl wsdl/echo.wsdl">
             <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement" />
         </interface.wsdl>
     -->
         <e:binding.echo/>
     </reference>

and this worked OK.

I'm planning to make the above change in my check-in for the builder changes
that include the fix for TUSCANY-2324.  Ideally I'd like to delete the
extraneous lines completely, because of the confusion that they cause anyone
trying to understand what this sample does.  Does anyone know of a reason
why I should not do this?

   Simon


Re: EchoDataBinding.composite needs updating for TUSCANY-2324 fix

Posted by Raymond Feng <en...@gmail.com>.
Hi,

I now remember that we override the promoted reference from the composite 
reference if the multiplicity <=1. If the multiplicity>1, then all the 
promotions should be kept based on the following statement from the SCA 
assembly spec.

1392 The same component reference maybe promoted more than once, using 
different composite
1393 references, but only if the multiplicity defined on the component 
reference is 0..n or 1..n.

It seems that JIRA TUSCANY-2484 has been reported in this area.

I think you changes may have exposed some bugs in the area of how data 
transformation is checked. Please go ahead to check in your changes and I 
can dig into more details to better understand why the sample cannot run 
as-is.

Thanks,
Raymond
--------------------------------------------------
From: "Simon Nash" <na...@apache.org>
Sent: Monday, July 21, 2008 8:03 AM
To: <de...@tuscany.apache.org>
Subject: Re: EchoDataBinding.composite needs updating for TUSCANY-2324 fix

> Raymond Feng wrote:
>> Hi,
>>
>> Can you clarify "the TUSCANY-2324 fix causes the <interface.wsdl> 
>> definition to be copied down to the underlying promoted reference"?
>>
>> <reference name="EchoReference" promote="ComponentB/echoReference">
>>         <interface.wsdl 
>> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)" />
>>         <e:binding.echo/>
>> </reference>
>>
>> What will be the interfaces for the following references?
>>
>> composite reference (EchoReference) interface.wsdl?
> >
> Yes.
>
>> component reference (ComponentB/echoReference)        interface.java 
>> (inherited from the component type reference)? or interface.wsdl (copied 
>> from the composite reference)?
>>
> interface.wsdl, because the composite ref overrides the binding, so both
> the composite ref binding and composite ref interface (if any) should be
> copied down to the promoted component ref.
>
>> IMO, the inheritance chain is:
>>
>> composite ref (which is also the component type ref for 
>> implementaiton.composite) --> promoted component ref --> component type 
>> ref
>>
> There are two different things happening here.  There is inheritance,
> which works as you say, and there is overriding, which goes in the
> opposite direction.  In this case, overriding takes priority over
> inheritance.
>
> The main point of my question was to confirm whether or not the sample is
> still valid if the component ref uses interface.java instead of 
> interface.wsdl.
> Before the TUSCANY-2324 change, interface.java was being used by the
> component ref, and the test worked, so I believe that the component ref
> should be using interface.java, not interface.wsdl.  The use of 
> interface.wsdl
> in the composite ref seems redundant for the purposes of this sample.
>
>   Simon
>
>> Thanks,
>> Raymond
>> --------------------------------------------------
>> From: "Simon Nash" <na...@apache.org>
>> Sent: Sunday, July 20, 2008 3:16 PM
>> To: <de...@tuscany.apache.org>
>> Subject: EchoDataBinding.composite needs updating for TUSCANY-2324 fix
>>
>>> When testing my fix to TUSCANY-2324, I discovered a problem in
>>> EchoDataBinding.composite in the databinding-echo sample.
>>>
>>> The lines:
>>>
>>>     <reference name="EchoReference" promote="ComponentB/echoReference">
>>>         <!--
>>>             <interface.java interface="dbecho.Echo"/>
>>>         -->
>>>         <interface.wsdl 
>>> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
>>>             wsdli:wsdlLocation="http://example.com/echo.wsdl 
>>> wsdl/echo.wsdl">
>>>             <db:databinding 
>>> xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" 
>>> name="org.apache.axiom.om.OMElement" />
>>>         </interface.wsdl>
>>>         <e:binding.echo/>
>>>     </reference>
>>>
>>> are causing a problem because the TUSCANY-2324 fix causes the 
>>> <interface.wsdl>
>>> definition to be copied down to the underlying promoted reference, and 
>>> this doesn't
>>> work (I get an exception reprting problems with databindings and 
>>> wrappers).
>>>
>>> From looking at the test code, it doesn't seem that this 
>>> <interface.wsdl>
>>> definition is a necessary part of the test, so I changed the above to:
>>>
>>>     <reference name="EchoReference" promote="ComponentB/echoReference">
>>>         <interface.java interface="dbecho.Echo"/>
>>>     <!-- Replaced interface.wsdl by interface.java because TUSCANY-2324 
>>> fix uses the interface specified here
>>>         <interface.wsdl 
>>> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
>>>             wsdli:wsdlLocation="http://example.com/echo.wsdl 
>>> wsdl/echo.wsdl">
>>>             <db:databinding 
>>> xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" 
>>> name="org.apache.axiom.om.OMElement" />
>>>         </interface.wsdl>
>>>     -->
>>>         <e:binding.echo/>
>>>     </reference>
>>>
>>> and this worked OK.
>>>
>>> I'm planning to make the above change in my check-in for the builder 
>>> changes
>>> that include the fix for TUSCANY-2324.  Ideally I'd like to delete the
>>> extraneous lines completely, because of the confusion that they cause 
>>> anyone
>>> trying to understand what this sample does.  Does anyone know of a 
>>> reason
>>> why I should not do this?
>>>
>>>   Simon
>>>
>>
> 

Re: EchoDataBinding.composite needs updating for TUSCANY-2324 fix

Posted by Simon Nash <na...@apache.org>.
Raymond Feng wrote:
> Hi,
> 
> Can you clarify "the TUSCANY-2324 fix causes the <interface.wsdl> 
> definition to be copied down to the underlying promoted reference"?
> 
> <reference name="EchoReference" promote="ComponentB/echoReference">
>         <interface.wsdl 
> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)" />
>         <e:binding.echo/>
> </reference>
> 
> What will be the interfaces for the following references?
> 
> composite reference (EchoReference) interface.wsdl?
 >
Yes.

> component reference (ComponentB/echoReference)        interface.java 
> (inherited from the component type reference)? or interface.wsdl (copied 
> from the composite reference)?
> 
interface.wsdl, because the composite ref overrides the binding, so both
the composite ref binding and composite ref interface (if any) should be
copied down to the promoted component ref.

> IMO, the inheritance chain is:
> 
> composite ref (which is also the component type ref for 
> implementaiton.composite) --> promoted component ref --> component type ref
> 
There are two different things happening here.  There is inheritance,
which works as you say, and there is overriding, which goes in the
opposite direction.  In this case, overriding takes priority over
inheritance.

The main point of my question was to confirm whether or not the sample is
still valid if the component ref uses interface.java instead of interface.wsdl.
Before the TUSCANY-2324 change, interface.java was being used by the
component ref, and the test worked, so I believe that the component ref
should be using interface.java, not interface.wsdl.  The use of interface.wsdl
in the composite ref seems redundant for the purposes of this sample.

   Simon

> Thanks,
> Raymond
> --------------------------------------------------
> From: "Simon Nash" <na...@apache.org>
> Sent: Sunday, July 20, 2008 3:16 PM
> To: <de...@tuscany.apache.org>
> Subject: EchoDataBinding.composite needs updating for TUSCANY-2324 fix
> 
>> When testing my fix to TUSCANY-2324, I discovered a problem in
>> EchoDataBinding.composite in the databinding-echo sample.
>>
>> The lines:
>>
>>     <reference name="EchoReference" promote="ComponentB/echoReference">
>>         <!--
>>             <interface.java interface="dbecho.Echo"/>
>>         -->
>>         <interface.wsdl 
>> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
>>             wsdli:wsdlLocation="http://example.com/echo.wsdl 
>> wsdl/echo.wsdl">
>>             <db:databinding 
>> xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" 
>> name="org.apache.axiom.om.OMElement" />
>>         </interface.wsdl>
>>         <e:binding.echo/>
>>     </reference>
>>
>> are causing a problem because the TUSCANY-2324 fix causes the 
>> <interface.wsdl>
>> definition to be copied down to the underlying promoted reference, and 
>> this doesn't
>> work (I get an exception reprting problems with databindings and 
>> wrappers).
>>
>> From looking at the test code, it doesn't seem that this <interface.wsdl>
>> definition is a necessary part of the test, so I changed the above to:
>>
>>     <reference name="EchoReference" promote="ComponentB/echoReference">
>>         <interface.java interface="dbecho.Echo"/>
>>     <!-- Replaced interface.wsdl by interface.java because 
>> TUSCANY-2324 fix uses the interface specified here
>>         <interface.wsdl 
>> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
>>             wsdli:wsdlLocation="http://example.com/echo.wsdl 
>> wsdl/echo.wsdl">
>>             <db:databinding 
>> xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" 
>> name="org.apache.axiom.om.OMElement" />
>>         </interface.wsdl>
>>     -->
>>         <e:binding.echo/>
>>     </reference>
>>
>> and this worked OK.
>>
>> I'm planning to make the above change in my check-in for the builder 
>> changes
>> that include the fix for TUSCANY-2324.  Ideally I'd like to delete the
>> extraneous lines completely, because of the confusion that they cause 
>> anyone
>> trying to understand what this sample does.  Does anyone know of a reason
>> why I should not do this?
>>
>>   Simon
>>
> 


Re: EchoDataBinding.composite needs updating for TUSCANY-2324 fix

Posted by Raymond Feng <en...@gmail.com>.
Hi,

Can you clarify "the TUSCANY-2324 fix causes the <interface.wsdl> definition 
to be copied down to the underlying promoted reference"?

<reference name="EchoReference" promote="ComponentB/echoReference">
         <interface.wsdl 
interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)" />
         <e:binding.echo/>
</reference>

What will be the interfaces for the following references?

composite reference (EchoReference) 
interface.wsdl?
component reference (ComponentB/echoReference)        interface.java 
(inherited from the component type reference)? or interface.wsdl (copied 
from the composite reference)?

IMO, the inheritance chain is:

composite ref (which is also the component type ref for 
implementaiton.composite) --> promoted component ref --> component type ref

Thanks,
Raymond
--------------------------------------------------
From: "Simon Nash" <na...@apache.org>
Sent: Sunday, July 20, 2008 3:16 PM
To: <de...@tuscany.apache.org>
Subject: EchoDataBinding.composite needs updating for TUSCANY-2324 fix

> When testing my fix to TUSCANY-2324, I discovered a problem in
> EchoDataBinding.composite in the databinding-echo sample.
>
> The lines:
>
>     <reference name="EchoReference" promote="ComponentB/echoReference">
>         <!--
>             <interface.java interface="dbecho.Echo"/>
>         -->
>         <interface.wsdl 
> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
>             wsdli:wsdlLocation="http://example.com/echo.wsdl 
> wsdl/echo.wsdl">
>             <db:databinding 
> xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" 
> name="org.apache.axiom.om.OMElement" />
>         </interface.wsdl>
>         <e:binding.echo/>
>     </reference>
>
> are causing a problem because the TUSCANY-2324 fix causes the 
> <interface.wsdl>
> definition to be copied down to the underlying promoted reference, and 
> this doesn't
> work (I get an exception reprting problems with databindings and 
> wrappers).
>
> From looking at the test code, it doesn't seem that this <interface.wsdl>
> definition is a necessary part of the test, so I changed the above to:
>
>     <reference name="EchoReference" promote="ComponentB/echoReference">
>         <interface.java interface="dbecho.Echo"/>
>     <!-- Replaced interface.wsdl by interface.java because TUSCANY-2324 
> fix uses the interface specified here
>         <interface.wsdl 
> interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
>             wsdli:wsdlLocation="http://example.com/echo.wsdl 
> wsdl/echo.wsdl">
>             <db:databinding 
> xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" 
> name="org.apache.axiom.om.OMElement" />
>         </interface.wsdl>
>     -->
>         <e:binding.echo/>
>     </reference>
>
> and this worked OK.
>
> I'm planning to make the above change in my check-in for the builder 
> changes
> that include the fix for TUSCANY-2324.  Ideally I'd like to delete the
> extraneous lines completely, because of the confusion that they cause 
> anyone
> trying to understand what this sample does.  Does anyone know of a reason
> why I should not do this?
>
>   Simon
>