Chapter 16. Creating REST APIs with Spring MVC
This chapter covers
- Writing controllers that serve REST resources
- Representing resources in XML, JSON, and other formats
- Consuming REST resources
Data is king.
As developers, we’re often focused on building great software to solve business problems. Data is just the raw material that your software processes need to get their job done. But if you were to ask most business people which is most valuable to them, data or software, they’d likely choose data. Data is the lifeblood of many businesses. Software is often replaceable, but the data gathered over the years can never be replaced.
Don’t you think it’s odd that, given the importance of data, the way we develop software often treats data as an afterthought? Take the remote services from the previous chapter as an example. Those services were centered on actions and processes, not information and resources.
In recent years, Representational State Transfer (REST) has emerged as a popular information-centric alternative to traditional SOAP-based web services. Whereas SOAP typically focused on actions and processing, REST’s concern is with the data being handled.
Starting with Spring 3.0, Spring introduced first-class support for creating REST APIs. And Spring’s REST implementation has continued to evolve through Spring 3.1, 3.2, and now 4.0.