<?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: Cairngorm, n::1 event::command?</title>
	<atom:link href="http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/</link>
	<description>Comments and thoughts on technology from Marc Hughes</description>
	<lastBuildDate>Wed, 17 Feb 2010 03:14:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Marc</title>
		<link>http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/comment-page-1/#comment-258</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Fri, 09 May 2008 18:48:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.rogue-development.com/blog2/?p=195#comment-258</guid>
		<description>The use-case my co-worker was trying to do was add a document modified flag to the UI.  He wanted to hook up a single command to display that flag to any event that modifies the document.  He ended up making that flag a property of the model that the model set automatically set on change (which was probably a better solution).

Another use case might be if you have 3 buttons.  The first two each perform a different action.  The third button performs both of those actions and is provided as a shortcut for the user.  I hadn&#039;t seen the SequenceCommand before, so that could be used to solve this.  But perhaps a more elegant solution would be to hook up that third event to the first two commands.

This is the first time we&#039;ve run into this, it&#039;s certainly not an often-needed feature.

It&#039;s funny to see which blog posts end up getting the most feedback...</description>
		<content:encoded><![CDATA[<p>The use-case my co-worker was trying to do was add a document modified flag to the UI.  He wanted to hook up a single command to display that flag to any event that modifies the document.  He ended up making that flag a property of the model that the model set automatically set on change (which was probably a better solution).</p>
<p>Another use case might be if you have 3 buttons.  The first two each perform a different action.  The third button performs both of those actions and is provided as a shortcut for the user.  I hadn&#8217;t seen the SequenceCommand before, so that could be used to solve this.  But perhaps a more elegant solution would be to hook up that third event to the first two commands.</p>
<p>This is the first time we&#8217;ve run into this, it&#8217;s certainly not an often-needed feature.</p>
<p>It&#8217;s funny to see which blog posts end up getting the most feedback&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Schneble</title>
		<link>http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/comment-page-1/#comment-257</link>
		<dc:creator>Nick Schneble</dc:creator>
		<pubDate>Fri, 09 May 2008 18:30:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.rogue-development.com/blog2/?p=195#comment-257</guid>
		<description>You can also use the SequenceCommand in Cairngorm to chain multiple commands to a single event.

While you would still have to register an event for each of the commands, you would only have to dispatch one event to automatically cause the rest of the commands to be executed.</description>
		<content:encoded><![CDATA[<p>You can also use the SequenceCommand in Cairngorm to chain multiple commands to a single event.</p>
<p>While you would still have to register an event for each of the commands, you would only have to dispatch one event to automatically cause the rest of the commands to be executed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Webster</title>
		<link>http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/comment-page-1/#comment-256</link>
		<dc:creator>Steven Webster</dc:creator>
		<pubDate>Fri, 09 May 2008 18:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.rogue-development.com/blog2/?p=195#comment-256</guid>
		<description>So can you give a use-case as to where you&#039;d want an event to fire more than one command ?  It&#039;s not a flaw in the design as much as an intention of the design; that user-gestures are represented by commands, and that commands are responsible for orchestrating all of the work related to that user-gesture.  A command is free to employ the use of all manner of other classes; perhaps you&#039;re artificially limiting yourself to trying to stick all business logic in commands, and not thinking about creating non-Cairngorm classes to participate in your design ?

Multiple controllers is a bad smell as well for me; unless the commands the controller is handling are completely exclusive of each other (which to me would be refactoring towards 2 separate applications/modules).  The whole point of the controller is a single switch to decide on how to handle a user-gesture; if you have multiplicity in your controllers, the extreme case (1 controller per event) has now just made your controller redundant.

Use-cases would help, code would help even more, in helping to understand what you&#039;re trying to achieve, and whether Cairngorm is preventing you actually, or as I suspect, artificially.

It&#039;s ok to colour outside the lines.</description>
		<content:encoded><![CDATA[<p>So can you give a use-case as to where you&#8217;d want an event to fire more than one command ?  It&#8217;s not a flaw in the design as much as an intention of the design; that user-gestures are represented by commands, and that commands are responsible for orchestrating all of the work related to that user-gesture.  A command is free to employ the use of all manner of other classes; perhaps you&#8217;re artificially limiting yourself to trying to stick all business logic in commands, and not thinking about creating non-Cairngorm classes to participate in your design ?</p>
<p>Multiple controllers is a bad smell as well for me; unless the commands the controller is handling are completely exclusive of each other (which to me would be refactoring towards 2 separate applications/modules).  The whole point of the controller is a single switch to decide on how to handle a user-gesture; if you have multiplicity in your controllers, the extreme case (1 controller per event) has now just made your controller redundant.</p>
<p>Use-cases would help, code would help even more, in helping to understand what you&#8217;re trying to achieve, and whether Cairngorm is preventing you actually, or as I suspect, artificially.</p>
<p>It&#8217;s ok to colour outside the lines.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/comment-page-1/#comment-255</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Fri, 09 May 2008 17:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.rogue-development.com/blog2/?p=195#comment-255</guid>
		<description>Thanks guys, I&#039;ll make sure to look into UM Cairngorm, this is the first I heard of it.

Good idea bout the multiple controllers, that would work for this.</description>
		<content:encoded><![CDATA[<p>Thanks guys, I&#8217;ll make sure to look into UM Cairngorm, this is the first I heard of it.</p>
<p>Good idea bout the multiple controllers, that would work for this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DasFX</title>
		<link>http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/comment-page-1/#comment-254</link>
		<dc:creator>DasFX</dc:creator>
		<pubDate>Fri, 09 May 2008 17:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.rogue-development.com/blog2/?p=195#comment-254</guid>
		<description>You may also want to check out the UM Cairngorm extensions:
http://code.google.com/p/flexcairngorm/</description>
		<content:encoded><![CDATA[<p>You may also want to check out the UM Cairngorm extensions:<br />
<a href="http://code.google.com/p/flexcairngorm/" rel="nofollow">http://code.google.com/p/flexcairngorm/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Rinehart</title>
		<link>http://www.rogue-development.com/blog2/2008/05/cairngorm-n1-eventcommand/comment-page-1/#comment-253</link>
		<dc:creator>Joe Rinehart</dc:creator>
		<pubDate>Fri, 09 May 2008 17:26:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.rogue-development.com/blog2/?p=195#comment-253</guid>
		<description>This bit me in the rear when I first started with Cairngorm, and still tweaks me something silly.

You _can_ have more than one command per event, but the must be registered in separate controllers.  I&#039;ve worked around this by mapping an event to an &quot;aggregate&quot; command that creates and runs the N other commands involved.  Nasty stuff, and a design flaw in Cairngorm IMHO.</description>
		<content:encoded><![CDATA[<p>This bit me in the rear when I first started with Cairngorm, and still tweaks me something silly.</p>
<p>You _can_ have more than one command per event, but the must be registered in separate controllers.  I&#8217;ve worked around this by mapping an event to an &#8220;aggregate&#8221; command that creates and runs the N other commands involved.  Nasty stuff, and a design flaw in Cairngorm IMHO.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
