JSON (http://json.org) came about as a convenient, better-than-XML data format that one could directly work from in JavaScript. About a year ago, I got a bit disappointed by the JSON libraries out there. JSON is so simple, yet all of them so complicated, so verbose. Most of it comes from the culture of strong typing in Java and from the presumed use of JSON on the server as an intermediate representation to be mapped to Java beans, where the application domain is usually modeled. But JSON is powerful enough on its own if you are willing to trade off type safety for flexibility. So I wrote mJson (for "minimal" Json), a single source file library for working with JSON from Java. For a description see the blog posts:
- http://sharegov.blogspot.com/2011/06/json-library.html
- http://sharegov.blogspot.com/2011/11/mjson-11-released.html
Using this library, I've been able to avoid creating the usual plethora of Java classes to work with my domain in several applications. Coding with it is pretty neat. One can pretty much view JSON as a general minimalistic, highly flexible modeling tool, a bit like s-expressions or any general enough abstract data structure (another example are first-order logic terms).
Now, there's a persistence layer for those JSON entities based on HyperGraphDB. Unlike "document-oriented" databases, the representation in HyperGraphDB is really graph-like with all the expected consequences. It is described in the HyperGraphDB Json Wiki Page, pretty stable, convenient and fun to work with.
If time permits, I will write a few posts in the form of a tutorial to show how to quickly build database backed JSON REST services with mJson and HyperGraphDB. If you have a suggestion of an application domain to cover, please share it in a comment!
In the meantime, I invite you to give it a try!
Regards,
Boris
Hi Boris,
ReplyDeleteGreat blog! Is there an email address I can contact you in private?
Hi Nikos,
ReplyDeleteThanks! You can email me at my gmail address - borislav.iordanov.
Cheers,
Boris