You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2009/09/30 01:50:18 UTC

Binding name in the promotion case

Hi,

For a composite service like:

<service name="Service2" promote="Component1/Service1">

<component name="Component1">
    <service name="Service1">
        <binding.sca/> <!-- it can be created implicitly too if no bindings 
are present -->
    </service>
</component>

The binding.sca will get a name "Service1". When it is inherited by the 
composite service "Service2", what happens to its name? Should it be 
"Service1" or "Service2"?

I had to adjust 
tuscany/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java 
under [1] to get it working with my changes which now calculates the binding 
names before they are copied from the componentType to components.

[1] http://svn.apache.org/viewvc?rev=820125&view=rev

Thanks,
Raymond
---
Raymond Feng
Apache Tuscany PMC Member: http://tuscany.apache.org
Co-author of Tuscany In Action: http://www.manning.com/laws
 


Re: Binding name in the promotion case

Posted by Simon Nash <na...@apache.org>.
Simon Laws wrote:
> Hi Raymond
> 
> Prior to your changes the logic is pretty dumb. After the component
> type build the binding URI builder takes a second pass through the
> hierarchy and sets non-null binding names to the reference or service
> name as appropriate.
> 
> In your case it you've copied a binding that is already named it will
> retain its old name.
> 
> Now the spec says that, when binding names are not specified, the name
> is taken from the reference or service name. It's not explicit about
> what happens in the inheritance case but I would expect it to be
> "Service2" in your scenario.
> 
> Firstly do you need the copied binding to be in place in order to do
> policy processing and does it need to be named
> If so we may need to enact the binding naming algorithm inside the
> composite component type and component configuration builders.
> 
> Regards
> 
> Simon
>
This should be raised as a spec issue.  I would expect the name to be
assigned at the component level and used at the composite level (which
means it would be Service1).  However this isn't clear and the spec
should be explicit on whether the name is assigned before or after
the promotion is processed.

After this week I won't be participating in the OASIS TCs, so can
someone else raise this spec issue?

   Simon

Re: Binding name in the promotion case

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

Prior to your changes the logic is pretty dumb. After the component
type build the binding URI builder takes a second pass through the
hierarchy and sets non-null binding names to the reference or service
name as appropriate.

In your case it you've copied a binding that is already named it will
retain its old name.

Now the spec says that, when binding names are not specified, the name
is taken from the reference or service name. It's not explicit about
what happens in the inheritance case but I would expect it to be
"Service2" in your scenario.

Firstly do you need the copied binding to be in place in order to do
policy processing and does it need to be named
If so we may need to enact the binding naming algorithm inside the
composite component type and component configuration builders.

Regards

Simon