Patterns of reading JSON

JavaScript Object Notion (JSON) is a de-facto standard for exchanging data over Web API. JSON is a recursive data structure and can be visualized as a key-value pairs tree.

There are two broad categories of APIs for reading information from JSON :

  • Streaming Based: It is parsing or visiting of JSON part by part. With each part iteration, you skip or map part to Object/s. Part maybe {, [, field, value: , } , and ] (JSON Tokens!).

  • Binding based: Binding is mapping of JSON field to Programming Objects; these may be domain or abstract. JSON is entirely parsed and mapped to objects.

This article goes through different patterns of Reading JSON data. Java is chosen for demonstrating these patterns.

Continue Reading these patterns in details