RESTful resources and orthogonal resource issues

If I use an application from the 3rd level with a RESTful resource oriented service in the middle tier access through HTTP, then what is the best way to provide orthogonal resources at the user interface level?

An example of this would be a “User” resource that has a field / property for the country currently in the user interface level when editing the user I want to be able to select from the drop-down list and then update the resource using the PUT operation.

The question is, how does the list of countries get into the user interface for user editing? - I make 2 separate requests for the service, one for the resources of the country and one for the resource of the user, or I combine them into 1 request.

+3
source share
1 answer

Make two requests. This allows each view to have difference caching rules. Caching a list of countries is probably a good idea.

When I do this, my XML view looks like this:

<User>
    <Name>Bob Brown</Name>
    <Country DomainUrl="/Setup/Country/PickList">
      <Code>US</Code>
      <Description>United States</Description>
    </Country>
</User>

I also put off loading the list of countries until the user clicks on the dropdown menu.

+4
source

Source: https://habr.com/ru/post/1762804/


All Articles