Wow. Thanks for all the replies. @Bernat. I am using the SCouchDB library, but will take a look at the other one. Thanks. @Sven. I'll also take a look at that Json library. Thank you. @Markus. It has to Json, for exactly the reason that @Davorin suggests. @Francois. I'm looking at Magritte as well, but it seems a bit overwhelming for a Smalltalk noob. I may give it a try on my next project.
Apologies for the naivete of the original question. It wasn't 'til I tried writing my own that I realized (doh) that you can't write something like Gson in Java without augmenting the model with type information. I assume that's how Magritte does it, since it seems to be all about meta data. On Tue, Aug 30, 2011 at 5:30 AM, Bernat Romagosa < [email protected]> wrote: > Without having tried them, I see there are two CouchDB projects in > squeaksource, they may handle your needs: > > http://www.squeaksource.com/SCouchDB.html > http://www.squeaksource.com/CouchDB.html > > Cheers, > > > 2011/8/30 Sven Van Caekenberghe <[email protected]> > >> Hi Larry, >> >> On 29 Aug 2011, at 21:27, Larry White wrote: >> >> > I've tried the JSON library bundled with SCouchDB and it seems to >> automatically handle simple objects (eg, where the inst vars reference >> Strings or Numbers), but not handle more complex objects. Also, I haven't >> seen anything that de-serializes from json. >> >> There is a JSON encoder/decoder in Seaside, it is pretty standalone, see >> this recent thread: >> >> http://forum.world.st/Standalone-JSON-Package-tp3759705p3759705.html >> >> This one works very well (I am using it all the time), but only handles >> standard JSON types (follows the spec). >> >> Now, JSON objects don't hold their type or class as Smalltalk (or Java >> objects) do, they are just Dictionaries. There is no automagic solution to >> this, apart from encoding the type/class as a property, but will most >> probably not be portable across languages (java.lang.Integer for Java, >> Integer for Smalltalk), one of the strengths of JSON. >> >> So you will have to write code to convert your Person (or whatever) >> objects to/from Dictionaries and use JSON. >> >> Sven >> >> >> >> > > > -- > Bernat Romagosa. >
