Philippe Marschall | 9 Aug 2011 18:48
Picon

Re: Magritte -> Json

2011/8/9 Nick Ager <nick.ager <at> gmail.com>:
> Hi Philippe,
>
>> There is Magritte-Json in [1]. It gives you more control, you can
>> override the name of a property and choose not to serialize certain
>> objects. I found this necessary when implementing certain predefined
>> APIs. It's a bit more "magritty" in the sense that is uses reader and
>> writer objects. Though it could certainly be improved on. You can find
>> examples in [2].
>>
>>  [1] http://source.lukas-renggli.ch/magritteaddons
>>  [2] http://www.squeaksource.com/orion
>
> It looks good and more comprehensive than my effort.
> It appears that objects have to be derived from MJObject in order to use the
> Json conversion.

Without being certain I don't think so. It should work with any class
that has the same methods.

> Would there be a problem moving the #javascriptOn: method
> from MJObject to an extension method on GRObject to allow more objects to
> gain the Json conversion functionality? (I choose GRObject as WAObject,
> PRObject & MAObject are all ultimately derived from GRObject).

No.

> The difference between #asJavascript (with it's
> accompanying #javascriptOn:), asJson (with it's accompanying #jsonOn:)? It
> appears that even though #asJavascript and #asJson have largely the same
(Continue reading)

Nick Ager | 10 Aug 2011 08:39
Picon
Gravatar

Re: Magritte -> Json

Hi Philippe,
 
Feel free to change your proposed changes. I might also make sense to
move over some of the orion tests.

I've checked in Magritte-Json-NickAger.10  and I've modified Orion, but couldn't check it in (permission issue) so I've attached my changes.

Cheers

Nick
Attachment (Orion-NickAger.18.mcz): application/octet-stream, 13 KiB
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

Gmane