[Seaside] Seaside Json serialization for Dictionary, Collection
does not recursive jsonOn: aStream ?
bart.gauquie at gmail.com
Mon Feb 1 18:34:33 UTC 2010
I will create a bug for it and I'm more than happy to create fix it.
Can anyone please add me as a seaside developer on squeaksource.
On a related Json issue, I found that code I was writing for Json encoding
> my classes followed a similar pattern - I'd encode all the instance
> variables in a Dictionary. I extracted this code and made it generic as:
> Object>>jsonOn: aStream
> | attributes |
> attributes := Dictionary new.
> self class instVarNames do:
> [ :ivarName |
> at: ivarName
> put: (self instVarNamed: ivarName) ].
> JSStream encodeDictionary: attributes on: aStream.
> I wonder if this would be sufficiently generally applicable to appear in
> the default distribution? Classes can always override the default for custom
> Json encoding.
I've also noticed this. There is no implementation of jsonOn: aStream on
Object class right now.
Your implementation seems like a sensible default thing to do.
Its actually highly related to
http://code.google.com/p/seaside/issues/detail?id=449 (Generating JSON is
imagination is more important than knowledge - Albert Einstein
Logic will get you from A to B. Imagination will take you everywhere -
Learn from yesterday, live for today, hope for tomorrow. The important thing
is not to stop questioning. - Albert Einstein
The true sign of intelligence is not knowledge but imagination. - Albert
However beautiful the strategy, you should occasionally look at the results.
- Sir Winston Churchill
It's not enough that we do our best; sometimes we have to do what's
required. - Sir Winston Churchill
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside