tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Becker <dan.o.bec...@gmail.com>
Subject Re: Should Tuscany support Injection of service references through Constructors
Date Fri, 10 Oct 2008 13:21:40 GMT
Ramkumar R wrote:
> 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.

Supporting properties on an object is a good thing. It seems to me 
injecting them at construction is a special case of injecting them via a 
setter, namely the former is setting some properties, albeit at object 
creation time. I always thought it was a good thing to have a formal 
method which sets properties and always have the special constructor 
call that method.

Thanks, Dan Becker

View raw message