See https://groups.google.com/d/topic/google-web-toolkit/rC9dEaX0mok/discussion

2.1.1 will eliminate the required static methods that currently
prevent service inheritance.

/dmc

On Tue, Nov 23, 2010 at 7:13 AM, agi <[email protected]> wrote:
> Hallo,
>
> I am using RequestFactory in my project.
> What I would like to do is to have base class for some of my
> g...@service  classes which will be holding some common functionality
> ( e.g. CRUD operations)
> First try to achieve that was creating  structure like this:
>
> // request definition on client side
> @Service(CourseGwtService.class)
> CourseRequest extends RequestContext
> {
>  Request<CourseProxy> getConnectedCourse();
>  // .. other methods
> }
>
> // service definition on server (jboss) side
> public class  CourseGwtService extends BaseGwtService
> {
>  // some specific methods
> }
>
> // base implementation for gwt services
> public class  BaseGwtService
> {
>  public static Course  getConnectedCourse( )
>   {
>      return courseDao.getConnectedCourse();
>   }
> }
>
> This code compiles without errors. But after running application and
> calling getConnectedCourse() method :
>  requestFactory.courseRequest().getConnectedCourse( ).fire();
>
> I am getting an exception:
>  java.lang.IllegalArgumentException: Unknown operation
> shared.request.CourseRequest::getConnectedCourse
> at
> com.google.gwt.requestfactory.server.JsonRequestProcessor.getOperation(JsonRequestProcessor.java:
> 702) [:]
> at
> com.google.gwt.requestfactory.server.JsonRequestProcessor.processJsonRequest(JsonRequestProcessor.java:
> 844) [:]
> at
> com.google.gwt.requestfactory.server.JsonRequestProcessor.decodeAndInvokeRequest(JsonRequestProcessor.java:
> 232) [:]
>
>
> So my questions are:
> - can we use inheritance in @Service classes?
> - can we use generics arguments in @Service classes? e.g. I would like
> to create something like this:
> BaseGwtService <T>
> {
>  public static T getConnectedEntity( )
>   {
>      return dao.getConnectedEntity();
>   }
>
> public static T save( T toSave)
>   {
>      return dao.save(T toSave);
>   }
> }
>
> regards and thanks in advance:)
>
> --
> 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
http://googlewebtoolkit.blogspot.com/

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

Reply via email to