• Post Reply Bookmark Topic Watch Topic
  • New Topic

REST common practice  RSS feed

David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

so I have several views that require same set of data --> personnel daily attendance.
Personnel attendance has the following fields : employeeId, teamId, date, workHour, description, locationId
there are several views based on annual personnel attendance data -> subtotal workHour group by team, group by location and group by month (based on date field).
The question is, what's the common practice in REST:
1. Server just sends personnel daily attendance and let client handle the variants of the views based on the dataset sent by server (server serves data, not operation and only one server call, client then is free to generate any views based on that data). This approach would mean only 1 endpoint
2. Server sends the processed subtotal, so there will be endpoint for subtotal by team, by location and by month (3 endpoints). this approach means server serves operation (just like SOAP), not data, and server will be called 3 times instead of just once.

I personally think approach 1 is more RESTful since server should only serve data, not operation like SOAP. Any thoughts?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!