Transient property attribute

Kris Zyp kriszyp at xucia.com
Mon Jul 30 09:11:16 PDT 2007


The transient property is not just for JSON serialization, but gives an
abstracting indication of transience that is important for any future
persistence, serialization, or mapping mechanisms (which could include
libraries or future language additions).
Thanks,
Kris

On 7/30/07, Lars T Hansen <lth at acm.org> wrote:
>
> On 6/6/07, Kris Zyp <kriszyp at xucia.com> wrote:
> > Would it be possible to add a property attribute "transient"? It would
> not
> > need any special treatment, it would serve purely as a marker. Java has
> this
> > as a property attribute/field modifier, and it is very helpful for
> defining
> > what fields should be included in persistence/serialization. The only
> > implementation detail that this might effect is that I believe that it
> would
> > be most proper if "toJSONString" ignored properties that had been marked
> as
> > "transient". So if one declared an instance variable:
> > class A{
> >     transient var b
> > }
> > b would not be included in toJSONString serializations, and other
> > persistence/serialization strategies could use introspection to be aware
> > that such values should not be saved. Any chance this could make it in
> the
> > spec?
>
> As this is probably just one more approach to customizing JSON
> serialization, and we're not trying to do much with that (despite
> extensive debate on that list), my guess is "no".
>
> --lars
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20070730/ef233fb6/attachment-0002.html 


More information about the Es4-discuss mailing list