2011/8/9 Nick Ager <nick.ager(a)gmail.com>om>:
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
effect, #asJson implements a Json compatible subset of #asJavascript. Would
it not make sense to use #asJson instead of #asJavascript and #jsonOn:
rather than #javascriptOn:,
Yes.
or have I missed something?
No.
Feel free to change your proposed changes. I might also make sense to
move over some of the orion tests.
I hope you don't have to change your slides now ;-) I'm sure you're
also aware of Magritte-XMLBinding in the same repository that does XML
data binding.
Cheers
Philippe