Return-Path: Delivered-To: apmail-tuscany-dev-archive@www.apache.org Received: (qmail 44053 invoked from network); 10 Oct 2008 13:22:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Oct 2008 13:22:20 -0000 Received: (qmail 21269 invoked by uid 500); 10 Oct 2008 13:22:14 -0000 Delivered-To: apmail-tuscany-dev-archive@tuscany.apache.org Received: (qmail 21244 invoked by uid 500); 10 Oct 2008 13:22:14 -0000 Mailing-List: contact dev-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tuscany.apache.org Delivered-To: mailing list dev@tuscany.apache.org Received: (qmail 21227 invoked by uid 99); 10 Oct 2008 13:22:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 06:22:14 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_SECURITYSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dan.o.becker@gmail.com designates 66.249.82.229 as permitted sender) Received: from [66.249.82.229] (HELO wx-out-0506.google.com) (66.249.82.229) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 13:21:10 +0000 Received: by wx-out-0506.google.com with SMTP id h28so240764wxd.20 for ; Fri, 10 Oct 2008 06:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=TZHXJQtDyCPZCEWuL1HNzo1mm8pmsnxtfDaCnX7QH9A=; b=OiDigaC+EuEK/3WzJRN0hJDgj9L9aSMuFP3RzCxcXKFoKI1xd3Ly+mqB3fG/CqXp9r mtM14oaiHHilHZAVCeVPriQFGERAAulhHsoOblvEZORdT1LaXkD9ffEUNFfT3WG6DJvE aNMWExqvdTnvSvSKw048l5/eLfAVGeB1eJOgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=wDRTiGGRD6+l7ZlYBCO4Xg2xwvKGykkVmQSdWgR1mssQ+pEoV37nNQoMEWeAhgvMsL 0/IPwI6vBpZmTpta33RsUYmxFK6bbstaSf6vIkx7P+RZHK5udDgH6otldZVMRDaeuGyo vd1vl+VX5AJJGm3UhrWTqltkfy3EJfqdxFITk= Received: by 10.70.34.13 with SMTP id h13mr1679950wxh.34.1223644905630; Fri, 10 Oct 2008 06:21:45 -0700 (PDT) Received: from ?9.41.54.144? (bi01p1.co.us.ibm.com [32.97.110.142]) by mx.google.com with ESMTPS id h38sm2303070wxd.29.2008.10.10.06.21.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 10 Oct 2008 06:21:45 -0700 (PDT) Message-ID: <48EF56E4.5050909@gmail.com> Date: Fri, 10 Oct 2008 08:21:40 -0500 From: Dan Becker User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: dev@tuscany.apache.org Subject: Re: Should Tuscany support Injection of service references through Constructors References: <4d292ac10810100056h59a0ddb5s41f7514276fc3426@mail.gmail.com> In-Reply-To: <4d292ac10810100056h59a0ddb5s41f7514276fc3426@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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