chapter eleven

11 Web services

 

This chapter covers

  • Representing a client request as a map
  • Representing a server response as a map
  • Passing data forward
  • Combining data from different sources

11.1 A faithful messenger

The architecture of modern information systems is made of software components written in various programming languages that communicate over the wire by sending and receiving data represented in a language independent data exchange format, for instance JSON.

Data-Oriented programming applies the same principle to the communication between inner parts of a program. Inside a program, components communicate by sending and receiving data represented in a component independent format, namely immutable data collections.

In the context of a web service that fulfills a client request by fetching data from a database and other web services, representing data as with immutable data collections leads to the following benefits:

  • Leverage generic data manipulation functions to manipulate data from multiple data sources
  • Freedom to pass data forward with no additional complexity

11.2 Another feature request

After having delivered the database milestone on time, Theo calls Nancy to share the good news. Instead of celebrating Theo’s success, Nancy asks him about the ETA for the next milestone: Book Information Enrichment with OpenLibraryBook. Theo tells her that he’ll get back to her with an ETA by the end of the day.

When Theo arrives at the office, he tells Joe about the discussion with Nancy.

11.3 Build the insides like the outsides

11.4 Represent a client request as a map

11.5 Represent a server response as a map

11.6 Passing information forward

11.7 Search result enrichment in action

11.8 Delivering on time

11.9 Summary