users@jersey.java.net

[Jersey] Re: generic approach to resource class

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Tue, 22 Nov 2011 08:12:58 -0800

2011/11/22 Brendan cheng <ccp999_at_hotmail.com>:
> Hi,
> I'm new to Jersey and Restful service and I think of an approach to my
> domain but not sure if it is conceptually correct.
> I hava a set of classes ready to service the client side requests.  Each
> request is corresponding to a method of these classes. I would like to
> create a generic module that when a request or a method call is received, it
> will instantiate a instance of one of these classes according to id from the
> path and then load the method requested with the params provided as a call
> the class method and transfer the result from the method back to client.
>  This way I only need to write one module for the whole Restful services.

Hmmh. Wouldnt that sort of be missing the point of JAX-RS?
That is, what is the benefit of dynamic dispatch over simple
annotation based mapping of methods.

-+ Tatu +-