JSON and Builder Libraries
JSON is built on two structures:
A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is interchangeable with programming languages also be based on these structures.
Here are the sample JSON format:
"name": "Employee A",
There are lots of JSON builder libraries available to convert Objects into their JSON representation or vice versa. Here are the lists of some popular libraries-To go into more depth on JSON structure refer
While choosing a JSON library, parsing speed consideration plays an important role. Different parsing speed benchmark test concludes the libraries that performed best for big files suffered for small files and vice versa. Typical observation found that-
- Parsing big JSON files, then Jackson and JSON-lib perform very well and most preferable library.
- Parsing small JSON files, then Google-Gson and Flexjson perform very well and most preferable library.
- Deal with both types of files, then JSON.simple is a good workhorse for a variable environment.
This is the basics on available popular JSON libraries.
In the continuation on JSON parsing, read another article on Parsing JSON withGson library.
To find more interesting topics on Software development follow me at https://email@example.com
You can also find my Android Applications on play store