<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Where to &#8216;inject&#8217; and where to &#8216;massage&#8217; data in Cairngorm</title>
	<atom:link href="http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/feed/" rel="self" type="application/rss+xml" />
	<link>http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/</link>
	<description>actionscript, flex, flash and other fun stuff</description>
	<lastBuildDate>Sat, 14 Nov 2009 16:04:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Border Crossing Stats &#187; Where to inject&#8217; and where to massage&#8217; data in Cairngorm jwopitz &#8230;</title>
		<link>http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-4063</link>
		<dc:creator>Border Crossing Stats &#187; Where to inject&#8217; and where to massage&#8217; data in Cairngorm jwopitz &#8230;</dc:creator>
		<pubDate>Tue, 11 Mar 2008 09:09:20 +0000</pubDate>
		<guid isPermaLink="false">http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-4063</guid>
		<description>[...] Get more information about this from the author here [...]</description>
		<content:encoded><![CDATA[<p>[...] Get more information about this from the author here [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwopitz</title>
		<link>http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-22</link>
		<dc:creator>jwopitz</dc:creator>
		<pubDate>Thu, 22 Mar 2007 17:14:17 +0000</pubDate>
		<guid isPermaLink="false">http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-22</guid>
		<description>Ed,

The question was not rhetorical.  I too opt for option b).  As for the comment plugin, I am using the free wordpress blog right now which affords me very little in the way of customization.  I am working on getting hosting for my own sight.  Its just hard to find the right place since I want SVN on the server along with other options.</description>
		<content:encoded><![CDATA[<p>Ed,</p>
<p>The question was not rhetorical.  I too opt for option b).  As for the comment plugin, I am using the free wordpress blog right now which affords me very little in the way of customization.  I am working on getting hosting for my own sight.  Its just hard to find the right place since I want SVN on the server along with other options.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed</title>
		<link>http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-20</link>
		<dc:creator>Ed</dc:creator>
		<pubDate>Thu, 22 Mar 2007 17:05:15 +0000</pubDate>
		<guid isPermaLink="false">http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-20</guid>
		<description>Thanks for your reply. Only just found it! Maybe a comment subscription plugin would be handy :).

I&#039;m not sure if your question is rhetorical, but I would go for option B. The command chooses which delegate to use. If you have multiple views each with logged in/out checks (as in option A), that would be code duplication. Having one command manage it seems simpler in my opinion.

But then again there is a time and a place for everything! Maybe option A would be better in special circumstances.</description>
		<content:encoded><![CDATA[<p>Thanks for your reply. Only just found it! Maybe a comment subscription plugin would be handy <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I&#8217;m not sure if your question is rhetorical, but I would go for option B. The command chooses which delegate to use. If you have multiple views each with logged in/out checks (as in option A), that would be code duplication. Having one command manage it seems simpler in my opinion.</p>
<p>But then again there is a time and a place for everything! Maybe option A would be better in special circumstances.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwopitz</title>
		<link>http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-12</link>
		<dc:creator>jwopitz</dc:creator>
		<pubDate>Mon, 12 Mar 2007 21:59:01 +0000</pubDate>
		<guid isPermaLink="false">http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-12</guid>
		<description>Hey Ed.  Sorry I just now saw the comments.  Now to reply to your questions:

1. Yeah, I think there is a point when you should consider breaking a command down into smaller bits.  How that is approached is innumerable. I would make the assumption that if there is a whole bunch of logic in a command somewhere, then there is a high chance that some portion of the logic is or could be handled elsewhere and be reused by other commands or classes.  No point in code duplication.  But generally I would rather have the logic (if it isn&#039;t being reused) to be in one place which is the command.

But let me pose this to you:  You have an application that saves data either to a local shared obj or to a database.  Where it is to be saved is determined by seeing if a user is logged in or logged out of the app.  The logic for sending the data is the same in either case.  So do you A) have the view see what the log in status is, then call an appropriate command such as saveToLSO or saveToDataBase? or do you B) have one command that chooses the appropriate delegate and has just one place for the needed logic?

2. I generally like the idea of having less places to go and more to do than more places to go and less to do.  Meaning, I&#039;d rather have a delegate with half a dozen related methods than half a dozen related delegates with one or two methods.  But both approaches would be acceptable in my book.</description>
		<content:encoded><![CDATA[<p>Hey Ed.  Sorry I just now saw the comments.  Now to reply to your questions:</p>
<p>1. Yeah, I think there is a point when you should consider breaking a command down into smaller bits.  How that is approached is innumerable. I would make the assumption that if there is a whole bunch of logic in a command somewhere, then there is a high chance that some portion of the logic is or could be handled elsewhere and be reused by other commands or classes.  No point in code duplication.  But generally I would rather have the logic (if it isn&#8217;t being reused) to be in one place which is the command.</p>
<p>But let me pose this to you:  You have an application that saves data either to a local shared obj or to a database.  Where it is to be saved is determined by seeing if a user is logged in or logged out of the app.  The logic for sending the data is the same in either case.  So do you A) have the view see what the log in status is, then call an appropriate command such as saveToLSO or saveToDataBase? or do you B) have one command that chooses the appropriate delegate and has just one place for the needed logic?</p>
<p>2. I generally like the idea of having less places to go and more to do than more places to go and less to do.  Meaning, I&#8217;d rather have a delegate with half a dozen related methods than half a dozen related delegates with one or two methods.  But both approaches would be acceptable in my book.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed</title>
		<link>http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-6</link>
		<dc:creator>Ed</dc:creator>
		<pubDate>Mon, 19 Feb 2007 11:45:41 +0000</pubDate>
		<guid isPermaLink="false">http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-6</guid>
		<description>You bring up valid points that should be considered when using the framework.

Personally I like to pass VOs into Views, then have the view do what it wants with that data. I prefer this way because it makes life simpler if you want to add a variable to the view. Rather than having to create new setter/getter functions, all you do is add a class variable to the  VO.

So each of my Views has data encapsulated in a VO. The view updates the VO as necessary, then sends it via an event to a Command. There the Command can inject data or simply pass the VO to a Business Delegate.

I have two more questions which I would like your views on:

1. Is there a point when a Command contains too much logic? In this case, should helper class be created to assist commands?

2. Say I have one HTTP service that can perform different actions based on paramaters based to it (e.g. mydomain.com/getdata.php?action=action1 and mydomain.com/getdata.php?action=action2). Should I create 2 Business Delegate classes, one for each action? Or should I just have one because it is essentially the same service. This becomes more complicated when the service performs, say, 10 actions. You end up with 10 methods in the Business Delegate, one for each service action. Is this acceptable?

What do you think?</description>
		<content:encoded><![CDATA[<p>You bring up valid points that should be considered when using the framework.</p>
<p>Personally I like to pass VOs into Views, then have the view do what it wants with that data. I prefer this way because it makes life simpler if you want to add a variable to the view. Rather than having to create new setter/getter functions, all you do is add a class variable to the  VO.</p>
<p>So each of my Views has data encapsulated in a VO. The view updates the VO as necessary, then sends it via an event to a Command. There the Command can inject data or simply pass the VO to a Business Delegate.</p>
<p>I have two more questions which I would like your views on:</p>
<p>1. Is there a point when a Command contains too much logic? In this case, should helper class be created to assist commands?</p>
<p>2. Say I have one HTTP service that can perform different actions based on paramaters based to it (e.g. mydomain.com/getdata.php?action=action1 and mydomain.com/getdata.php?action=action2). Should I create 2 Business Delegate classes, one for each action? Or should I just have one because it is essentially the same service. This becomes more complicated when the service performs, say, 10 actions. You end up with 10 methods in the Business Delegate, one for each service action. Is this acceptable?</p>
<p>What do you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwopitz</title>
		<link>http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-2</link>
		<dc:creator>jwopitz</dc:creator>
		<pubDate>Thu, 14 Dec 2006 18:07:48 +0000</pubDate>
		<guid isPermaLink="false">http://jwopitz.wordpress.com/2006/12/13/where-to-inject-and-where-to-massage-data-in-cairngorm/#comment-2</guid>
		<description>I have given this more thought and I am leaning towards having the Command act as the &#039;assembly point&#039; for all needed data.  So the UI would pass the needed data in a raw format via the CairngormEvent&#039;s subclass&#039;s properties (which are tailor-made for the particular event occuring). Then the Command would look at the Event&#039;s properties, create a new ValueObject subclass, grab the needed data from other points (like the model) and finally pass it on to the delegate&#039;s methods.

Of course this too doesn&#039;t sit well with me because then you are only utilizing the ValueObject through one data transition.  In addition to that last point, I really like the idea of utilizing ValueObjects for more than parameters to be passed to calls. 

Take for instance a view with several controls (2 comboBoxes, 5 text fields, etc.).  I really like this idea of having a getter/setter property that takes/returns a VO.  This way when setting that property, you can pass that VO to the view, which the setter looks into to set various more granular properties (such as the aforementioned controls).  The reverse could happen on getting that value, the getter looks at the granular properties of the controls then returns a VO based on that.  From there it could be bounced around or sent off via a call.

Who knows.  Maybe this is the standard in which things work and I have been in the dark.  I just know that this is underutilized in the projects I have worked on in the past.</description>
		<content:encoded><![CDATA[<p>I have given this more thought and I am leaning towards having the Command act as the &#8216;assembly point&#8217; for all needed data.  So the UI would pass the needed data in a raw format via the CairngormEvent&#8217;s subclass&#8217;s properties (which are tailor-made for the particular event occuring). Then the Command would look at the Event&#8217;s properties, create a new ValueObject subclass, grab the needed data from other points (like the model) and finally pass it on to the delegate&#8217;s methods.</p>
<p>Of course this too doesn&#8217;t sit well with me because then you are only utilizing the ValueObject through one data transition.  In addition to that last point, I really like the idea of utilizing ValueObjects for more than parameters to be passed to calls. </p>
<p>Take for instance a view with several controls (2 comboBoxes, 5 text fields, etc.).  I really like this idea of having a getter/setter property that takes/returns a VO.  This way when setting that property, you can pass that VO to the view, which the setter looks into to set various more granular properties (such as the aforementioned controls).  The reverse could happen on getting that value, the getter looks at the granular properties of the controls then returns a VO based on that.  From there it could be bounced around or sent off via a call.</p>
<p>Who knows.  Maybe this is the standard in which things work and I have been in the dark.  I just know that this is underutilized in the projects I have worked on in the past.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
