[ 
https://issues.apache.org/jira/browse/TUSCANY-2643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julien Bigot updated TUSCANY-2643:
----------------------------------

    Attachment: second-solution.patch

After some discussions with slaws on IRC, I think this solution is better. The 
behavior implemented is now the following : an implementation instance is 
linked to a component.

i.e.
 - if more than one component whose scope is composite share the same 
componentType (even inside an unique composite), each one will have its own 
implementation instance.
 - if more than one composite instance (i.e. component whose implementation is 
implementation.composite) are instances of the same composite (they share the 
same type) and if this composite contains a component whose scope is composite, 
these will share the same implementation instance.

> composite scope handled incorectly
> ----------------------------------
>
>                 Key: TUSCANY-2643
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2643
>             Project: Tuscany
>          Issue Type: Bug
>          Components: C++ SCA
>    Affects Versions: Cpp-Next
>         Environment: Svn revision 704493
>            Reporter: Julien Bigot
>         Attachments: first-solution.patch, second-solution.patch
>
>
> Scope composite is not handled correctly.
> The actual behavior is to return the same implementation instance for all 
> call to a service of a component whose scope is composite. In the case where 
> there is more than one component with composite scope, this means that the 
> first implementation instantiated is returned regardless of the actual 
> component one is looking for.
> If the two components have a different ComponentType, this will likely lead 
> to a segfault.
> I have implemented another behavior.
> With my patch, when using a service of a composite implementation, the name 
> of the component is used as a unique ID, this is still not optimal as two 
> components can have the same name inside two different composite or if more 
> than one instance of  a given composite are created.
> This does not scale well too as a map is used. The straightforward solution 
> would be to have the implementation instance referenced in the Component 
> class. but as this class is defined in the tuscany::sca::model namespace, I'm 
> not sure it is Ok to modify it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to