Like Java, the .NET platform has frameworks, such as Windows Communication Foundation (WCF), that make working with HTTP more pleasant and productive. Again like Java, there’s no obvious framework for building hypermedia-aware services, so Restbucks developed one.
The Restbucks framework decouples hypermedia from business activities, and transparently maps between the service implementation and the DAP advertised to consumers. Figure 5-13 shows a logical view of how a service processes incoming and outgoing resource representations. A similar approach can be used to build consumers with the same framework.
Figure 5-13. Separating network, hypermedia, and business logic
In our solution, the network layer deals with HTTP and is
provided by the .NET Framework. The hypermedia layer deals with
resource state transitions. For incoming representations, it
determines whether the request is valid given the current resource
state. For outgoing representations, the hypermedia layer injects
<dap:link> elements, which
advertise the next legal protocol steps, into the response. The
business layer, meanwhile, focuses exclusively on application logic
and its data.
The hypermedia framework manages resource state transitions by embedding appropriate hypermedia controls into a response based on both the state of the resource targeted ...