<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Light-weight JSON Binding Framework</title>
	<atom:link href="http://ajaxian.com/archives/light-weight-json-binding-framework/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/light-weight-json-binding-framework</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: MattQuinlan</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266470</link>
		<dc:creator>MattQuinlan</dc:creator>
		<pubDate>Wed, 06 Aug 2008 22:22:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266470</guid>
		<description>final attempt:

&lt;code&gt;
&lt;app:message 
     name=&quot;l:load&quot; 
     args=&quot;{person: {first_name: &#039;Joe&#039;, last_name: &#039;Smith&#039;}}&quot;&gt;
&lt;/app:message&gt;

&lt;div fieldset=&quot;user_info&quot; on=&quot;l:load then bind[person]&quot;&gt;
    &lt;input fieldset=&quot;user_info&quot; name=&quot;first_name&quot; /&gt;
    &lt;input fieldset=&quot;user_info&quot; name=&quot;last_name&quot; /&gt;
&lt;/div&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>final attempt:</p>
<p><code><br />
&lt;app:message<br />
     name="l:load"<br />
     args="{person: {first_name: 'Joe', last_name: 'Smith'}}"&gt;<br />
&lt;/app:message&gt;</p>
<p>&lt;div fieldset="user_info" on="l:load then bind[person]"&gt;<br />
    &lt;input fieldset="user_info" name="first_name" /&gt;<br />
    &lt;input fieldset="user_info" name="last_name" /&gt;<br />
&lt;/div&gt;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MattQuinlan</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266469</link>
		<dc:creator>MattQuinlan</dc:creator>
		<pubDate>Wed, 06 Aug 2008 22:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266469</guid>
		<description>looks like I forgot the &quot;code&quot; tag... sorry, reposting comment.

Nice elegant client-side binding for JSON. Love it!

Appcelerator uses this same concept, but in a declarative format. 

&lt;code&gt;



    
    

&lt;/code&gt;

Note the JSON message (l:load) could be generated from either the client (as shown for illustration) or the server (more likely). The fieldset allows me to selectively bind only some form elements if I prefer.</description>
		<content:encoded><![CDATA[<p>looks like I forgot the &#8220;code&#8221; tag&#8230; sorry, reposting comment.</p>
<p>Nice elegant client-side binding for JSON. Love it!</p>
<p>Appcelerator uses this same concept, but in a declarative format. </p>
<p><code></p>
<p></code></p>
<p>Note the JSON message (l:load) could be generated from either the client (as shown for illustration) or the server (more likely). The fieldset allows me to selectively bind only some form elements if I prefer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MattQuinlan</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266468</link>
		<dc:creator>MattQuinlan</dc:creator>
		<pubDate>Wed, 06 Aug 2008 22:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266468</guid>
		<description>Nice elegant client-side binding for JSON.  Love it!

Appcelerator uses this same concept, but in a declarative format.  Note the JSON message (l:load) could be generated from either the client (as shown for illustration) or the server (more likely).  The fieldset allows me to selectively bind only some form elements if I prefer.




    
    
</description>
		<content:encoded><![CDATA[<p>Nice elegant client-side binding for JSON.  Love it!</p>
<p>Appcelerator uses this same concept, but in a declarative format.  Note the JSON message (l:load) could be generated from either the client (as shown for illustration) or the server (more likely).  The fieldset allows me to selectively bind only some form elements if I prefer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sqrrrl</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266310</link>
		<dc:creator>sqrrrl</dc:creator>
		<pubDate>Thu, 31 Jul 2008 21:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266310</guid>
		<description>By pretty I meant removing dead/unused code and making sure what remains is necessary and well tested.  That particular block was for an experimental feature (enumerating all the paths on an object graph) I hadn&#039;t yet finished or tested and wasn&#039;t even documented on the wiki, so I had no expectation that it was working nor would work, and the 0.x versioning should be a clue to anyone looking at it that there is no guarantee *every* line of code is going to be correct ;)

Anyway, I read through some of your writings on type checking and if I end up needing that code I&#039;ll likely adopt much of what you&#039;ve talked about.</description>
		<content:encoded><![CDATA[<p>By pretty I meant removing dead/unused code and making sure what remains is necessary and well tested.  That particular block was for an experimental feature (enumerating all the paths on an object graph) I hadn&#8217;t yet finished or tested and wasn&#8217;t even documented on the wiki, so I had no expectation that it was working nor would work, and the 0.x versioning should be a clue to anyone looking at it that there is no guarantee *every* line of code is going to be correct ;)</p>
<p>Anyway, I read through some of your writings on type checking and if I end up needing that code I&#8217;ll likely adopt much of what you&#8217;ve talked about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhtmlkitchen</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266306</link>
		<dc:creator>dhtmlkitchen</dc:creator>
		<pubDate>Thu, 31 Jul 2008 19:59:56 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266306</guid>
		<description>sqrrrl,

It&#039;s not a matter of the code being &#039;pretty&#039;. 
-
Placing &lt;code&gt;target&lt;/code&gt; in makes &lt;code&gt;typeof&lt;/code&gt; appear to be a function call. That is not the bug. That would be a &#039;pretty&#039; issue.
-
The bug is in the second line of code:
&lt;blockquote&gt;&lt;code&gt;
return t == &quot;string&quot; &#124;&#124; t == &quot;number&quot; &#124;&#124; t == &quot;date&quot; &#124;&#124; t == &quot;boolean&quot;
&lt;/code&gt;&lt;/blockquote&gt;
-
The typeof operator won&#039;t return &quot;date&quot; for a built-in, in any browser. If a browser were to return &quot;date&quot; for typeof on a built-in, that would be a bug. It would, however, be possible for a browser to return &quot;date&quot; for a Host object. If this were to happen -- and I have never observed this behavior -- then &lt;code&gt;_isBuiltinType&lt;/code&gt; would return true. 
-
The typeof operator gets used further down. Using &lt;code&gt;typeof property != &quot;function&quot;&lt;/code&gt; will determine that &lt;code&gt;property&lt;/code&gt; is not (a built-in object that implements &lt;code&gt;[[Call]]&lt;/code&gt;), though it may or may not be a Host object.
-
I would suggest removing the method &lt;code&gt;_isBuiltinType&lt;/code&gt; and changing your approach entirely.</description>
		<content:encoded><![CDATA[<p>sqrrrl,</p>
<p>It&#8217;s not a matter of the code being &#8216;pretty&#8217;.<br />
-<br />
Placing <code>target</code> in makes <code>typeof</code> appear to be a function call. That is not the bug. That would be a &#8216;pretty&#8217; issue.<br />
-<br />
The bug is in the second line of code:</p>
<blockquote><p><code><br />
return t == "string" || t == "number" || t == "date" || t == "boolean"<br />
</code></p></blockquote>
<p>-<br />
The typeof operator won&#8217;t return &#8220;date&#8221; for a built-in, in any browser. If a browser were to return &#8220;date&#8221; for typeof on a built-in, that would be a bug. It would, however, be possible for a browser to return &#8220;date&#8221; for a Host object. If this were to happen &#8212; and I have never observed this behavior &#8212; then <code>_isBuiltinType</code> would return true.<br />
-<br />
The typeof operator gets used further down. Using <code>typeof property != "function"</code> will determine that <code>property</code> is not (a built-in object that implements <code>[[Call]]</code>), though it may or may not be a Host object.<br />
-<br />
I would suggest removing the method <code>_isBuiltinType</code> and changing your approach entirely.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mchammer</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266279</link>
		<dc:creator>mchammer</dc:creator>
		<pubDate>Thu, 31 Jul 2008 13:35:19 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266279</guid>
		<description>I think I would probably rather do this data binding on the server using Spring or Apache Commons BeanUtils.  BeanUtils for example would take something like address[0].city and automatically traverse the object graph using reflection and set the property.  I guess it&#039;s a matter of personal taste as to whether you want to do this on the client or server.  I tend to prefer the server because I don&#039;t have to worry about nasty browser issues.</description>
		<content:encoded><![CDATA[<p>I think I would probably rather do this data binding on the server using Spring or Apache Commons BeanUtils.  BeanUtils for example would take something like address[0].city and automatically traverse the object graph using reflection and set the property.  I guess it&#8217;s a matter of personal taste as to whether you want to do this on the client or server.  I tend to prefer the server because I don&#8217;t have to worry about nasty browser issues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ragjunk</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266260</link>
		<dc:creator>ragjunk</dc:creator>
		<pubDate>Thu, 31 Jul 2008 05:56:47 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266260</guid>
		<description>Spry framework from Adobe has some cool data binding techniques, which includes form handling, binding an XML/JSON data source to an HTML table and so on. Pretty interesting, but I am surprised why people aren&#039;t raving about it.</description>
		<content:encoded><![CDATA[<p>Spry framework from Adobe has some cool data binding techniques, which includes form handling, binding an XML/JSON data source to an HTML table and so on. Pretty interesting, but I am surprised why people aren&#8217;t raving about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sqrrrl</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266257</link>
		<dc:creator>sqrrrl</dc:creator>
		<pubDate>Thu, 31 Jul 2008 00:50:30 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266257</guid>
		<description>dhtmlkitchen -- There is a reason why the first bug I filed against myself is to clean up the code -- it&#039;s just about 200 lines of javascript written over the course of an hour or two :) First pass was just to get it working, next step is to make it pretty :) 

If you have suggestions for how to do things better by all means share them.</description>
		<content:encoded><![CDATA[<p>dhtmlkitchen &#8212; There is a reason why the first bug I filed against myself is to clean up the code &#8212; it&#8217;s just about 200 lines of javascript written over the course of an hour or two :) First pass was just to get it working, next step is to make it pretty :) </p>
<p>If you have suggestions for how to do things better by all means share them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhtmlkitchen</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266256</link>
		<dc:creator>dhtmlkitchen</dc:creator>
		<pubDate>Thu, 31 Jul 2008 00:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266256</guid>
		<description>@Nosredna This is not something worth studying.

&lt;a href=&quot;http://js-binding.googlecode.com/svn/trunk/src/js/binder.js&quot; title=&quot;buggy code&quot; rel=&quot;nofollow&quot;&gt;http://js-binding.googlecode.com/svn/trunk/src/js/binder.js&lt;/a&gt;
&lt;blockquote&gt;&lt;code&gt;
  var _isBuiltinType = function( obj ) {
    var t = typeof( target );
    return t == &quot;string&quot; &#124;&#124; t == &quot;number&quot; &#124;&#124; t == &quot;date&quot;  &#124;&#124; t == &quot;boolean&quot;
  };
&lt;/code&gt;&lt;/blockquote&gt;
The serialize() method is also broken.

Garrett</description>
		<content:encoded><![CDATA[<p>@Nosredna This is not something worth studying.</p>
<p><a href="http://js-binding.googlecode.com/svn/trunk/src/js/binder.js" title="buggy code" rel="nofollow">http://js-binding.googlecode.com/svn/trunk/src/js/binder.js</a></p>
<blockquote><p><code><br />
  var _isBuiltinType = function( obj ) {<br />
    var t = typeof( target );<br />
    return t == "string" || t == "number" || t == "date"  || t == "boolean"<br />
  };<br />
</code></p></blockquote>
<p>The serialize() method is also broken.</p>
<p>Garrett</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali Sullivan</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266252</link>
		<dc:creator>Ali Sullivan</dc:creator>
		<pubDate>Wed, 30 Jul 2008 18:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266252</guid>
		<description>The concept is absolutely sound. I also have done something similar, but using CSS rules for binding.</description>
		<content:encoded><![CDATA[<p>The concept is absolutely sound. I also have done something similar, but using CSS rules for binding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ilazarte</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266246</link>
		<dc:creator>ilazarte</dc:creator>
		<pubDate>Wed, 30 Jul 2008 17:53:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266246</guid>
		<description>we&#039;re gonna see more of these.  the question really has been why has it taken so long to get to this point?  data binding is a fact of life on the server side.</description>
		<content:encoded><![CDATA[<p>we&#8217;re gonna see more of these.  the question really has been why has it taken so long to get to this point?  data binding is a fact of life on the server side.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: genericallyloud</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266234</link>
		<dc:creator>genericallyloud</dc:creator>
		<pubDate>Wed, 30 Jul 2008 15:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266234</guid>
		<description>data-binding totally rocks. I wrote a framework with bindings at the core of a client-side templating language and it is super productive. The templating language gets compiled into js on the server, but it allows for really nice stuff like:
&lt;input type=&quot;text&quot; value=&quot;#{path.to.value}&quot;/&gt;
or even directly in the html like
&lt;h1&gt;#{title}&lt;/h1&gt;

So that the binding is specified in the html, similar to how Flex does it with MXML. I wish I had time to open source the code, but its all internal use right now. Great to see it becoming a prevalent concept in other js frameworks.</description>
		<content:encoded><![CDATA[<p>data-binding totally rocks. I wrote a framework with bindings at the core of a client-side templating language and it is super productive. The templating language gets compiled into js on the server, but it allows for really nice stuff like:<br />
&lt;input type=&#8221;text&#8221; value=&#8221;#{path.to.value}&#8221;/&gt;<br />
or even directly in the html like<br />
&lt;h1&gt;#{title}&lt;/h1&gt;</p>
<p>So that the binding is specified in the html, similar to how Flex does it with MXML. I wish I had time to open source the code, but its all internal use right now. Great to see it becoming a prevalent concept in other js frameworks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nosredna</title>
		<link>http://ajaxian.com/archives/light-weight-json-binding-framework/comment-page-1#comment-266233</link>
		<dc:creator>Nosredna</dc:creator>
		<pubDate>Wed, 30 Jul 2008 15:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3974#comment-266233</guid>
		<description>I guess I&#039;m so used to doing this the hard way that I don&#039;t quite yet &quot;get&quot; what&#039;s going on here. This goes on my learning list.
.
There&#039;s no end to what you have to learn when you&#039;re an Ajax guy.</description>
		<content:encoded><![CDATA[<p>I guess I&#8217;m so used to doing this the hard way that I don&#8217;t quite yet &#8220;get&#8221; what&#8217;s going on here. This goes on my learning list.<br />
.<br />
There&#8217;s no end to what you have to learn when you&#8217;re an Ajax guy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

