RSS Feed for This PostCurrent Article

FlexJson

JavaScript Object Notation (aka JSON) is a very popular alternative to XML for transmitting data to the web browser.

Flexjson is a lightweight library for serializing Java objects into JSON. What’s different about Flexjson is it’s control over what gets serialized allowing both deep and shallow copies of objects.

Most JSON serializers mimic object serialization libraries and try to serialize the entire object graph from the object being turned into JSON. This causes problems when you want a connected object model in your server, but you can’t send that object model to the client because the serialization library will try to send the entire object graph. This makes it very hard to create object oriented models and serialize pieces of that model to the client without sending everything.

Other JSON libraries require you to create a lot of boiler plate code to translate your object representation into a JSON object. In this regard I shouldn’t have to explain myself, but to keep it short let’s me just say I hate boiler plate translation code! Flexjson tries to solve both of these problems by offering a higher level API or dare I say DSL for specifying your intent.


Trackback URL


Sorry, comments for this entry are closed at this time.