Search code examples
javagwtservicerpcmodularity

How many GWT services


Starting a new GWT application and wondering if I can get some advice from someones experience.

I have a need for a lot of server-side functionality through RPC services...but I am wondering where to draw the line.

I can make a service for every little call or I can make fewer services which handle more operations.

Let's say I have Customer, Vendor and Administration services. I could make 3 services or a service for each function in each category.

I noticed that much of the service implementation does not provide compile-time help and at times troublesome to get going, but it provides good modularity. When I have a larger service, I don't have the modularity as I described, but I don't have to the service creation issues and reduce the entries in my web.xml file.

Is there a resource issue with using a lot of services? What is the best practice to determine what level of granularity to use?


Solution

  • in my opinion, you should make a rpc service for "logical" things. in your example:

    one for customer, another for vendors and a third one for admin

    in that way, you keep several services grouped by meaning, and you will have a few lines to maintain in the web.xml file ( and this is a good news :-)

    More seriously, rpc services are usually wrappers to call database stuff, so, you even could make a single 'MagicBlackBoxRpc' with a single web.xml entry and thousands of operations !

    but making a separate rpc for admin operations, like you suggest, seems a good thing.