-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Building a RESTful Web Service with Spring
By :
One common piece of software in use in the hospitality industry is a property management system (careful readers will notice the unfortunate acronym for these systems). It allows automating the operations of hotels and B&Bs. For the purpose of this book, we will build such a system using Spring. Each component of this system will expose a RESTful API that will be consumed by a simple web interface.
Designing effective Application Programming Interfaces is a topic that deserves its own treaty. It is beyond the scope of this book to discuss these concerns in detail. The main characteristics that one should bear in mind when designing APIs are: ease of use, consistency, exposing as little as necessary, extensibility, and forward compatibility.
Our property management system will be formed of the four components, as illustrated in the following figure:

The four components are explained as follows:
In this section, we will look at the data model that will support our web service. The following entity relationship diagram provides an overview of this model:

The entities that constitute our model are as follows:
The data access layer will be implemented using Object-Relational Mapping (ORM) with Hibernate 4.3.8.
We will not delve into the specificities of Hibernate ORM in this book. However, documentation is available on Hibernate.org at http://hibernate.org/orm/.
In addition, for the purpose of simplifying the development and testing of our web service, we will use an embedded H2 database.
Documentation about H2 can be found at http://www.h2database.com.
Hibernate supports H2 out of the box, so no specific setup is required to use it as our embedded database.
While an embedded database is great for development, it is not fit for a production deployment.
Change the font size
Change margin width
Change background colour