Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #29815
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2016-03-04 10:19 -0800 |
| References | <ddbd7b1c-84f0-4ab5-8400-60ece696f317@googlegroups.com> <2c2b764a-6f78-486a-9ace-9ee65b6e17b4@googlegroups.com> <ce2b42d3-9600-47f6-b804-7f81d6bdd6b0@googlegroups.com> <bc3af71e-c899-4a9f-8496-35fb41374be2@googlegroups.com> <98157c72-fc42-45df-abac-28472797751f@googlegroups.com> |
| Message-ID | <7dbf2cfc-91d8-4aca-ba4c-6ab203f40259@googlegroups.com> (permalink) |
| Subject | Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by |
| From | Simon Blackwell <syblackwell@anywhichway.com> |
On Thursday, March 3, 2016 at 9:45:20 AM UTC-5, Michael Haufe (TNO) wrote: > On Thursday, March 3, 2016 at 6:48:41 AM UTC-6, Simon Blackwell wrote: > > > Quite interesting, particularly http://wayback.archive.org/web/20150827182315/http://www.dcs.bbk.ac.uk/~ptw/teaching/ssd/slide11.html. This seems like it would be relatively straightforward to support using $1, $2, $3, etc. in place of the &1, &2, &3, etc. references. However, it would loose the class restoration semantics incorporated into cycler.js. > > Serialize to a string and deserialize it. You have to do that with JSON anyway. > > > We have mucked around a good bit with serialization and restoration semantics and cycle.js gave us the inspiration for the approach used in cycler.js. This is the most elegant and least intrusive method we have found to date. Is anyone aware of another method not tied to a specific database or schema definition mechanism? > > A database is irrelevant when it comes to (de)serialization. IRT schemas, that's up to you, they can be either intrinsic in the serialization (like XML+XSD), or extrinsic like JSON. > > Another possible approach is to use YAML as it supports non-hierarchical data as well I suppose I was not clear in my request. A shortcoming with JSON is that natively it only supports de-serializing to Objects or Arrays. You have to provide a reviver function to get alternate behavior but JSON provides no native way of capturing the semantics required to revive objects into their original classes. And, if only standard serialized JSON is sent over to a server there is nothing to tell the server how to restore it with semantics. What we implemented in cycler.js is a light weight schemaless way of passing semantics. If the JavaScript class definitions are the same on the client and server, with cycler you are essentially done (the class defintions essentially act as schema). We are wondering about other light weight schemaless approaches. We explored adding a special metadata sub object to all serialized JSON objects, it just seemed a little less clean than what we ended up with in cycler.js since there was then a tendency to start "polluting" the metadata sub-object with all kinds of potentially application specific stuff, e.g. version numbers, date/time stamps, etc.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by Simon Blackwell <syblackwell@anywhichway.com> - 2016-03-01 09:23 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by Scott Sauyet <scott.sauyet@gmail.com> - 2016-03-01 19:03 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by Simon Blackwell <syblackwell@anywhichway.com> - 2016-03-02 05:42 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-03-02 17:32 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-03-02 17:37 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by Scott Sauyet <scott.sauyet@gmail.com> - 2016-03-02 19:26 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by Simon Blackwell <syblackwell@anywhichway.com> - 2016-03-03 04:48 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-03-03 06:45 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by Simon Blackwell <syblackwell@anywhichway.com> - 2016-03-04 10:19 -0800
Re: Cycler ... cycle.js revisited Re-factoring and enhancing an old stand-by Scott Sauyet <scott.sauyet@gmail.com> - 2016-03-04 19:17 -0800
csiph-web