On Tue, 07 Feb 2012 11:08:52 -0200, Erik Fäßler <erik.faess...@uni-jena.de> wrote:

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).

It depends on the service scope. The default one, singleton, will always return the same object, and Tapestry-IoC also provides the perthread one, which returns the same object in the same thread. You can add your own scope too.

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 think the algorithms are good candidates for singleton services, as they're most probably stateless.

--
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

Reply via email to