> is it possible to use tapestry-ioc to inject services into domain objects? First, I don't think it's good practice to inject services into domain objects. If some operation of domain object really needs to use a service, you could pass a service instance to that specific method instead of injecting it. To my understanding, Tapestry dependency injection is mainly for services. You could inject a dependency as a parameter of the service builder method, or as a parameter of the service implementation's constructor(for autobuilt services), or as a parameter of the module builder's constructor.
> when using (build-time) AOP i need a reference to the registry, but how do > i get it? The default Tapestry application registry is created in TapestryFilter, and I don't see it's published out. You could of course create your own registry using RegistryBuilder and publish it somehow, but I don't think that's a good practice to have a registry in your class and retrieve services from it. Cheers, Jeffrey Ai kristian.marinkovic wrote: > > hi all, > > is it possible to use tapestry-ioc to inject services into domain > objects? i'm thinking of something like @Configurable in spring. > > when using (build-time) AOP i need a reference to the registry, > but how do i get it? preferably i'd assign the generated proxy > to the fields. > > i'd appreciate any suggestions! > > g, > kris > > example code: > public class Order { > @Inject Repository repository; > @Inject Notification notification; > } > > -- View this message in context: http://www.nabble.com/-T5--injecting-services-into-Domain-Objects-tp14250305p14258571.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]