Services are loaded by the normal class loader without any special
trickery.  We create classes (proxies and such), but don't modify
existing classes for Tapestry IoC.  This is necessary to ensure that
services code inter-operates properly with all kinds of third party,
legacy and other code that is far, far beyond the scope of Tapestry
IoC.

To encourage service implementations to properly store service
depenencies as final instance variables, such dependencies are passed
only into the constructor.

So for services, injection is assumed, for the constructor parameters
(as if an @Inject annotation was present).

Now for components, it's a different story.  The component classes are
very specific to Tapestry, not intended for reuse elsewhere, and are
modified at runtime to work properly and efficiently within the
constraints of Tapestry's multi-threaded runtime environment.

Tapestry components are quite a bit different from service, in terms
of lifecycle, and in terms of the what can be injected (all sorts of
resources besides services) and in the fact that they q

On Nov 10, 2007 12:59 PM, Martin Strand
<[EMAIL PROTECTED]> wrote:
> I was just wondering the opposite - why not constructor injection for
> pages/components?
>
> Martin
>
>
> On Sat, 10 Nov 2007 21:43:10 +0100, Michael Courcy
> <[EMAIL PROTECTED]> wrote:
>
> > Hi
> >
> > Thanks again for this effort of documentation.
> >
> > I have a question about dependency injection between services.
> >
> > We can inject a service thanks to the @Inject annotation in a page
> > component.
> > I find this feature pretty handy.
> >
> > But (correct me if I'm wrong but I think I'm not because I test it) we
> > can't @Inject a service in a sercice.
> > Instead we must provide the service to the other service through its
> > constructor.
> >
> > Why did you make this choice ?
> >
> > I would find useful as well to inject a service in a service with the
> > same annotation ?
> >
> > Michael
> >
> >
> > Howard Lewis Ship a écrit :
> >> I've been working on new documentation about Tapestry IoC (similar
> >> stuff will be coming for Tapestry core):
> >>
> >> Overview:
> >>
> >> http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/overview.html
> >>
> >> Cookbook:
> >>
> >> http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/cookbook/index.html
> >>
> >> Feedback is encouraged!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to