On Dec 21, 6:25 am, Matt Moriarity <[email protected]> wrote:
> But in order to get your static service methods (besides just the find > method), you need a ServiceLocator for your service: > do all these methods have to be static ? I thought the idea behind 2.1.1 was to get rid of static ? I am a bit confused on what is meant by the term "service" methods. Normally we have a "Service Layer", and a "Data Access Layer" Data Access Layer (all the DAOs), responsible for communicating with persistent stores to find objects of a "given type" findCustomerById, ByEmail, AllCustomers, AllCustomersWithCriteriaX all of this goes into CustomerDAO then you need a Service Layer, that uses many of these DAOs to satisfy a use case. PersonService, might use PersonDAO, AccountDAO, and more ..., performs a business logic on them and take some action. in RequestFactory 2.1.1, do you think the ServiceLayer and ServiceLocator is just for locating the DAOs or the Service objects as I described ? (because in RequestFactory 2.1 even the DataAccess (DAOs) where inside Entity class. to achieve the complete isolation we need a ServiceLayer + DataAccessLayer on top of our Entities. with RF 2.1.1, can we specify just the Service method in GWT, and leaving the job of dealing with DAOS to the Service object ? > @ProxyFor(value = Person.class, locator = PersonLocator.class) > > then having a PersonLocator which implements Locator<Person> would fix this > for you. > > @Service(value = PersonService.class, locator = MyServiceLocator.class) > > I'm not sure if the locator for the service is necessary if it has a default > constructor. We use Spring, so we have a service locator that just pulls the > bean out of spring. I am planning to use it with Spring too. in your case (spring), you need all 4 attributes ? on PersonProxy we use @ProxyFor(EntityObject, EntityLocator) on PersonService we use @Service(ServiceObject, ServiceObjectLocator) so the EntityLocator is the DAO ? and ServiceLocator queries spring context to find the Service method to handle the EntityLocator ? yet, all of these methods have to be static ? Thank You -- 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.
