asp.net mvc - When implementing RESTful services should lookup values / tables get their own URI? -
Based on a modified version of I am creating permanent services for many database organizations. Some of these organizations are linked to lookup tables, as shown below:
Lookup tables are associated with one and only one table. Additionally, lookup tables will be used to populate dropdown lists, previewviews, and comboboxes by the client application for editable areas of their respective unit tables.
To see the values / table should get their own URR or do they "share" with their parents? What are the pros / cons of each?
Option 1: / Entities / Space / Space credentials / Option 2: Lookup / Space credentials /
In a rental system, the methods of building your URLs are not as important as identifying resources and the names you give them.
From what you have shown, it seems that you have three resources:
- Space
- Spacequery
- Lookup
The URI, which you give to these resources, is a matter of great taste. For example, someone in REST prevents you from defining a URI system, in which each resource, regardless of its type, is assigned a hash code and is accessed through it:
{Hash}
Some frameworks, such as Rail, use the resource name in the URI, facilitate nested resource URI successors to make it. But this is just a conference that can follow your application or not.
REST defines many difficulties, which is one of the toughest, it is an application. One advantage of this obstacle is that it promotes loose coupling between your app and its customers.
The idea is that when the client requests a resource through a URI, the contract is that the customer can choose another URI based on the link given in the resource representation only. This is not the opposite of how to use the browser to follow the link in a web page.
This contradicts with the RPC-style approach, where the URI templates are published and the clients become rigid in code.
If you work better than nested URI flats at some point in the future, you can change your URI scheme and it will not break any client code. You can also move resources entirely to a different domain or change the protocol from HTTP to HTTPS, or FTP. Your URI templates have not been published and therefore no client code should have been written against them.
Instead, your app only starts serving new links, and the client starts following them.
When I initially exposed it (and still feeling feeling towards me) I had found all this in-the-minded essence. There are not many examples which explain the concept, but one For, see.
Comments
Post a Comment