This post originated from an RSS feed registered with .NET Buzz
by Scott Hanselman.
Original Post: Woof. XmlSerializer written in JavaScript - for the Chubby Client
Feed Title: Scott Hanselman's ComputerZen.com
Feed URL: http://radio-weblogs.com/0106747/rss.xml
Feed Description: Scott Hanselman's ComputerZen.com is a .NET/WebServices/XML Weblog. I offer details of obscurities (internals of ASP.NET, WebServices, XML, etc) and best practices from real world scenarios.
I'll need at least a day to digest this. Anders
has written an XmlSerializer in JavaScript using the Javascript equivalent
of Declarative
Attributes called annotations. He's used the Java syntax for attributes,
as he says "JavaScript has a closer relation to the Java language
than .NET."
(Which isn't really true, as Netscape's LiveScript begat JavaScript begat ECMAScript.
Java is in the name only for sex appeal.)
He's built a Javascript
Reflection subsystem that parses the comments and gives a reflection-style API
and feel. The XmlSerializer is built on top of that Reflection system.
To implement "properties" you create get accessors for your fields.