[OPEN-ILS-DEV] new JSON protocol
Bill Erickson
billserickson at gmail.com
Wed Jul 11 22:04:16 EDT 2007
Hi folks,
There have been plans in place to change the JSON network "protocol" for
OpenSRF for almost a year now. With the recent creation of the 0.9 branch
of OpenSRF, the proposed changes have solidifed into a development branch
with the new JSON code. What originated as a new way of parsing/serializing
class information for objects quickly turned into a re-write of the JSON
library. The source code lives in the new-json2 OpenSRF branch at
http://svn.open-ils.org/trac/OpenSRF/browser/branches/new-json2. The C
files are in src/libopensrf/osrf_json*
What's been accomplished by this change?
1. The new JSON protocol is fully JSON compliant and requires only a small
post-processing phase for parsing. The previous protocol required variant
parsers, which limited the ability to easily create OpenSRF libs in other
languages. We currently have Python and Java libraries in the repository,
but we've made little fuss over them since they only work with the new JSON
protocol. Now that the new protocol will be soon merged into trunk,
hopefully people can make use of those libraries.
2. A new C JSON parser which supports the same API as objson, the legacy
JSON library, with (I think) cleaner, easier to read code.
3. The option to compile a compatibility layer which mimics libobjson.so and
associated headers so that existing code that links to libopensrf/libobjson
will not be required to change.
4. The C parser can be built as a standalone library (libosrf_json.so),
statically linked into libopensrf.so, or built with the compatibility layer
(libobjson.so) based on a config option.
5. The new C parser can act as a SAX-style push parser with event
callbacks. We're not currently making use of this in the code, but I'd
think it was really cool if someone had a need for such a thing. :)
6. The JSON HTTP gateway supports new-style and legacy JSON input and output
for backwards compatibility.
As we push for the OpenSRF 1.0 release, we will be merging this new JSON
code into the OpenSRF trunk. If all goes well, no one will ever know this
happened. ;) It is a pretty large change to the OpenSRF core, though, so I
wanted to make sure everyone was aware it was coming and open the dialog for
any thoughts or concerns.
Thanks as always!
-bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20070711/f3dcb96e/attachment.html
More information about the Open-ils-dev
mailing list