They locate different things. A Locator class finds an entity, whereas a ServiceLocator finds a service, which may or may not be related to an entity. You can use them both at the same time, and both Locator and ServiceLocator were introduced in 2.1.1 precisely so you don't have to put persistence code into entities themselves. You can find an example of both in use here, albeit your impls will be Spring instead of Objectify:
http://code.google.com/p/listwidget/ /dmc On Tue, Feb 22, 2011 at 10:33 AM, P.G.Taboada <[email protected]>wrote: > So far so good, the serve different purposes. But I only can declare/ > use one of them? > > I want my service requests to be handled by my spring managed bean. I > have my entity manager managed by spring too. My entities obviously > are not spring beans. > > I do not understand why the Locator "job" cannot be handled by the > ServiceLocator too. In my opinion this a bad design: I want to use the > service layer so I do NOT have to put entity manager stuff into the > Entities. > > Either I am badly missing something, or the service locator does not > help any bit. > > > > On 22 Feb., 16:07, Thomas Broyer <[email protected]> wrote: > > On Tuesday, February 22, 2011 4:06:26 PM UTC+1, Thomas Broyer wrote: > > > > > They share different purpose. > > > > Sorry, from my description they obviously don't *share* anything. They * > > serve* different purposes. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- David Chandler Developer Programs Engineer, Google Web Toolkit w: http://code.google.com/ b: http://googlewebtoolkit.blogspot.com/ t: @googledevtools -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
