Why JSON?
Although Java has provided a native serialization mechanism since the early versions, implementing the marker interface Serializable, which is the default choice for RMIs performed through remote EJB calls, results in the following drawbacks:
- Class versioning problems: Objects may fail to be deserialized if a different version of the class is loaded in the two communicating systems, and/or a different classloader is used in both
- Platform-specific: Java object serialization, as the name suggests, is a Java proprieties technique; other systems written in other languages are not able to easily consume Java objects without the need to use third-party libraries
A standard serialization technique is a must for communication between different systems written in different languages in a heterogeneous environment. XML and JSON are two popular text-based standard formats that have been used for this purpose for many years. XML was the primary technology that modern web techniques built around...