hi markus,

contribute a HibernateConfigurer to the HibernateSessionSource
that adds a (Hibernate) PostLoadEventListner.  This listener then
uses a "InjectorService" to inject services into entities... maybe with 
some
javassist magic :)

g,
kris



Von:    Markus Feindler <markus.feind...@gmx.de>
An:     Tapestry users <users@tapestry.apache.org>
Datum:  25.05.2010 12:55
Betreff:        Re: Using / Injecting Tapestry 5 services in objects that 
are *not* components / pages / services



Hi, how would I pass services to a domain object? what do I have to 
configure? For Example if I read some objects from a database via 
hibernate, where I dont have any control of instantiation.

Martin Strand schrieb:
> On Tue, 25 May 2010 12:07:05 +0200, Andreas Berg <si...@taz.de> wrote:
>
>> The only way I
>> see so far is to pass the service as parameters or by constructor to my
>> domains objects, which is not very nice.
>
> What's bad with constructor injection?
> I would personally even prefer to have constructor injection in 
> component classes too.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


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


Reply via email to