• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

REST common practice

 
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic