<?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: Handling deferred view component creation within the PureMVC framework</title>
	<atom:link href="http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/</link>
	<description>Flex, AIR and Rich Internet Goodness</description>
	<lastBuildDate>Fri, 10 Jul 2009 09:58:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Darshan Sawardekar</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-181</link>
		<dc:creator>Darshan Sawardekar</dc:creator>
		<pubDate>Fri, 21 Nov 2008 14:50:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-181</guid>
		<description>Hey Tom,

Have you tried reflexive mediator registration in Fabrication? It solves the problem of deferred mediator registration in a very simple way using component resolvers. Instead of waiting for the component to be created, you just register the mediator as you would. Fabrication waits for the component to become available and then registers the mediator with the facade. Check it out here[1].

peace,
darshan

[1] : http://code.google.com/p/fabrication/wiki/ReflexiveMediatorRegistration</description>
		<content:encoded><![CDATA[<p>Hey Tom,</p>
<p>Have you tried reflexive mediator registration in Fabrication? It solves the problem of deferred mediator registration in a very simple way using component resolvers. Instead of waiting for the component to be created, you just register the mediator as you would. Fabrication waits for the component to become available and then registers the mediator with the facade. Check it out here[1].</p>
<p>peace,<br />
darshan</p>
<p>[1] : <a href="http://code.google.com/p/fabrication/wiki/ReflexiveMediatorRegistration" rel="nofollow">http://code.google.com/p/fabrication/wiki/ReflexiveMediatorRegistration</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sitron</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-128</link>
		<dc:creator>sitron</dc:creator>
		<pubDate>Tue, 18 Mar 2008 08:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-128</guid>
		<description>hi! it&#039;s me again. Just to inform you that i posted the same question on puremvc forum (&quot;architecture&quot; / topic: viewstack, deferred mediator creation).</description>
		<content:encoded><![CDATA[<p>hi! it&#8217;s me again. Just to inform you that i posted the same question on puremvc forum (&#8220;architecture&#8221; / topic: viewstack, deferred mediator creation).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sitron</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-123</link>
		<dc:creator>sitron</dc:creator>
		<pubDate>Mon, 17 Mar 2008 16:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-123</guid>
		<description>hi!
very interesting...
but doesn&#039;t it add another problem? what if the command is passing data to the -still not created- mediator?
ie: view in a viewStack has a datagrid which on selection dispatches a notification (via its mediator) carrying dg selected data. Notification handles the viewStack change, but cannot pass the selected data to the new view as its mediator is still  not created. 
How do you deal with that? where would you store the transferred data while waiting on view creationComplete().
Sorry for the poor English.. hope it is understandable :)</description>
		<content:encoded><![CDATA[<p>hi!<br />
very interesting&#8230;<br />
but doesn&#8217;t it add another problem? what if the command is passing data to the -still not created- mediator?<br />
ie: view in a viewStack has a datagrid which on selection dispatches a notification (via its mediator) carrying dg selected data. Notification handles the viewStack change, but cannot pass the selected data to the new view as its mediator is still  not created.<br />
How do you deal with that? where would you store the transferred data while waiting on view creationComplete().<br />
Sorry for the poor English.. hope it is understandable <img src='http://www.tomcornilliac.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Cornilliac</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-13</link>
		<dc:creator>Tom Cornilliac</dc:creator>
		<pubDate>Sat, 26 Jan 2008 22:42:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-13</guid>
		<description>Hi Cliff - You make a good point, I haven&#039;t given much thought to interrogating the view component to determine which mediator to use. I&#039;m curious, which property are you using for the Switch? Do you use a public static const like name? 

Thanks for stopping by and adding!</description>
		<content:encoded><![CDATA[<p>Hi Cliff &#8211; You make a good point, I haven&#8217;t given much thought to interrogating the view component to determine which mediator to use. I&#8217;m curious, which property are you using for the Switch? Do you use a public static const like name? </p>
<p>Thanks for stopping by and adding!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cliff Hall</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-12</link>
		<dc:creator>Cliff Hall</dc:creator>
		<pubDate>Sat, 26 Jan 2008 20:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-12</guid>
		<description>Hi Tom,

I generally defer the creation of the Mediator until its view component exists. The way you&#039;ve done it here illustrates what what the ApplicationMediator&#039;s job usually ends up being. 

You can send a bubbling Event (no need for a custom event really) from any depth within your view hierarchy in the creationComplete for your new view component, and then grab it at the top with the ApplicationMediator. 

The event will have a reference to the component (event.target), which you can inspect any property of (such as id) in a switch statement, creating the appropriate Mediator depending upon the component and register it. 

-=Cliff&gt;</description>
		<content:encoded><![CDATA[<p>Hi Tom,</p>
<p>I generally defer the creation of the Mediator until its view component exists. The way you&#8217;ve done it here illustrates what what the ApplicationMediator&#8217;s job usually ends up being. </p>
<p>You can send a bubbling Event (no need for a custom event really) from any depth within your view hierarchy in the creationComplete for your new view component, and then grab it at the top with the ApplicationMediator. </p>
<p>The event will have a reference to the component (event.target), which you can inspect any property of (such as id) in a switch statement, creating the appropriate Mediator depending upon the component and register it. </p>
<p>-=Cliff&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Cornilliac</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-11</link>
		<dc:creator>Tom Cornilliac</dc:creator>
		<pubDate>Sat, 26 Jan 2008 18:26:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-11</guid>
		<description>@Simeon - Thanks for stopping by man! I agree in that in PureMVC managing mediators can get a little bit complicated in larger apps, it&#039;s almost like the mediators are dancing with the display list and trying not to step on each other&#039;s toes (ok that was a lame analogy). When I first started with PureMVC this was not an issue as my app was on the smallish side, now that I&#039;m working on a larger app I find myself thinking about this a lot. Here&#039;s couple of vague ideas on solving this problem.

I wonder if the Factory Pattern could apply here. Could I build a mediator factory (or would that be an Abstract Factory). The idea obviously is that the factory would handle all the dirty work.

Or maybe some sort of dependency injection where display objects are injected into mediators at runtime so when display objects are added to the display list the mediator is already bound to them. 

Food for thought anyway.</description>
		<content:encoded><![CDATA[<p>@Simeon &#8211; Thanks for stopping by man! I agree in that in PureMVC managing mediators can get a little bit complicated in larger apps, it&#8217;s almost like the mediators are dancing with the display list and trying not to step on each other&#8217;s toes (ok that was a lame analogy). When I first started with PureMVC this was not an issue as my app was on the smallish side, now that I&#8217;m working on a larger app I find myself thinking about this a lot. Here&#8217;s couple of vague ideas on solving this problem.</p>
<p>I wonder if the Factory Pattern could apply here. Could I build a mediator factory (or would that be an Abstract Factory). The idea obviously is that the factory would handle all the dirty work.</p>
<p>Or maybe some sort of dependency injection where display objects are injected into mediators at runtime so when display objects are added to the display list the mediator is already bound to them. </p>
<p>Food for thought anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Cornilliac</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-10</link>
		<dc:creator>Tom Cornilliac</dc:creator>
		<pubDate>Sat, 26 Jan 2008 18:05:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-10</guid>
		<description>@Mike - There are at least a couple different ways that I can think of to trigger mediator removal when it&#039;s DisplayObject (component) is removed from the display list.

1. You could use a custom event subclass dispatched by the &quot;removed&quot; or &quot;removedFromStage&quot; event. The process here is almost exactly the same as in my post with the exception that you would call &quot;facade.removeMediator(componentName)&quot; from the listening mediator instead of creating a new mediator.

2. When you initially create the mediator, in the constructor method, add an event listener for the &quot;removed&quot; or &quot;removedFromStage&quot; event. Depending on which event you use your mediator will be notified just before it&#039;s about to be removed from the display list. You can then have your mediator destroy itself. 

I&#039;d probably use method #2 most of the time. Method #1 is a bit overkill for most apps. Besides that method #2 requires your view component to dispatch one less event, which is always good.</description>
		<content:encoded><![CDATA[<p>@Mike &#8211; There are at least a couple different ways that I can think of to trigger mediator removal when it&#8217;s DisplayObject (component) is removed from the display list.</p>
<p>1. You could use a custom event subclass dispatched by the &#8220;removed&#8221; or &#8220;removedFromStage&#8221; event. The process here is almost exactly the same as in my post with the exception that you would call &#8220;facade.removeMediator(componentName)&#8221; from the listening mediator instead of creating a new mediator.</p>
<p>2. When you initially create the mediator, in the constructor method, add an event listener for the &#8220;removed&#8221; or &#8220;removedFromStage&#8221; event. Depending on which event you use your mediator will be notified just before it&#8217;s about to be removed from the display list. You can then have your mediator destroy itself. </p>
<p>I&#8217;d probably use method #2 most of the time. Method #1 is a bit overkill for most apps. Besides that method #2 requires your view component to dispatch one less event, which is always good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simeon</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-9</link>
		<dc:creator>Simeon</dc:creator>
		<pubDate>Sat, 26 Jan 2008 03:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-9</guid>
		<description>I am really glad that you are enjoying the framework. And this is an awesome example of a complex problem.  But seeing this reminds me of what I thought when I saw pureMVC for the first time.

&quot;And people thought Cairngorm was complicated&quot;

I think its great pureMVC jumps the gaps between Flex and flash and the server side stuff.  But I honestly cant imagine implementing all this stuff in a large application.

I am excited to hear more of your reviews of it.  I want to know if when you are done with a big project (something that warrants a heavy duty framework) if you feel all this stuff was worth while.

Thanks for the post!</description>
		<content:encoded><![CDATA[<p>I am really glad that you are enjoying the framework. And this is an awesome example of a complex problem.  But seeing this reminds me of what I thought when I saw pureMVC for the first time.</p>
<p>&#8220;And people thought Cairngorm was complicated&#8221;</p>
<p>I think its great pureMVC jumps the gaps between Flex and flash and the server side stuff.  But I honestly cant imagine implementing all this stuff in a large application.</p>
<p>I am excited to hear more of your reviews of it.  I want to know if when you are done with a big project (something that warrants a heavy duty framework) if you feel all this stuff was worth while.</p>
<p>Thanks for the post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Huntington</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-8</link>
		<dc:creator>Mike Huntington</dc:creator>
		<pubDate>Sat, 26 Jan 2008 02:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-8</guid>
		<description>One more question Tom (if you don&#039;t mind)...

What would be the best way to remove a mediator using the ComponentDestructionEvent... I&#039;m trying to figure out how to get the ApplicationMediator to figure out what component just went out of view... and what mediator to take off.</description>
		<content:encoded><![CDATA[<p>One more question Tom (if you don&#8217;t mind)&#8230;</p>
<p>What would be the best way to remove a mediator using the ComponentDestructionEvent&#8230; I&#8217;m trying to figure out how to get the ApplicationMediator to figure out what component just went out of view&#8230; and what mediator to take off.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Huntington</title>
		<link>http://www.tomcornilliac.com/2008/01/handling-deferred-view-component-creation-within-the-puremvc-framework/comment-page-1/#comment-7</link>
		<dc:creator>Mike Huntington</dc:creator>
		<pubDate>Fri, 25 Jan 2008 21:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.cornilliac.com/blog/?p=44#comment-7</guid>
		<description>That helps a lot and makes sense. Thanks!!</description>
		<content:encoded><![CDATA[<p>That helps a lot and makes sense. Thanks!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
