Claude Moore wrote:Of course I would be able to incapsulate in some wrapper object both Employee and List parameters, but I don't like a black-box container as a mean to pass parameters.
Claude Moore wrote:The trade-off with this approach is that I can pass only a single complex object plus a number of IDs of related resources. At first glance, this may imply that any entity must be identified by a simple ID (to be used in a path parameter), and that I may need to load from a database all entities I could not pass as whole objects...
I don't understand how this would be a problem. Maybe you can explain why using a resource identifier in your transaction rather than the resource itself would make things more challenging.
The only time the client should need to pass (a representation of) the resource to the server is when the resource is first being created (transferred to) the server, or when it is being replaced/updated.
Claude Moore wrote:In the example I posted, let us suppose that the assignment of the tasks to a given employee may succeed or not depending upon a certain information / property of the Employee. If I don't pass the whole entity, I need to reload data from the database (and this make take a little time)... of course that's not a big deal, anyway.
Claude Moore wrote:And this proposition makes me think a lot... Would be right to say that to accomplish a correct RESTFul approach we must focus mainly on resources, and not on relations among resources ? I would exclude that REST may be used only in stateful scenarios - when we would have a current Employee entity we are working on, it would be too limited...
| Consider Paul's rocket mass heater. |