I know (though, like already said, I'm not quite sure why that is so). But: registry.getService() won't give me a new object but an already existing object (right? My experience tell's me so, but perhaps I have missed an option).
Since I have to differentiate somehow between my use cases which all run at the same time in the same JVM, I will most certainly need some objects (in the sense of "class instance") which now their exact purpose (different models, different preprocessing etc). In the end I need the capability to have multiple "things" which share some algorithms (I though to use service at this point, as pure algorithms) but apart from that represent one single and well defined behavior. I guess it will not be be necessary to use class instances extensively, but to some extent they may be useful for my purpose. Am 07.02.2012 um 13:00 schrieb Thiago H. de Paula Figueiredo: > On Tue, 07 Feb 2012 06:31:59 -0200, Erik Fäßler <erik.faess...@uni-jena.de> > wrote: > >> One more question: Currently I instantiate objects with dependency injection >> by using "autobuild" (as a method call to the registry or as an annotation >> at an injection point). Is there another, perhaps more encouraged way to get >> objects (I read the "Injection in Detail" quite carefully but I might have >> missed something; after all I already read the whole documentation, parts of >> it multiple times, and yet did miss the possibility to work with objects)? > > Declaring them as services and getting them using Registry.getService() is > better than using Registry.autobuild(), as it has some additional features > like services being able to be injected directly in other services, > decoration, advising, service overrides and distributed configuration. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org