Cover by Savas Parastatidis, Jim Webber, Ian Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

URI Templates

Often in distributed systems, service providers offer machine-readable metadata that describes how clients should bind to and interact with services. For example, you would normally use interface definition languages (IDLs) such as Web Services Description Language (WSDL) for WS-* Web Services, or CORBA-IDL when implementing CORBA systems. On the Web, various metadata technologies are used to describe service contracts, including URI templates, which describe syntactic patterns for the set of URIs that a service supports.

When used properly, URI templates can be an excellent tool for solution designers. As we discuss in later chapters, they are particularly useful for internal service documentation.

Warning

When used poorly, URI templates increase coupling between systems and lead to brittle integration. In subsequent chapters, we’ll see how hypermedia greatly reduces the necessity to share URI templates outside services.

Intuitive URIs

A service advertising URI templates encourages its consumers to construct URIs that can be used to access the service’s functionality. As an example, let’s take Restbucks, which exposes ordering information through URI-addressable resources, such as http://restbucks.com/order/1234.

To a web developer, it should be intuitive that changing the number after the final / character in the URI will probably result in another resource representation being returned for a different order. It’s easy to determine how to vary the contents of a simple ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required