<?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: Bender Code Preview</title>
	<atom:link href="http://www.tobytremayne.com/actionscript/bender-code-preview/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tobytremayne.com/actionscript/bender-code-preview/</link>
	<description>musings on software development, writing and life</description>
	<lastBuildDate>Fri, 09 Apr 2010 01:51:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Elliott Sprehn</title>
		<link>http://www.tobytremayne.com/actionscript/bender-code-preview/comment-page-1/#comment-224</link>
		<dc:creator>Elliott Sprehn</dc:creator>
		<pubDate>Fri, 15 Jun 2007 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://tobytremayne.com/?p=261#comment-224</guid>
		<description>Is there a reason you&#039;re creating getter and setter methods?

The AS3 convention is to use implicit get/set property methods instead.

Probably best to downcase those property names. user.email is much better than user.EMAIL, which should be a constant, and lots better than having to call user.getEMAIL() which is really against the spirit of AS3 and Flex. It&#039;s also much faster to access these properties than to access them on the dynamic Object returned from data() since the compiler knows the type and receiver. This means code completion will work in the IDE too!

It&#039;s really better to do initialization of defaults in the class body instead of the constructor as well since the compiler can optimize that away, but if you call methods in the constructor the compiler needs to assign a default value (null in non-primitive cases) to the properties and then set them to be the default value at runtime on each instantiation.

I&#039;d also make those onFault and onData functions into real broadcast events that you can listen for and make all transfer objects either extend a base class with the base shared methods, or an interface, so that you can return a generic TransferRecord of any type if you need to. That&#039;ll get rid of the (obj : *) parameter on the Bender component which means the compiler can optimize access to the functions on the transfer object and it moves all that shared code outside the CF generator and into AS code you can update without digging around in the guts of the code generator.

The way I&#039;ve handled nice access in a project of mine was to define a const property on each generated object with a name like PROPERTIES, and then use that for figuring out what the properties are for objects inside the handler classes. That way you can move the fill() method into the Bender class and iterate over the const properties collection. Or if you&#039;re feeling really dynamic you could just iterate over the properties in event.result and use hasOwnProperty() to check if the Transfer object has the correct method and call it that way. This saves you from generating lots and lots of code too.

Overall this looks nice a pretty nifty project. :)</description>
		<content:encoded><![CDATA[<p><code>Is there a reason you&#8217;re creating getter and setter methods?</p><p>The AS3 convention is to use implicit get/set property methods instead.</p><p>Probably best to downcase those property names. user.email is much better than user.EMAIL, which should be a constant, and lots better than having to call user.getEMAIL() which is really against the spirit of AS3 and Flex. It&#8217;s also much faster to access these properties than to access them on the dynamic Object returned from data() since the compiler knows the type and receiver. This means code completion will work in the IDE too!</p><p>It&#8217;s really better to do initialization of defaults in the class body instead of the constructor as well since the compiler can optimize that away, but if you call methods in the constructor the compiler needs to assign a default value (null in non-primitive cases) to the properties and then set them to be the default value at runtime on each instantiation.</p><p>I&#8217;d also make those onFault and onData functions into real broadcast events that you can listen for and make all transfer objects either extend a base class with the base shared methods, or an interface, so that you can return a generic TransferRecord of any type if you need to. That&#8217;ll get rid of the (obj : *) parameter on the Bender component which means the compiler can optimize access to the functions on the transfer object and it moves all that shared code outside the CF generator and into AS code you can update without digging around in the guts of the code generator.</p><p>The way I&#8217;ve handled nice access in a project of mine was to define a const property on each generated object with a name like PROPERTIES, and then use that for figuring out what the properties are for objects inside the handler classes. That way you can move the fill() method into the Bender class and iterate over the const properties collection. Or if you&#8217;re feeling really dynamic you could just iterate over the properties in event.result and use hasOwnProperty() to check if the Transfer object has the correct method and call it that way. This saves you from generating lots and lots of code too.</p><p>Overall this looks nice a pretty nifty project. <img src='http://www.tobytremayne.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Mandel</title>
		<link>http://www.tobytremayne.com/actionscript/bender-code-preview/comment-page-1/#comment-222</link>
		<dc:creator>Mark Mandel</dc:creator>
		<pubDate>Fri, 13 Apr 2007 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://tobytremayne.com/?p=261#comment-222</guid>
		<description>Just some thoughts -

Probably better that you take Transfer as an arguments, rather than initialising it in Bender.

That and I&#039;ll have a chat to you about getMemento() function, you may have some issues with composition and lazy loading.

Otherwise, looks pretty good!</description>
		<content:encoded><![CDATA[<p><code>Just some thoughts -</p><p>Probably better that you take Transfer as an arguments, rather than initialising it in Bender.</p><p>That and I&#8217;ll have a chat to you about getMemento() function, you may have some issues with composition and lazy loading.</p><p>Otherwise, looks pretty good!</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Mclean</title>
		<link>http://www.tobytremayne.com/actionscript/bender-code-preview/comment-page-1/#comment-223</link>
		<dc:creator>Justin Mclean</dc:creator>
		<pubDate>Fri, 13 Apr 2007 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://tobytremayne.com/?p=261#comment-223</guid>
		<description>Not all your questions were stupid :-)</description>
		<content:encoded><![CDATA[<p><code>Not all your questions were stupid <img src='http://www.tobytremayne.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
