Chapter 11. Giving Spring some REST

 

This chapter covers

  • Writing controllers that serve REST resources
  • Representing resources in XML, JSON, and other formats
  • Writing REST clients
  • Submitting RESTful forms

Data is king.

As developers, we’re often focused on building great software to solve business problems. Data is just the raw materials that our 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’re likely to choose data. Data is the life’s blood of many businesses. Software is often replaceable. But the data gathered over the years can never be replaced.[1]

1 That’s not to say that software has no value. Most businesses would be severely handicapped without their software. But they’d be dead without their data.

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. To help Spring developers take advantage of the REST architectural model, Spring 3.0 came packed with first-class support for working with REST.

11.1. Getting REST

11.2. Writing resource-oriented controllers

11.3. Representing resources

11.4. Writing REST clients

11.5. Submitting RESTful forms

11.6. Summary