[Building Sakai] JSON

Charles Severance csev at umich.edu
Fri Sep 20 07:18:03 PDT 2013


Mark,

I started using org.json.simple because it was really simple - and if all you have to do is tear apart a bit of incoming JSON - it is a nice way to go because it is quick and easy.

But as soon as things get a little more complex (i.e. like building LTI 2) and having to construct outgoing JSON that meets other folks requirements and not doing some *nasty* code - I quickly switched to Jackson (thanks to Aaron's earlier advice to me when I asked the same question) - and I *love* it.  And you know how lazy I am and how quick I am to use sprintf when faced with a complex data modeling problem :)

It is not quite as quick and dirty as org.json.simple - but it is pretty easy to use (thanks to awesome code generators and nice use of annotations) - so I highly recommend it.   For LTI 2.0, I would *still* be debugging it if I had not switched to Jackson.  And in particular as LTI 2.0 makes a few subtle changes - Jackson will very much be my friend.   Te generated code is so simple and clean that if the data model gets tweaked - you usually can easily tweak the generated code rather than generating it all from scratch and shoving it back into your code.

/Chuck

On Sep 20, 2013, at 9:13 AM, Aaron Zeckoski <azeckoski at unicon.net> wrote:

> It uses a custom package I wrote to handle some specific use cases
> which the other JSON parsers and generators did not support at the
> time (mostly around scanning POJOs which have loops in their object
> structures like sakai entities and hibernate objects). There may be
> better options now but a lot of careful testing would be needed to
> replace what is there with something that produces equivalent JSON.
> 
> For non-Sakai projects I tend to use Jackson or the one that is built
> into Grails (if it is a grails project). There are some limitations to
> the jackson processor when reading in JSON but generating JSON from
> maps or pojos is fairly straightforward in most cases.
> 
> -AZ
> 
> 
> On Fri, Sep 20, 2013 at 8:56 AM, Mark J. Norton
> <markjnorton at earthlink.net> wrote:
>> Does anyone know what "flavor" of JSON Sakai is using - such as in the
>> Entity Broker?  I need a JSON package for an application and looking for
>> recommendations.
>> 
>> - Mark Norton
>> 
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>> 
>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> 



More information about the sakai-dev mailing list