<?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: Application Events: Modeling Selection vs De-Selection as Separate Events?</title>
	<atom:link href="http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/</link>
	<description>Better Than Yesterday</description>
	<lastBuildDate>Mon, 20 May 2013 17:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-659</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Fri, 19 Mar 2010 18:37:39 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-659</guid>
		<description>@Diego,

my response to your comments turned out to be huge. so i posted it as a new entry on it&#039;s own. http://www.lostechies.com/blogs/derickbailey/archive/2010/03/19/a-response-concerning-semantics-and-intention-revealing-code.aspx</description>
		<content:encoded><![CDATA[<p>@Diego,</p>
<p>my response to your comments turned out to be huge. so i posted it as a new entry on it&#8217;s own. <a href="http://www.lostechies.com/blogs/derickbailey/archive/2010/03/19/a-response-concerning-semantics-and-intention-revealing-code.aspx" rel="nofollow">http://www.lostechies.com/blogs/derickbailey/archive/2010/03/19/a-response-concerning-semantics-and-intention-revealing-code.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edin</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-658</link>
		<dc:creator>Edin</dc:creator>
		<pubDate>Thu, 18 Mar 2010 08:04:55 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-658</guid>
		<description>I would say that at this point there is no big difference between the two options. If you go with option 1, you kind of follow KISS principle, if you go with option 2 then you&#039;re making things explicit which is a good thing also. </description>
		<content:encoded><![CDATA[<p>I would say that at this point there is no big difference between the two options. If you go with option 1, you kind of follow KISS principle, if you go with option 2 then you&#8217;re making things explicit which is a good thing also. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jOE</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-657</link>
		<dc:creator>jOE</dc:creator>
		<pubDate>Thu, 18 Mar 2010 04:28:28 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-657</guid>
		<description>1) Does the current solution work? 
2) Why not use full-text to find product codes? Drop downs are evil.</description>
		<content:encoded><![CDATA[<p>1) Does the current solution work?<br />
2) Why not use full-text to find product codes? Drop downs are evil.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-656</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Wed, 17 Mar 2010 18:16:59 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-656</guid>
		<description>I don&#039;t have the same concern as you. Passing null back to the listener of the event is better approach. It&#039;s safe in the language, it&#039;s semantics really means &quot;nothing&quot;, it&#039;s easy  to check, it&#039;s lightweight (costs an clean IntPtr).

Why would you think the user HAS to know something which he might not know. I think is way more straight to work with null  than with empty object (null pattern).

BUT, if still you&#039;re not comfortable passing a null back on Selection event, maybe you could take a look at option construct on F#. Maybe you can have something like this in C#. </description>
		<content:encoded><![CDATA[<p>I don&#8217;t have the same concern as you. Passing null back to the listener of the event is better approach. It&#8217;s safe in the language, it&#8217;s semantics really means &#8220;nothing&#8221;, it&#8217;s easy  to check, it&#8217;s lightweight (costs an clean IntPtr).</p>
<p>Why would you think the user HAS to know something which he might not know. I think is way more straight to work with null  than with empty object (null pattern).</p>
<p>BUT, if still you&#8217;re not comfortable passing a null back on Selection event, maybe you could take a look at option construct on F#. Maybe you can have something like this in C#. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-655</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Wed, 17 Mar 2010 17:30:37 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-655</guid>
		<description>@Dan, @Dennis,

The null object pattern would be a better OO solution, but wouldn&#039;t solve the modeling problem, which is the real problem that I&#039;m trying to address. I do like the null object pattern, though. it solves a lot of OO problems.

@Keith,

an undo of hte command would require a memento pattern as well, but would certainly be a possibility, technically. though in this case, i think it would be overkill. i really don&#039;t need an n-level undo and i&#039;m not really dealing with a command at this point. it really is an event - something has happened and the parent form needs to respond - and not a command - something needs to happen, go do it for me. 

@rob,

a single Change event would be a better option for #1. good suggestion on that one.

as for the parent and subscribing to two events... the parent will handle either event as distinct things to respond to. the parent cannot assume either of them firing first or second, or having them fired only once. the parent has to be able to respond to any number of either event as they occur. the good news is that it is far easier to code like this than to assume or expect a certain order for the events.</description>
		<content:encoded><![CDATA[<p>@Dan, @Dennis,</p>
<p>The null object pattern would be a better OO solution, but wouldn&#8217;t solve the modeling problem, which is the real problem that I&#8217;m trying to address. I do like the null object pattern, though. it solves a lot of OO problems.</p>
<p>@Keith,</p>
<p>an undo of hte command would require a memento pattern as well, but would certainly be a possibility, technically. though in this case, i think it would be overkill. i really don&#8217;t need an n-level undo and i&#8217;m not really dealing with a command at this point. it really is an event &#8211; something has happened and the parent form needs to respond &#8211; and not a command &#8211; something needs to happen, go do it for me. </p>
<p>@rob,</p>
<p>a single Change event would be a better option for #1. good suggestion on that one.</p>
<p>as for the parent and subscribing to two events&#8230; the parent will handle either event as distinct things to respond to. the parent cannot assume either of them firing first or second, or having them fired only once. the parent has to be able to respond to any number of either event as they occur. the good news is that it is far easier to code like this than to assume or expect a certain order for the events.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis Doomen</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-654</link>
		<dc:creator>Dennis Doomen</dc:creator>
		<pubDate>Wed, 17 Mar 2010 15:48:13 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-654</guid>
		<description>What about using the Null Pattern. You surely need the the rest of the product&#039;s info as well. So maybe you can add a public readonly property called Null that returns a special instance of your view model that represents &#039;nothing selected&#039;. </description>
		<content:encoded><![CDATA[<p>What about using the Null Pattern. You surely need the the rest of the product&#8217;s info as well. So maybe you can add a public readonly property called Null that returns a special instance of your view model that represents &#8216;nothing selected&#8217;. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Bloom</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-653</link>
		<dc:creator>Keith Bloom</dc:creator>
		<pubDate>Wed, 17 Mar 2010 15:34:38 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-653</guid>
		<description>An explicit event must be simpler, otherwise the selection event will be the selection event with a status to specify if it is a de-selection event, which doesn&#039;t sound good. 

I have recently read the GOF book and the patterns are running around in my head trying to find a place in some code.  I am curious to know if a Command object would work here which has the ability to undo the Command issued.  Do you know if this is a common use of the pattern?</description>
		<content:encoded><![CDATA[<p>An explicit event must be simpler, otherwise the selection event will be the selection event with a status to specify if it is a de-selection event, which doesn&#8217;t sound good. </p>
<p>I have recently read the GOF book and the patterns are running around in my head trying to find a place in some code.  I am curious to know if a Command object would work here which has the ability to undo the Command issued.  Do you know if this is a common use of the pattern?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-652</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Wed, 17 Mar 2010 15:14:25 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-652</guid>
		<description>I&#039;m leaning towards option #2 as well...but have you considered using the Null Object Pattern in your original scenario?</description>
		<content:encoded><![CDATA[<p>I&#8217;m leaning towards option #2 as well&#8230;but have you considered using the Null Object Pattern in your original scenario?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-651</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Wed, 17 Mar 2010 15:10:21 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-651</guid>
		<description>Try thinking about it from the parent side - what interface would you want.

Having two events leaves questions like do I get a deslect event before every select event, to indicate the deselection of the previous event.


I would go for a single event called Change. Then either in the event args or exposed as properties of the control (Sender),  you have the &quot;get selected item&quot; / &quot;is there a selected item&quot;  logic.





</description>
		<content:encoded><![CDATA[<p>Try thinking about it from the parent side &#8211; what interface would you want.</p>
<p>Having two events leaves questions like do I get a deslect event before every select event, to indicate the deselection of the previous event.</p>
<p>I would go for a single event called Change. Then either in the event args or exposed as properties of the control (Sender),  you have the &#8220;get selected item&#8221; / &#8220;is there a selected item&#8221;  logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Meckley</title>
		<link>http://lostechies.com/derickbailey/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events/#comment-650</link>
		<dc:creator>Jason Meckley</dc:creator>
		<pubDate>Wed, 17 Mar 2010 15:03:40 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#comment-650</guid>
		<description>I would go with option 2 as well. you already have event aggregation in place. separating the concerns of &quot;selected&quot; &amp; &quot;de-selected&quot; makes sense.</description>
		<content:encoded><![CDATA[<p>I would go with option 2 as well. you already have event aggregation in place. separating the concerns of &#8220;selected&#8221; &#038; &#8220;de-selected&#8221; makes sense.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
