Book Image

RESTful Java Web Services, Second Edition

Book Image

RESTful Java Web Services, Second Edition

Overview of this book

Table of Contents (17 chapters)
RESTful Java Web Services Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Identifying resources in a problem domain


The basic steps that you may need to take while building a RESTful web API for a specific problem domain are as follows:

  1. Identify all possible objects in the problem domain. This can be done by identifying all nouns in the problem domain. For example, if you are building an application to manage employees in a department, the obvious nouns are department and employee.

  2. The next step is to identify the objects that can be manipulated using the CRUD operations. These objects can be classified as resources. Note that you should be careful while choosing resources. Based on the usage pattern, you can classify resources as top-level and nested resources (which are the children of a top-level resource). Also, there is no need to expose all resources for use by the client; expose only those resources that are required for implementing the business use case.