Book Image

RESTful Java Patterns and Best Practices

By : Bhakti Mehta
Book Image

RESTful Java Patterns and Best Practices

By: Bhakti Mehta

Overview of this book

<p>The convergence of social networking, cloud computing, and the era of mobile applications has created a generation of emerging technologies that allow different networked devices to communicate with each other over the Internet with REST. REST has the benefits of being stateless; easing scalability, visibility, and reliability; and being platform and language agnostic.</p> <p>This book is a practical, hands-on guide that provides you with clear and pragmatic information to take advantage of the real power of RESTful services and gives you a good foundation for using them in your applications. By comparing APIs from platforms such as Facebook, Twitter, GitHub, and PayPal, the book teaches a range of exciting capabilities with RESTful services and explores the infinite possibilities by using the diverse building blocks and tips covered in various chapters.</p> <p>By the end of the book, you will be able to successfully use the concepts explained to design and implement applications based on best practices for RESTful services.</p>
Table of Contents (15 chapters)
RESTful Java Patterns and Best Practices
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction to REST


REST is an architectural style that conforms to the web standards such as using HTTP verbs and URIs. It is bound by the following principles:

  • All resources are identified by the URIs

  • All resources can have multiple representations

  • All resources can be accessed/modified/created/deleted by standard HTTP methods

  • There is no state information on the server

REST and statelessness

REST is bound by the principle of statelessness. Each request from the client to the server must have all the details to understand the request. This helps to improve visibility, reliability, and scalability for requests.

Visibility is improved, as the system monitoring the requests does not have to look beyond one request to get details. Reliability is improved as there is no check-pointing/resuming in case of partial failures. Scalability is improved because the number of requests that can be processed by the server increases, as the server is not responsible for storing any state.

Note

Roy Fielding's dissertation on the REST architectural style provides details on the statelessness of REST. Check http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm for more information.

With this initial introduction to the basics of REST, we shall cover the different maturity levels and how REST falls in it in the following section.