Preface

THE WEB HAS REVOLUTIONIZED THE WAY WE ACCESS AND SHARE INFORMATION. In just two decades, it has become the global platform for delivering and consuming services.

The pervasiveness and ubiquity of the Web stems from the way it combines architectural simplicity with a small set of widely accepted technologies. The Web provides scalability, security, and reliability for those systems that embrace its simple tenets, and it does so using commodity tools and platforms.

Our goal in this book is twofold: to demystify the Web as an application platform and to showcase how web architecture can be applied to common enterprise computing problems. Throughout the chapters, we make it a point to demonstrate how services can leverage the Web both inside and outside enterprise boundaries. Our vision is of an information platform that is open and available to other systems, which eschews integration in favor of composition, and yet implements valuable business behaviors: a distributed, hypermedia-driven application platform.

You don’t have to know REST or HTTP in detail in order to understand this book. We’ll take you from simple integration through to sophisticated business protocols, all with detailed code examples that you can adapt for your own ends.

Should I Read This Book?

Like most of us, you’re probably already building something that feeds into the Web, and you’ve probably used tools and patterns for the Web that seem pretty useful. Then you’ve tackled typical enterprise problems and wondered why it can’t be as nice as the web stuff.

You’re seeing the benefits of the Web all around and you start to question whether your enterprise’s expensive middleware offers a good return on investment, or whether it will ever scale to meet your users’ demands.

You might be a developer who wants to understand the Web’s principles in more detail, and likes to learn through code examples. You’ve heard terms such as URIs, HTTP, and Atom, and you want to learn more about them, including the type of support you can get from popular programming platforms.

You may even be an enthusiast who has heard about REST and wants to know what it is all about. You want to learn more about “hypermedia” and the REST architectural style so that you can build resource-oriented systems and implement sophisticated business protocols atop the Web.

This book will help.

Should I Skip This Book?

If you are looking to learn how to design websites or how to write JavaScript applications, this book will not offer you much, though there’s plenty for competent AJAX developers to leverage from our approach to building backend services.

If you are looking to build mashups or systems for people to use directly, this book is probably not for you. We’ve focused on machine-to-machine interactions. In fact, this book is full of machines talking to one another through the Web.

We rather like it that way.

Resources

The book is accompanied by a website: http://restinpractice.com. There you’ll find working code samples from the book, links to other resources, errata, and community information. We will make every effort to continuously update the site with more information.

What Did You Think About the Book?

We are very interested in your thoughts on this book, positive or negative. You can head to Amazon and share your thoughts by writing a review. Alternatively, O’Reilly would be more than happy to hear your views at:

http://www.oreilly.com/catalog/9780596805821/

Errata

While we have made every effort to keep the book error-free, we have probably missed a few things. Errata give readers a way to let us know about typos, errors, and other problems with the book. You can head to the book’s URI at O’Reilly in order to let us know. We’d really appreciate it:

http://www.oreilly.com/catalog/9780596805821/

Alternatively, you can reach us directly. Our contact details can be found on the book’s website:

http://restinpractice.com

We will post corrections on both websites as soon as possible after confirming the identified issue. O’Reilly can also fix errata in future printings of the book and on Safari, so you can help make the book even better. We’ll credit your assistance on the website and in any future editions too!

Conventions Used in This Book

The following font conventions are used in this book:

Italic

Indicates Internet addresses, such as domain names and URIs, and new items where they are defined

Constant width

Indicates method, variable, and class names in programs; also, XML element and attribute names, and HTTP idioms

Constant width bold

Indicates emphasis in program code lines

Note

This icon signifies a tip, suggestion, or general note.

Warning

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, authors, publisher, copyright holder, and ISBN. For example: “REST in Practice by Jim Webber, Savas Parastatidis, and Ian Robinson (O’Reilly). Copyright 2010 Jim Webber, Savas Parastatidis, and Ian Robinson, 978-0-596-80582-1.”

If you feel your use of code examples falls outside fair use or the permission given here, feel free to contact us at .

How to Contact Us

We have tested and verified the information in this book to the best of our ability, but you may find that features have changed (or even that we have made a few mistakes!). Please let us know about any errors you find, as well as your suggestions for future editions, by writing to:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the U.S. or Canada)
707-829-0515 (international/local)
707-829-0104 (fax)

O’Reilly has a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://www.oreilly.com/catalog/9780596805821/

The book also has its own website at:

http://restinpractice.com

To comment or ask technical questions about this book, send email to:

For more information about our books, conferences, Resource Centers, and the O’Reilly Network, see our website at:

http://www.oreilly.com

Safari® Books Online

Safari Books Online is an on-demand digital library that lets you easily search over 7,500 technology and creative reference books and videos to find the answers you need quickly.

With a subscription, you can read any page and watch any video from our library online. Read books on your cell phone and mobile devices. Access new titles before they are available for print, and get exclusive access to manuscripts in development and post feedback for the authors. Copy and paste code samples, organize your favorites, download chapters, bookmark key sections, create notes, print out pages, and benefit from tons of other time-saving features.

O’Reilly Media has uploaded this book to the Safari Books Online service. To have full digital access to this book and others on similar topics from O’Reilly and other publishers, sign up for free at http://safaribooksonline.com.

Acknowledgments

We would like to thank all our community reviewers for their feedback and advice over the course of this book project. They all volunteered their time to help us write this book over several years: Solomon Duskis, Rafael de F. Ferreira, Glen Ford, Martin Fowler, Colin Jack, Ken Kolchier, Sriram Narayan, Eric Newcomer, Barry Norton, Chris Read, Ryan Riley, Guilherme Silveira, Halvard Skogsrud, Nigel Small, Monika Solanki, Stefan Tilkov, Jon Tirsen, Spiros Tzavellas, Steve Vinoski, Lasse Westh-Nielsen, and Herbjörn Wilhelmsen.

Our O’Reilly reviewers also deserve to be called out for their very useful and prompt feedback: William Martínez Pomares and Zach Kessin.

Our great appreciation and warm thanks go to our editor, Simon St.Laurent.

Special thanks to Mark Baker, who inspired us to write this book, educated us along the way, and never gave up on us.

This book wouldn’t have been possible without the constant love and support of our families and friends. Special thanks go to Kath, Mary, Lottie, Tiger, and Elliot. It’s been a long road.

Our deepest thanks to you all.

Get REST in Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.