Cover by Savas Parastatidis, Jim Webber, Ian Robinson

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Building the Ordering Service in .NET

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 .NET Hypermedia Framework

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.

Separating network, hypermedia, and business logic

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required