<?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"
	>
<channel>
	<title>Comments on: Flex Object Composition Car Example</title>
	<atom:link href="http://renaun.com/blog/2006/07/12/64/feed/" rel="self" type="application/rss+xml" />
	<link>http://renaun.com/blog/2006/07/12/64/</link>
	<description>Informtation on Flex, Flash, ColdFusion, and general RIA web develoment.</description>
	<pubDate>Thu, 20 Nov 2008 16:39:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Renaun Erickson</title>
		<link>http://renaun.com/blog/2006/07/12/64/#comment-2391</link>
		<dc:creator>Renaun Erickson</dc:creator>
		<pubDate>Tue, 30 Nov 2010 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://renaun.com/blog/?p=64#comment-2391</guid>
		<description>&lt;strong&gt;Updates to Car Example (Interface and ASDoc Comments)&lt;/strong&gt;

	The Flex object composition car example I recently created got some updates.  I changed CompositionBase into a interface instead inheriting the class (thx Marcus for the heads up on that one).  I also went through all the code and

...</description>
		<content:encoded><![CDATA[<p><strong>Updates to Car Example (Interface and ASDoc Comments)</strong></p>
<p>	The Flex object composition car example I recently created got some updates.  I changed CompositionBase into a interface instead inheriting the class (thx Marcus for the heads up on that one).  I also went through all the code and</p>
<p>&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://renaun.com/blog/2006/07/12/64/#comment-2384</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Thu, 30 Nov 2006 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://renaun.com/blog/?p=64#comment-2384</guid>
		<description>First, thanks for putting the time into creating all these examples.

This is just an idea I had while looking through the source code.
All your car parts extend from the 'CompositionBase' class to ensure that the 'ptrCar' property is available to be set from the 'Car' class by its childrenCreated() method. In this example, that's cool and works fine, but I'd suggest you create an 'CompositionBase' Interface that all your car parts can implement, rather than the 'CompositionBase' Class they extend.  (AS3 allows you to define getters and setters on Interfaces now.) That way you still know all the car parts implement the 'ptrCar' thingy and they have the freedom to extend from other more relevant classes. eg. Headlight.as, Blinker.as, InteriorLight.as, GloveBoxLight.as can all extend from a basic Light.as Class to get its on/off functionality as well as implement 'CompositionBase' so we know they all belong to our car. 
Keep up the good work.</description>
		<content:encoded><![CDATA[<p>First, thanks for putting the time into creating all these examples.</p>
<p>This is just an idea I had while looking through the source code.<br />
All your car parts extend from the &#8216;CompositionBase&#8217; class to ensure that the &#8216;ptrCar&#8217; property is available to be set from the &#8216;Car&#8217; class by its childrenCreated() method. In this example, that&#8217;s cool and works fine, but I&#8217;d suggest you create an &#8216;CompositionBase&#8217; Interface that all your car parts can implement, rather than the &#8216;CompositionBase&#8217; Class they extend.  (AS3 allows you to define getters and setters on Interfaces now.) That way you still know all the car parts implement the &#8216;ptrCar&#8217; thingy and they have the freedom to extend from other more relevant classes. eg. Headlight.as, Blinker.as, InteriorLight.as, GloveBoxLight.as can all extend from a basic Light.as Class to get its on/off functionality as well as implement &#8216;CompositionBase&#8217; so we know they all belong to our car.<br />
Keep up the good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Renaun Erickson</title>
		<link>http://renaun.com/blog/2006/07/12/64/#comment-2371</link>
		<dc:creator>Renaun Erickson</dc:creator>
		<pubDate>Fri, 30 Nov 2007 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://renaun.com/blog/?p=64#comment-2371</guid>
		<description>Mostly because I read Ely Greenfield's pdf on "Building A Flex Component".

http://www.onflex.org/ACDS/BuildingAFlexComponent.pdf

He states the life cycle of the component (page 8) is as such:
Constructor
createChildren()
commitProperties()
measure()
updateDisplayList()
CustomEvents

I am a little new to all this also, so my thinking is that 
creationComplete event's definition is this 

"Dispatched when the component has finished its construction, property processing, measuring, layout, and drawing." 

This puts the creationComplete event in at the tail end of the component lifecycle.  Now for childrenCreated()'s definition:

"Performs any final processing after child objects are created."

Now I should do some real tests but it makes sense to do your initializing of pointers etc... right after the children are created (either createChildren() as in Ely's slide or childrenCreated()) so that the initialized code can be used in the rest of the Child's lifecycle, (commitProperties(), measure(), updateDisplayList(), Custom events)

Both methods will work its a matter of the lifecycle of the component and what you want to accomplish.</description>
		<content:encoded><![CDATA[<p>Mostly because I read Ely Greenfield&#8217;s pdf on &#8220;Building A Flex Component&#8221;.</p>
<p><a href="http://www.onflex.org/ACDS/BuildingAFlexComponent.pdf" rel="nofollow">http://www.onflex.org/ACDS/BuildingAFlexComponent.pdf</a></p>
<p>He states the life cycle of the component (page 8) is as such:<br />
Constructor<br />
createChildren()<br />
commitProperties()<br />
measure()<br />
updateDisplayList()<br />
CustomEvents</p>
<p>I am a little new to all this also, so my thinking is that<br />
creationComplete event&#8217;s definition is this </p>
<p>&#8220;Dispatched when the component has finished its construction, property processing, measuring, layout, and drawing.&#8221; </p>
<p>This puts the creationComplete event in at the tail end of the component lifecycle.  Now for childrenCreated()&#8217;s definition:</p>
<p>&#8220;Performs any final processing after child objects are created.&#8221;</p>
<p>Now I should do some real tests but it makes sense to do your initializing of pointers etc&#8230; right after the children are created (either createChildren() as in Ely&#8217;s slide or childrenCreated()) so that the initialized code can be used in the rest of the Child&#8217;s lifecycle, (commitProperties(), measure(), updateDisplayList(), Custom events)</p>
<p>Both methods will work its a matter of the lifecycle of the component and what you want to accomplish.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Coletta</title>
		<link>http://renaun.com/blog/2006/07/12/64/#comment-2369</link>
		<dc:creator>David Coletta</dc:creator>
		<pubDate>Fri, 30 Nov 2007 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://renaun.com/blog/?p=64#comment-2369</guid>
		<description>Can you say more about why you prefer overriding childrenCreated() as opposed to listening for CREATION_COMPLETE? I admit that when I first started using Flex 2.0 alpha, my first instinct was to oveerride a method somewhere. I'm pretty sure I looked for a childrenCreated() protected method, didn't find it, and just went with the event listener approach instead. I think perhaps they added childrenCreated() late in the game, after I had standardized on something else.

But anyway, I'm curious why you think it's more proper for a custom component to use the override approach rather than the event listener approach?</description>
		<content:encoded><![CDATA[<p>Can you say more about why you prefer overriding childrenCreated() as opposed to listening for CREATION_COMPLETE? I admit that when I first started using Flex 2.0 alpha, my first instinct was to oveerride a method somewhere. I&#8217;m pretty sure I looked for a childrenCreated() protected method, didn&#8217;t find it, and just went with the event listener approach instead. I think perhaps they added childrenCreated() late in the game, after I had standardized on something else.</p>
<p>But anyway, I&#8217;m curious why you think it&#8217;s more proper for a custom component to use the override approach rather than the event listener approach?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Renaun Erickson</title>
		<link>http://renaun.com/blog/2006/07/12/64/#comment-2368</link>
		<dc:creator>Renaun Erickson</dc:creator>
		<pubDate>Thu, 30 Nov 2006 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://renaun.com/blog/?p=64#comment-2368</guid>
		<description>super on the class above is pointless, its was a generated class and I didn't clean it out.  It also will not hurt leaving it in.</description>
		<content:encoded><![CDATA[<p>super on the class above is pointless, its was a generated class and I didn&#8217;t clean it out.  It also will not hurt leaving it in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Joy of Flex &#187; Check out Renaun Erickson&#8217;s Object Composition example</title>
		<link>http://renaun.com/blog/2006/07/12/64/#comment-2367</link>
		<dc:creator>The Joy of Flex &#187; Check out Renaun Erickson&#8217;s Object Composition example</dc:creator>
		<pubDate>Thu, 30 Nov 2006 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://renaun.com/blog/?p=64#comment-2367</guid>
		<description>[...] Yesterday I posted some notes about how I&#8217;m getting a bunch of nested components to talk to each other. Some folks call this approach of nested components &#8220;object composition.&#8221; In particular, Renaun Erickson followed up with a blog post of his own that provides some good sample source code for doing this. He took it a step further than I did and actually created a CompositionBase class that the subcomponents all extend. This seems like a good approach for making the relationships a little more formal while retaining the fluidity that is required. [...]</description>
		<content:encoded><![CDATA[<p>[...] Yesterday I posted some notes about how I&#8217;m getting a bunch of nested components to talk to each other. Some folks call this approach of nested components &#8220;object composition.&#8221; In particular, Renaun Erickson followed up with a blog post of his own that provides some good sample source code for doing this. He took it a step further than I did and actually created a CompositionBase class that the subcomponents all extend. This seems like a good approach for making the relationships a little more formal while retaining the fluidity that is required. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mh</title>
		<link>http://renaun.com/blog/2006/07/12/64/#comment-2361</link>
		<dc:creator>mh</dc:creator>
		<pubDate>Sat, 30 Nov 2002 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://renaun.com/blog/?p=64#comment-2361</guid>
		<description>why do you use super()?</description>
		<content:encoded><![CDATA[<p>why do you use super()?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
