to which resource class should this http get request be forwarded to?
Restlet's concept relies on using a unique URI for every resource, and every resource ha开发者_如何学运维s its own resource class that defines the needed functions ( get,set, put, .. etc).
lets say in the database I have three tables,
- companies
- departments
- employees
in this case, I have the following resources :
- company
- companies
- department
- departments
- employee
- employees
In case the client wants to find the name of employees in department X in the companies that are in city Y , what I want to say that, here the HTTP get request should be forwarded to which URI of the six available ones ? this HTTP get request is not associated with only one resource (table) but with multiple ones at the same time. How could this be configured ? I hope you were able to catch my question.
edit :
in other words, in which resource class should the function or method that accesses the three tables in the database be placed ?
In my opinion employees b/c you need employees names. You can also return all employee info. The REST call should should go to output related entities.
精彩评论