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

Toolbox

Although Restbucks is contrived to provide a simple problem domain, we will be using real web technologies. We will choose the appropriate URIs for identifying resources, identify the formats that meet business and technical requirements, and apply the necessary patterns for modeling and implementing interactions. With that in mind, it’s time to see some examples of how web technologies might be used to model interactions.

Restbucks Formats

We discussed formats for resource representations in general terms in Chapter 1, but here we’ll introduce formats that Restbucks uses in its business. All Restbucks resources are represented by XML documents defined in the http://restbucks.com namespace and identified on the Web as the media types application/xml and application/vnd.restbucks+xml for standard XML processing and Restbucks-specific processing, respectively.[15]

Note

We’ve chosen XML-based formats deliberately for this book since they’re easily understood and readable by humans. However, we shouldn’t see XML as the only option. As we discussed in Chapter 1, real web services use myriad other formats, depending on the application.

Example 2-1 shows an order represented in XML, with the different specialties and options drawn from the Restbucks menu. We’ve chosen element names for the XML representations that are easy for humans to understand, even though that is not strictly necessary for machine-to-machine communication. However, we believe there’s value in making representations—like ...

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