users@jersey.java.net

[Jersey] Re: generic approach to resource class

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Tue, 22 Nov 2011 11:31:54 -0500

On 11/22/2011 11:12 AM, Tatu Saloranta wrote:
> 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 +-
>
+1

Whats being proposed sounds like RPC and would miss the point of REST.

Brendan, here is a link that seems relevant on quick look:

http://www.pluralsight-training.net/community/blogs/tewald/archive/2007/04/28/47067.aspx

-- 
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com