4 ms·
curious: why is the initial resource used to get the list of slots /doctors/mjones/slots?date=20100104&status=open and not /slots?doctor=mjones&date=20100104&st
by mattberg 16y ago
curious: why is the initial resource used to get the list of slots /doctors/mjones/slots?date=20100104&status=open and not /slots?doctor=mjones&date=20100104&status=open?
if i am setting up future communications at /slots/1234, to me /slots?doctor=mjones&date=20100104&status=open makes more sense. would you typically just have both resources available at those locations?
- rgoddard 16y agoSomething like depends on the context of the whole application and how you want to organize it. The first way puts the emphasis on the /doctors/mjones/... If you have other actions related to doctors like /doctors/mjones/contact, this way can provide a more coherent organization. Plus you can extend it to something like /labs/questdiagnostic/mri/slots? So you can decouple the concept of 'slots' from doctor, allowing you to extend it to other types of appointments without having to alter slots. The parameters are the items that are also the most likely to vary. When making an appointment you will check multiple days, but you are much less likely to check multiple doctors. Plus the days are more temporal in nature while the list of doctors is going to stay the same for longer.