You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Shu Chao Wan <wa...@cn.ibm.com> on 2009/01/08 10:52:10 UTC

Confusion about conformance item ASM60008

hi, guys,

I'm testing conformance item ASM60008, and found something strange.

In ASM60008, it says that "The interfaces of the component references 
promoted by a composite reference MUST be the same, or if the composite 
reference itself declares an interface then all the component reference 
interfaces must be compatible with the composite reference interface. 
Compatible means that the component reference interface is the same or is 
a strict subset of the composite reference interface."

In order to verify this statement, I wrote a composite file like that
<composite>...
 <service name="AService" promote="AComponent"/>
        <component name="AComponent">
                <implementation.java
                        class=
"org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl" />
                <reference name="b"/>
                <reference name="c">
                        <interface.java interface="
org.apache.tuscany.sca.vtest.assembly.composite.CService" />
                </reference> 
        </component>
        <reference name="c" promote="AComponent/c">
                <interface.java interface="
org.apache.tuscany.sca.vtest.assembly.composite.CContainService" />
        </reference>
        <reference name="b" promote="AComponent/b"/> 
 <service>
</composite>

Here, the interface CService is subset of interface CContainService, that 
is to say, interface CContainServicecontains more methods than interface 
CService does.

But when I load this composite file, I got warning message:
WARNING: Interface of composite reference AComponent/c must be compatible 
with the interface declared by promoted component reference.
Jan 8, 2009 4:46:41 PM 
org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
WARNING: Incompatible interfaces on component reference and target: 
Composite = 
{http://assembly-tests}Assembly-sub-reference-interface-outer-Composite 
Reference = c Service = CComponent

It seems that this warning message conflicts with this conformance item, 
which causes that service can not be invoked correctly in the following 
test. 

I'm not sure which statement should be the right one. Thanks for your 
help.



Best Regards
Susan Wan (万淑超)
-------------------------
WebSphere Application Server System Verification Test, IBM China SoftWare 
Development Lab
Tel: 86-10-82453655 
E-mail: wansc@cn.ibm.com 
Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang 
West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC

Re: Confusion about conformance item ASM60008

Posted by Shuchao Wan <wa...@gmail.com>.
This Jira has been set as resolved status by Dan, but I think it is still a
problem.

Here is excerpt from Dan's explanation
-----------------------------------------------------------------------------
Since your example has no assignable relationship between the two
interfaces, they are not compatible. (Otherwise SCA implementation would
have to introspect interface methods and compare sets which might take a
while. AssignableFrom testing is quicker.) You may retry your example by
providing object oriented hierarchy of CSuperService and CService to test
this.
-----------------------------------------------------------------------------
I have tried Dan's suggestion and let CSuperService extend CService to make
them have hierachy relationship, but the problem still exists. That's to
say, I still got warning message and service can not be invoked correctly in
the following test.

I also tried an opposite example, and replaced  CSuperService with
CSubService, from which CService is derived. In other words, CSuperService
extends CService, and CService extends CSubService.
Here is the composite file.
--------------------------------------------------------------
<component name="AComponent">
  <implementation.java
   class="org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl"
/>
  <reference name="b"/>
  <reference name="c">
   <interface.java
interface="org.apache.tuscany.sca.vtest.assembly.composite.CService" />
  </reference>
 </component>
 <reference name="c" promote="AComponent/c">
  <interface.java
interface="org.apache.tuscany.sca.vtest.assembly.composite.CSubService" />
 </reference>
--------------------------------------------------------------------

According to the specfication, this usage is invalid and warning message or
exception should be thrown. But in fact, it works well under this situation.

It seems that the tuscany implementation conflicts with specification and
that is why warning message appears at improper time. So I will open
the jira TUSCANY-2766
<https://issues.apache.org/jira/browse/TUSCANY-2766>  again.
Thanks.

2009/1/15 Shuchao Wan <wa...@gmail.com>

> hi, Simon,
> I have opened a jira TUSCANY-2766<https://issues.apache.org/jira/browse/TUSCANY-2766>against this problem. Thanks.
>
> 2009/1/9 Simon Laws <si...@googlemail.com>
>
>
>>
>> 2009/1/8 Shu Chao Wan <wa...@cn.ibm.com>
>>
>>
>>> hi, guys,
>>>
>>> I'm testing conformance item ASM60008, and found something strange.
>>>
>>> In ASM60008, it says that "The interfaces of the component references
>>> promoted by a composite reference MUST be the same, or if the composite
>>> reference itself declares an interface then all the *component reference
>>> interfaces must be compatible with the composite reference interface*.
>>> Compatible means that the component reference interface is the same or is a
>>> strict subset of the composite reference interface."
>>>
>>> In order to verify this statement, I wrote a composite file like that
>>> <composite>...
>>>  <service name=*"AService"* promote=*"AComponent"*/>
>>>         <component name=*"AComponent"*>
>>>                 <implementation.java
>>>                         class=*
>>> "org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl"* />
>>>                 <reference name=*"b"*/>
>>>                 <reference name=*"c"*>
>>>                         <interface.java interface=*"
>>> org.apache.tuscany.sca.vtest.assembly.composite.CService**"* />
>>>                 </reference>
>>>         </component>
>>>         <reference name=*"c"* promote=*"AComponent/c"*>
>>>                 <interface.java interface=*"
>>> org.apache.tuscany.sca.vtest.assembly.composite.CSuperService**"* />
>>>         </reference>
>>>         <reference name=*"b"* promote=*"AComponent/b"*/>
>>>  <service>
>>> </composite>
>>>
>>> Here, the interface *CService *is subset of interface* CSuperService*,
>>> that is to say, interface* CSuperService*contains more methods than
>>> interface *CService *does.
>>>
>>> But when I load this composite file, I got warning message:
>>> WARNING: Interface of composite reference AComponent/c must be compatible
>>> with the interface declared by promoted component reference.
>>> Jan 8, 2009 4:46:41 PM
>>> org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
>>> WARNING: Incompatible interfaces on component reference and target:
>>> Composite = {http://assembly-tests}Assembly-sub-reference-interface-outer-Composite
>>> Reference = c Service = CComponent
>>>
>>> It seems that this warning message conflicts with this conformance item,
>>> which causes that service can not be invoked correctly in the following
>>> test.
>>>
>>> I'm not sure which statement should be the right one. Thanks for your
>>> help.
>>>
>>>
>>>
>>> Best Regards
>>> Susan Wan (万淑超)
>>> -------------------------
>>> WebSphere Application Server System Verification Test, IBM China SoftWare
>>> Development Lab
>>> Tel: 86-10-82453655
>>> E-mail: wansc@cn.ibm.com
>>> Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
>>> West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC
>>
>>
>> Hi Susan
>>
>> I agree this looks like a fault to me. In these kinds of scenarios the
>> composite level reference should not constrain the component level
>> reference. I.e. The component reference may choose to exploit any of the
>> methods defined in it's interface but the composite reference shouldn't
>> restrict any of this behaviour. The composite reference may define extra
>> methods however a particular component reference may never use them.
>>
>> I suggest you commit the test with a JIRA and we can use it to look into
>> the problem.
>>
>> Regards
>>
>> Simon
>>
>
>

Re: Confusion about conformance item ASM60008

Posted by Simon Laws <si...@googlemail.com>.
2009/1/15 Shuchao Wan <wa...@gmail.com>

> hi, Simon,
> I have opened a jira TUSCANY-2766<https://issues.apache.org/jira/browse/TUSCANY-2766>against this problem. Thanks.
>
> 2009/1/9 Simon Laws <si...@googlemail.com>
>
>
>>
>> 2009/1/8 Shu Chao Wan <wa...@cn.ibm.com>
>>
>>
>>> hi, guys,
>>>
>>> I'm testing conformance item ASM60008, and found something strange.
>>>
>>> In ASM60008, it says that "The interfaces of the component references
>>> promoted by a composite reference MUST be the same, or if the composite
>>> reference itself declares an interface then all the *component reference
>>> interfaces must be compatible with the composite reference interface*.
>>> Compatible means that the component reference interface is the same or is a
>>> strict subset of the composite reference interface."
>>>
>>> In order to verify this statement, I wrote a composite file like that
>>> <composite>...
>>>  <service name=*"AService"* promote=*"AComponent"*/>
>>>         <component name=*"AComponent"*>
>>>                 <implementation.java
>>>                         class=*
>>> "org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl"* />
>>>                 <reference name=*"b"*/>
>>>                 <reference name=*"c"*>
>>>                         <interface.java interface=*"
>>> org.apache.tuscany.sca.vtest.assembly.composite.CService**"* />
>>>                 </reference>
>>>         </component>
>>>         <reference name=*"c"* promote=*"AComponent/c"*>
>>>                 <interface.java interface=*"
>>> org.apache.tuscany.sca.vtest.assembly.composite.CContainService**"* />
>>>         </reference>
>>>         <reference name=*"b"* promote=*"AComponent/b"*/>
>>>  <service>
>>> </composite>
>>>
>>> Here, the interface *CService *is subset of interface* CContainService*,
>>> that is to say, interface* CContainService*contains more methods than
>>> interface *CService *does.
>>>
>>> But when I load this composite file, I got warning message:
>>> WARNING: Interface of composite reference AComponent/c must be compatible
>>> with the interface declared by promoted component reference.
>>> Jan 8, 2009 4:46:41 PM
>>> org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
>>> WARNING: Incompatible interfaces on component reference and target:
>>> Composite = {http://assembly-tests}Assembly-sub-reference-interface-outer-Composite
>>> Reference = c Service = CComponent
>>>
>>> It seems that this warning message conflicts with this conformance item,
>>> which causes that service can not be invoked correctly in the following
>>> test.
>>>
>>> I'm not sure which statement should be the right one. Thanks for your
>>> help.
>>>
>>>
>>>
>>> Best Regards
>>> Susan Wan (万淑超)
>>> -------------------------
>>> WebSphere Application Server System Verification Test, IBM China SoftWare
>>> Development Lab
>>> Tel: 86-10-82453655
>>> E-mail: wansc@cn.ibm.com
>>> Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
>>> West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC
>>
>>
>> Hi Susan
>>
>> I agree this looks like a fault to me. In these kinds of scenarios the
>> composite level reference should not constrain the component level
>> reference. I.e. The component reference may choose to exploit any of the
>> methods defined in it's interface but the composite reference shouldn't
>> restrict any of this behaviour. The composite reference may define extra
>> methods however a particular component reference may never use them.
>>
>> I suggest you commit the test with a JIRA and we can use it to look into
>> the problem.
>>
>> Regards
>>
>> Simon
>>
>
>
Great, thanks Susan

Simon

Re: Confusion about conformance item ASM60008

Posted by Shuchao Wan <wa...@gmail.com>.
hi, Simon,
I have opened a jira
TUSCANY-2766<https://issues.apache.org/jira/browse/TUSCANY-2766>against
this problem. Thanks.

2009/1/9 Simon Laws <si...@googlemail.com>

>
>
> 2009/1/8 Shu Chao Wan <wa...@cn.ibm.com>
>
>
>> hi, guys,
>>
>> I'm testing conformance item ASM60008, and found something strange.
>>
>> In ASM60008, it says that "The interfaces of the component references
>> promoted by a composite reference MUST be the same, or if the composite
>> reference itself declares an interface then all the *component reference
>> interfaces must be compatible with the composite reference interface*.
>> Compatible means that the component reference interface is the same or is a
>> strict subset of the composite reference interface."
>>
>> In order to verify this statement, I wrote a composite file like that
>> <composite>...
>>  <service name=*"AService"* promote=*"AComponent"*/>
>>         <component name=*"AComponent"*>
>>                 <implementation.java
>>                         class=*
>> "org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl"* />
>>                 <reference name=*"b"*/>
>>                 <reference name=*"c"*>
>>                         <interface.java interface=*"
>> org.apache.tuscany.sca.vtest.assembly.composite.CService**"* />
>>                 </reference>
>>         </component>
>>         <reference name=*"c"* promote=*"AComponent/c"*>
>>                 <interface.java interface=*"
>> org.apache.tuscany.sca.vtest.assembly.composite.CContainService**"* />
>>         </reference>
>>         <reference name=*"b"* promote=*"AComponent/b"*/>
>>  <service>
>> </composite>
>>
>> Here, the interface *CService *is subset of interface* CContainService*,
>> that is to say, interface* CContainService*contains more methods than
>> interface *CService *does.
>>
>> But when I load this composite file, I got warning message:
>> WARNING: Interface of composite reference AComponent/c must be compatible
>> with the interface declared by promoted component reference.
>> Jan 8, 2009 4:46:41 PM
>> org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
>> WARNING: Incompatible interfaces on component reference and target:
>> Composite = {http://assembly-tests}Assembly-sub-reference-interface-outer-Composite
>> Reference = c Service = CComponent
>>
>> It seems that this warning message conflicts with this conformance item,
>> which causes that service can not be invoked correctly in the following
>> test.
>>
>> I'm not sure which statement should be the right one. Thanks for your
>> help.
>>
>>
>>
>> Best Regards
>> Susan Wan (万淑超)
>> -------------------------
>> WebSphere Application Server System Verification Test, IBM China SoftWare
>> Development Lab
>> Tel: 86-10-82453655
>> E-mail: wansc@cn.ibm.com
>> Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
>> West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC
>
>
> Hi Susan
>
> I agree this looks like a fault to me. In these kinds of scenarios the
> composite level reference should not constrain the component level
> reference. I.e. The component reference may choose to exploit any of the
> methods defined in it's interface but the composite reference shouldn't
> restrict any of this behaviour. The composite reference may define extra
> methods however a particular component reference may never use them.
>
> I suggest you commit the test with a JIRA and we can use it to look into
> the problem.
>
> Regards
>
> Simon
>

Re: Confusion about conformance item ASM60008

Posted by Simon Laws <si...@googlemail.com>.
2009/1/8 Shu Chao Wan <wa...@cn.ibm.com>

>
> hi, guys,
>
> I'm testing conformance item ASM60008, and found something strange.
>
> In ASM60008, it says that "The interfaces of the component references
> promoted by a composite reference MUST be the same, or if the composite
> reference itself declares an interface then all the *component reference
> interfaces must be compatible with the composite reference interface*.
> Compatible means that the component reference interface is the same or is a
> strict subset of the composite reference interface."
>
> In order to verify this statement, I wrote a composite file like that
> <composite>...
>  <service name=*"AService"* promote=*"AComponent"*/>
>         <component name=*"AComponent"*>
>                 <implementation.java
>                         class=*
> "org.apache.tuscany.sca.vtest.assembly.composite.impl.AServiceImpl"* />
>                 <reference name=*"b"*/>
>                 <reference name=*"c"*>
>                         <interface.java interface=*"
> org.apache.tuscany.sca.vtest.assembly.composite.CService**"* />
>                 </reference>
>         </component>
>         <reference name=*"c"* promote=*"AComponent/c"*>
>                 <interface.java interface=*"
> org.apache.tuscany.sca.vtest.assembly.composite.CContainService**"* />
>         </reference>
>         <reference name=*"b"* promote=*"AComponent/b"*/>
>  <service>
> </composite>
>
> Here, the interface *CService *is subset of interface* CContainService*,
> that is to say, interface* CContainService*contains more methods than
> interface *CService *does.
>
> But when I load this composite file, I got warning message:
> WARNING: Interface of composite reference AComponent/c must be compatible
> with the interface declared by promoted component reference.
> Jan 8, 2009 4:46:41 PM
> org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuilderImpl
> WARNING: Incompatible interfaces on component reference and target:
> Composite = {http://assembly-tests}Assembly-sub-reference-interface-outer-Composite
> Reference = c Service = CComponent
>
> It seems that this warning message conflicts with this conformance item,
> which causes that service can not be invoked correctly in the following
> test.
>
> I'm not sure which statement should be the right one. Thanks for your help.
>
>
>
> Best Regards
> Susan Wan (万淑超)
> -------------------------
> WebSphere Application Server System Verification Test, IBM China SoftWare
> Development Lab
> Tel: 86-10-82453655
> E-mail: wansc@cn.ibm.com
> Address: 3/F, Diamond Building, ZhongGuanCun Software Park , Dongbeiwang
> West Road No.8, ShangDi, Haidian District, Beijing 100193, PRC


Hi Susan

I agree this looks like a fault to me. In these kinds of scenarios the
composite level reference should not constrain the component level
reference. I.e. The component reference may choose to exploit any of the
methods defined in it's interface but the composite reference shouldn't
restrict any of this behaviour. The composite reference may define extra
methods however a particular component reference may never use them.

I suggest you commit the test with a JIRA and we can use it to look into the
problem.

Regards

Simon