Historically, constructor injection came first; direct field injection
(which uses reflection) came laster, in part because of student in one
of my workshops pointed out the inconsistency.

I generally prefer constructor injection as well, since the field can
then be marked "final".  That gives me a warm feeling inside.

On Thu, May 10, 2012 at 12:26 PM, Lance Java <lance.j...@googlemail.com> wrote:
> Keep in mind that you don't need to use @Inject in your services. Tapestry
> will use the constructor with the most arguments and will pass values
> matched by type (and annotations) from the registry.
>
> I prefer the constructor injection to private field injection as I can test
> my services without needing tapestry or (nasty) reflection to initialize
> the service under test.
>
> On Thursday, 10 May 2012, George Christman <gchrist...@cardaddy.com> wrote:
>> Thanks guys, I wasn't aware we could use tapestry inject outside of pages
> and
>> components.
>>
>> --
>> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Using-generics-in-tapestry-service-tp5700399p5700938.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to