concept JSON in category spring

appears as: JSON
Spring Microservices in Action

This is an excerpt from Manning's book Spring Microservices in Action.

Figure 1.3. Spring Boot abstracts away the common REST microservice task (routing to business logic, parsing HTTP parameters from the URL, mapping JSON to/from Java Objects), and lets the developer focus on the business logic for the service.

  • Microservices communicate based on a few basic principles (notice I said principles, not standards) and employ lightweight communication protocols such as HTTP and JSON (JavaScript Object Notation) for exchanging data between the service consumer and service provider.
  • The underlying technical implementation of the service is irrelevant because the applications always communicate with a technology-neutral protocol (JSON is the most common). This means an application built using a microservice application could be built with multiple languages and technologies.
  • Use JSON as the serialization format for all data going to and from the service—This isn’t a hard-and-fast principle for REST-based microservices, but JSON has become lingua franca for serializing data that’s going to be submitted and returned by a microservice. XML can be used, but many REST-based applications make heavy use of JavaScript and JSON (JavaScript Object Notation). JSON is the native format for serializing and deserializing data being consumed by JavaScript-based web front-ends and services.

    Spring Roo in Action

    This is an excerpt from Manning's book Spring Roo in Action.

    Configuring JSON

    The rest of the script concerns the web interface. Roo can optionally expose JSON to the web tier if needed. These commands provide JSON support for the web services we reviewed earlier:

    Spring Batch in Action

    This is an excerpt from Manning's book Spring Batch in Action.

    Figure 5.2. The supported file formats in the case study are separator-based text, fixed length-based text, and JSON.

    JSON is an open and lightweight text-based standard designed for human-readable data interchange. It provides a way to structure text data using braces and brackets. This technology is similar to XML but requires about 30% fewer characters.

    5.2.6. Reading JSON

    Spring Batch provides support for JSON with a LineMapper implementation called JsonLineMapper. The following listing shows the JSON content of a data file corresponding to the data presented in the previous section. This is the last format for flat files in our case study.

    Listing 5.4. Product data file using JSON
    { "id": "PR....210", "name": "BlackBerry 8100 Pearl", "description": "", "price": 124.60 } { "id": "PR....211", "name": "Sony Ericsson W810i", "description": "", "price": 139.45 } { "id": "PR....212", "name": "Samsung MM-A900M Ace", "description": "", "price": 97.80 } (...)