On Mon, Oct 13, 2008 at 6:33 PM, Ramkumar R <[EMAIL PROTECTED]> wrote:
> Thanks Simon & Raymond, for clarifying this and directing me to the specs.
>
> The specs clearly talks how to handle this situation as shown below.
>
> 259 Cyclic references between components may be handled by the container in
> one of two ways:
> 260
> 261 • If any reference in the cycle is optional, then the container may
> inject a null value during
> 262 construction, followed by injection of a reference to the target before
> invoking any service.
> 263 • The container may inject a proxy to the target service; invocation of
> methods on the proxy may
> 264 result in a ServiceUnavailableException
>
> Let me try out the same and let you know how it goes with Spring.
>
>
> On Fri, Oct 10, 2008 at 9:12 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
>
>> Hi, Ram.
>>
>> SCA also supports constructor-based dependency injection. For example,
>>
>> @Constrcutor
>> public MyServiceImpl(@Reference OtherService service, @Property prop) {
>> ...
>> }
>>
>> Thanks,
>> Raymond
>>
>> From: Ramkumar R
>> Sent: Friday, October 10, 2008 12:56 AM
>> To: [email protected]
>> Subject: Should Tuscany support Injection of service references through
>> Constructors
>>
>>
>>
>> Hi All,
>> I came across this requirement, while working with Spring, but I believe
>> this topic also holds good for Java implementations.
>>
>> Spring supports Constructor Injection by allowing to inject properties and
>> objects via the constructors. Not sure if Tuscany should support this
>> feature? As SCA+Spring depends on Tuscany runtime for binding and dependency
>> injections.
>>
>> I believe currently Tuscany supports injection of service references
>> through getter & setter methods.
>>
>> This question arises because the biggest benefit of setter injection is
>> that it allows for circular dependencies. Circular dependencies are actually
>> pretty common. If you have a UserService that needs to get information about
>> an employer from CompanyService and the CompanyService needs information
>> about employees from UserService, right there you have a circular
>> dependency. In general I find a lot of circular dependencies between service
>> methods, but with complex object models it is possible to have circular
>> dependencies elsewhere.
>>
>> So considering the circular dependency issue, I believe it would be a bad
>> idea to support the same in Tuscany.
>>
>> Like to hear from the community for more insight on this topic and how we
>> should go about it.
>>
>> --
>> Thanks & Regards,
>> Ramkumar Ramalingam
>>
>
>
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>
Great thanks Ram, look forward to hearing more ;-)
Simon