-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

RESTful Java Web Services
By :

While building a RESTful web API, you should try avoiding the chattiness of APIs. On the other hand, APIs should not be very coarse-grained as well. Highly coarse-grained APIs become too complex to use because the response representation may contain a lot of information, all of which may not be used by a majority of your API clients.
Let's take an example to understand the difference between fine-grained and coarse-grained approaches for building APIs. Suppose that you are building a very fine-grained API to read the employee details as follows:
GET /employees/10/name
GET /employees/10/address1
GET /employees/10/address2
GET /employees/10/email
It is obvious that a majority of your clients may need all the preceding details to work on an employee resource. As a result, clients may end up making four different remote API calls to get...
Change the font size
Change margin width
Change background colour