<?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: IResponder and Cairngorm</title>
	<atom:link href="http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/</link>
	<description>Thoughts on Software Design and Development</description>
	<lastBuildDate>Sun, 08 Jan 2012 14:25:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: eric</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-4436</link>
		<dc:creator>eric</dc:creator>
		<pubDate>Sat, 26 Jan 2008 04:38:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-4436</guid>
		<description>Hey Bjorn,

Utilizing separate Responder objects will reduce an applications memory footprint as the Command will immediately become eligible for Garbage Collection in the next sweep once the Commands execute();  implementation returns.

Let me explain. When a Command implements IResponder and instantiates a Business Delegate there is a reference to the command via the delegate and the AsyncToken instance, thus the reference count for the Command is greater than 0 and it will not be deallocated. The Command will only be eligible for garbage collection once the AsyncToken invokes result or fault on the Command and the flow of control is returned.

When using separate Responder objects the memory allocated by the Responder instance will almost always be more efficient as the extra overhead associated in the execute implementation of the Command is not be a part of the Responder.

Hope that clarifies some things.
- Eric</description>
		<content:encoded><![CDATA[<p>Hey Bjorn,</p>
<p>Utilizing separate Responder objects will reduce an applications memory footprint as the Command will immediately become eligible for Garbage Collection in the next sweep once the Commands execute();  implementation returns.</p>
<p>Let me explain. When a Command implements IResponder and instantiates a Business Delegate there is a reference to the command via the delegate and the AsyncToken instance, thus the reference count for the Command is greater than 0 and it will not be deallocated. The Command will only be eligible for garbage collection once the AsyncToken invokes result or fault on the Command and the flow of control is returned.</p>
<p>When using separate Responder objects the memory allocated by the Responder instance will almost always be more efficient as the extra overhead associated in the execute implementation of the Command is not be a part of the Responder.</p>
<p>Hope that clarifies some things.<br />
- Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjorn</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-4258</link>
		<dc:creator>Bjorn</dc:creator>
		<pubDate>Tue, 22 Jan 2008 01:53:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-4258</guid>
		<description>Hey Eric,

This is very interesting.
What I&#039;ve noticed when using the profiler is that commands that do not implement IResponder get cleaned up by GC.
However commands that use delegates do not. 
It seems it may be because of the front controller. Front controller uses weak references but perhaps because the command is used as the responder in the delegates call object, the FrontController never releases it.
If the FrontController is removed these instances are cleaned up.

I was wondering.
If we use Responder objects instead of commands, perhaps after the responders.result() finishes we can remove the reference from the command to the responder there for freeing up the command for gc and hopefully leave a circular reference for the responder and delegate so that they can also be cleaned up.

I will test this later.

Hope my ramblings made sense.</description>
		<content:encoded><![CDATA[<p>Hey Eric,</p>
<p>This is very interesting.<br />
What I&#8217;ve noticed when using the profiler is that commands that do not implement IResponder get cleaned up by GC.<br />
However commands that use delegates do not.<br />
It seems it may be because of the front controller. Front controller uses weak references but perhaps because the command is used as the responder in the delegates call object, the FrontController never releases it.<br />
If the FrontController is removed these instances are cleaned up.</p>
<p>I was wondering.<br />
If we use Responder objects instead of commands, perhaps after the responders.result() finishes we can remove the reference from the command to the responder there for freeing up the command for gc and hopefully leave a circular reference for the responder and delegate so that they can also be cleaned up.</p>
<p>I will test this later.</p>
<p>Hope my ramblings made sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivaramme</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-3713</link>
		<dc:creator>ivaramme</dc:creator>
		<pubDate>Tue, 11 Dec 2007 01:04:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-3713</guid>
		<description>Sure!!! Thank you very much... it was in existential doubt... :)
Thank you</description>
		<content:encoded><![CDATA[<p>Sure!!! Thank you very much&#8230; it was in existential doubt&#8230; <img src='http://www.ericfeminella.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-3712</link>
		<dc:creator>eric</dc:creator>
		<pubDate>Mon, 10 Dec 2007 17:47:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-3712</guid>
		<description>Hey Ivaramme,

You certainly can use Cairngorm Events and Commands to handle view specific behaviors. Any application level Events should be implemented as higher level Cairngorm Events. So as a rule of thumb, if you are building an application with Cairngorm all application specific Events should be implemented as Cairngorm Events. All low level events should be implemented as generic Events. For instance, if a component needs to communicate with another component, but the interaction only pertains to the components, not the higher level application as a whole, then the Event should just be a generic flash.events.Event and not a Cairngorm Event.

Hope that helps.
- Eric</description>
		<content:encoded><![CDATA[<p>Hey Ivaramme,</p>
<p>You certainly can use Cairngorm Events and Commands to handle view specific behaviors. Any application level Events should be implemented as higher level Cairngorm Events. So as a rule of thumb, if you are building an application with Cairngorm all application specific Events should be implemented as Cairngorm Events. All low level events should be implemented as generic Events. For instance, if a component needs to communicate with another component, but the interaction only pertains to the components, not the higher level application as a whole, then the Event should just be a generic flash.events.Event and not a Cairngorm Event.</p>
<p>Hope that helps.<br />
- Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivaramme</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-3711</link>
		<dc:creator>ivaramme</dc:creator>
		<pubDate>Mon, 10 Dec 2007 16:29:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-3711</guid>
		<description>Great Idea!!! Favoring composition over inheritance... Great Design...
I&#039;ve been using Cairngorm with mid-size project and its helping me a lot... 
Just wondering... can I use Cairngorm Events (and Commands) to handle View Behaviors (loading components, displaying modal forms, etc) or should I use customized events for that...? Thank you</description>
		<content:encoded><![CDATA[<p>Great Idea!!! Favoring composition over inheritance&#8230; Great Design&#8230;<br />
I&#8217;ve been using Cairngorm with mid-size project and its helping me a lot&#8230;<br />
Just wondering&#8230; can I use Cairngorm Events (and Commands) to handle View Behaviors (loading components, displaying modal forms, etc) or should I use customized events for that&#8230;? Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-3688</link>
		<dc:creator>eric</dc:creator>
		<pubDate>Sun, 02 Dec 2007 01:17:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-3688</guid>
		<description>Hey Almog,

Invoking another Command from  a Responders result would be very easy to implement as all that would be needed would be to pass a reference of the Command to the Responder instance via its Constructor</description>
		<content:encoded><![CDATA[<p>Hey Almog,</p>
<p>Invoking another Command from  a Responders result would be very easy to implement as all that would be needed would be to pass a reference of the Command to the Responder instance via its Constructor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: akurtser</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-3687</link>
		<dc:creator>akurtser</dc:creator>
		<pubDate>Sat, 01 Dec 2007 22:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-3687</guid>
		<description>Hi Eric, 
I think the way you decouple the command from responding to the service is great, yet, I haven&#039;t found any good approach to do the same thing with when I want to chain commands.
With the SequenceCommand or event chain I can do it quite easily but what would be your approach to such situation where a command needs to be executed right after the responder  parsed the data ? 

Thanks,
Almog Kurtser.</description>
		<content:encoded><![CDATA[<p>Hi Eric,<br />
I think the way you decouple the command from responding to the service is great, yet, I haven&#8217;t found any good approach to do the same thing with when I want to chain commands.<br />
With the SequenceCommand or event chain I can do it quite easily but what would be your approach to such situation where a command needs to be executed right after the responder  parsed the data ? </p>
<p>Thanks,<br />
Almog Kurtser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-3670</link>
		<dc:creator>eric</dc:creator>
		<pubDate>Sun, 25 Nov 2007 03:22:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-3670</guid>
		<description>Hey Neil,

Thanks for your comments. I didn&#039;t include the delegate in the example as it is not really needed to illustrate the implementation of a separate Responder.

Thanks,
Eric</description>
		<content:encoded><![CDATA[<p>Hey Neil,</p>
<p>Thanks for your comments. I didn&#8217;t include the delegate in the example as it is not really needed to illustrate the implementation of a separate Responder.</p>
<p>Thanks,<br />
Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nwebb</title>
		<link>http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/comment-page-1/#comment-3665</link>
		<dc:creator>nwebb</dc:creator>
		<pubDate>Sat, 24 Nov 2007 08:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.ericfeminella.com/blog/2007/11/23/iresponder-and-cairngorm/#comment-3665</guid>
		<description>Thanks Eric. Great explanation. At times I&#039;ve had both my Command and Delegate classes implementing IResponder ( see http://nwebb.co.uk/blog/?p=118 ) - any &#039;heavy lifting&#039; was done in the Delegate&#039;s result method  (to keep the Command class as clean as possible) and then the simplified result was passed back to the Command. However, I prefer the idea of having a separate Responder class which takes care of everything. It can be used to achieve the same thing but in a cleaner way, and I guess that if the Command needs to respond to the async operation in more than one way, a simple responder factory could be implemented and the intention would be very clear. 

You don&#039;t show the Delegate in your post but I assume there&#039;s nothing unusual going on. Are you just setting token.addResponder(responderRef); ?
Cheers, Neil</description>
		<content:encoded><![CDATA[<p>Thanks Eric. Great explanation. At times I&#8217;ve had both my Command and Delegate classes implementing IResponder ( see <a href="http://nwebb.co.uk/blog/?p=118" rel="nofollow">http://nwebb.co.uk/blog/?p=118</a> ) &#8211; any &#8216;heavy lifting&#8217; was done in the Delegate&#8217;s result method  (to keep the Command class as clean as possible) and then the simplified result was passed back to the Command. However, I prefer the idea of having a separate Responder class which takes care of everything. It can be used to achieve the same thing but in a cleaner way, and I guess that if the Command needs to respond to the async operation in more than one way, a simple responder factory could be implemented and the intention would be very clear. </p>
<p>You don&#8217;t show the Delegate in your post but I assume there&#8217;s nothing unusual going on. Are you just setting token.addResponder(responderRef); ?<br />
Cheers, Neil</p>
]]></content:encoded>
	</item>
</channel>
</rss>

