<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.lostechies.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>new ThoughtStream("Derick Bailey"); - All Comments</title><link>http://www.lostechies.com/blogs/derickbailey/default.aspx</link><description>Question Everything. Especially Your Own Assumptions.</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75378</link><pubDate>Thu, 18 Mar 2010 04:28:28 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75378</guid><dc:creator>jOE</dc:creator><description>&lt;p&gt;1) Does the current solution work? &lt;/p&gt;
&lt;p&gt;2) Why not use full-text to find product codes? Drop downs are evil.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75378" width="1" height="1"&gt;</description></item><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75338</link><pubDate>Wed, 17 Mar 2010 18:16:59 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75338</guid><dc:creator>Diego</dc:creator><description>&lt;p&gt;I don&amp;#39;t have the same concern as you. Passing null back to the listener of the event is better approach. It&amp;#39;s safe in the language, it&amp;#39;s semantics really means &amp;quot;nothing&amp;quot;, it&amp;#39;s easy &amp;nbsp;to check, it&amp;#39;s lightweight (costs an clean IntPtr).&lt;/p&gt;
&lt;p&gt;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 &amp;nbsp;than with empty object (null pattern).&lt;/p&gt;
&lt;p&gt;BUT, if still you&amp;#39;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#. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75338" width="1" height="1"&gt;</description></item><item><title>re: When Do You Specify Expected Parameters In Stub Methods?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/04/when-do-you-specify-expected-parameters-in-stub-methods.aspx#75337</link><pubDate>Wed, 17 Mar 2010 18:09:16 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75337</guid><dc:creator>Bill Sorensen</dc:creator><description>&lt;p&gt;I&amp;#39;d specify the argument but use a constant in this case.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75337" width="1" height="1"&gt;</description></item><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75335</link><pubDate>Wed, 17 Mar 2010 17:30:37 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75335</guid><dc:creator>derick.bailey</dc:creator><description>&lt;p&gt;@Dan, @Dennis,&lt;/p&gt;
&lt;p&gt;The null object pattern would be a better OO solution, but wouldn&amp;#39;t solve the modeling problem, which is the real problem that I&amp;#39;m trying to address. I do like the null object pattern, though. it solves a lot of OO problems.&lt;/p&gt;
&lt;p&gt;@Keith,&lt;/p&gt;
&lt;p&gt;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&amp;#39;t need an n-level undo and i&amp;#39;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. &lt;/p&gt;
&lt;p&gt;@rob,&lt;/p&gt;
&lt;p&gt;a single Change event would be a better option for #1. good suggestion on that one.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75335" width="1" height="1"&gt;</description></item><item><title>re: Semantic Code: Migrating From A Chatty Interface To A Simple One With A Data Transfer Object</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/15/semantic-code-migrating-from-a-chatty-interface-to-a-simple-one-with-a-data-transfer-object.aspx#75330</link><pubDate>Wed, 17 Mar 2010 16:10:36 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75330</guid><dc:creator>Szilard Birkas</dc:creator><description>&lt;p&gt;As I see the original interface would have based on Command Pattern, sg similar:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;interface ICommand { void Run(); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp;interface IMyCommand: ICommand &lt;/p&gt;
&lt;p&gt; &amp;nbsp;{ &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; string InputValueX{ get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; string OutputParameterX { get; private set; } &amp;nbsp; &lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;If this command pattern would be used in a system in a good way, then it is ok.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75330" width="1" height="1"&gt;</description></item><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75325</link><pubDate>Wed, 17 Mar 2010 15:48:13 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75325</guid><dc:creator>Dennis Doomen</dc:creator><description>&lt;p&gt;What about using the Null Pattern. You surely need the the rest of the product&amp;#39;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 &amp;#39;nothing selected&amp;#39;. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75325" width="1" height="1"&gt;</description></item><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75324</link><pubDate>Wed, 17 Mar 2010 15:34:38 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75324</guid><dc:creator>Keith Bloom</dc:creator><description>&lt;p&gt;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&amp;#39;t sound good. &lt;/p&gt;
&lt;p&gt;I have recently read the GOF book and the patterns are running around in my head trying to find a place in some code. &amp;nbsp;I am curious to know if a Command object would work here which has the ability to undo the Command issued. &amp;nbsp;Do you know if this is a common use of the pattern?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75324" width="1" height="1"&gt;</description></item><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75323</link><pubDate>Wed, 17 Mar 2010 15:14:25 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75323</guid><dc:creator>Dan</dc:creator><description>&lt;p&gt;I&amp;#39;m leaning towards option #2 as well...but have you considered using the Null Object Pattern in your original scenario?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75323" width="1" height="1"&gt;</description></item><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75322</link><pubDate>Wed, 17 Mar 2010 15:10:21 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75322</guid><dc:creator>Rob</dc:creator><description>&lt;p&gt;Try thinking about it from the parent side - what interface would you want.&lt;/p&gt;
&lt;p&gt;Having two events leaves questions like do I get a deslect event before every select event, to indicate the deselection of the previous event.&lt;/p&gt;
&lt;p&gt;I would go for a single event called Change. Then either in the event args or exposed as properties of the control (Sender), &amp;nbsp;you have the &amp;quot;get selected item&amp;quot; / &amp;quot;is there a selected item&amp;quot; &amp;nbsp;logic.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75322" width="1" height="1"&gt;</description></item><item><title>re: Application Events: Modeling Selection vs De-Selection as Separate Events?</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/17/application-events-modeling-selection-vs-de-selection-as-separate-events.aspx#75321</link><pubDate>Wed, 17 Mar 2010 15:03:40 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75321</guid><dc:creator>Jason Meckley</dc:creator><description>&lt;p&gt;I would go with option 2 as well. you already have event aggregation in place. separating the concerns of &amp;quot;selected&amp;quot; &amp;amp; &amp;quot;de-selected&amp;quot; makes sense.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75321" width="1" height="1"&gt;</description></item><item><title>Side Projects, Community Involvement, Etc.</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/01/20/my-decoupling-workflow-presentation-was-accepted-for-lssc10.aspx#75247</link><pubDate>Tue, 16 Mar 2010 16:03:40 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75247</guid><dc:creator>new ThoughtStream("Derick Bailey");</dc:creator><description>&lt;p&gt;There was some interesting discussion amongst LosTechies members recently, and one of the things that&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75247" width="1" height="1"&gt;</description></item><item><title>DotNET News </title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/15/a-type-safe-idatareader-wrapper.aspx#75243</link><pubDate>Tue, 16 Mar 2010 15:10:52 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75243</guid><dc:creator>DotNET News </dc:creator><description>&lt;p&gt;DotNET News&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75243" width="1" height="1"&gt;</description></item><item><title>DotNET News </title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/15/semantic-code-migrating-from-a-chatty-interface-to-a-simple-one-with-a-data-transfer-object.aspx#75242</link><pubDate>Tue, 16 Mar 2010 15:10:50 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75242</guid><dc:creator>DotNET News </dc:creator><description>&lt;p&gt;DotNET News&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75242" width="1" height="1"&gt;</description></item><item><title>re: A Type Safe IDataReader Wrapper</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/15/a-type-safe-idatareader-wrapper.aspx#75238</link><pubDate>Tue, 16 Mar 2010 14:48:46 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75238</guid><dc:creator>Jason </dc:creator><description>&lt;p&gt;I posted something similar on my blog just a few months ago ... its an extension method and also deals with nullables. &lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// Get the value of a table column from a reader object&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;typeparam name=&amp;quot;T&amp;quot;&amp;gt;Type &amp;nbsp;of expected return value&amp;lt;/typeparam&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;param name=&amp;quot;reader&amp;quot;&amp;gt;Reader oject to get the value from&amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;param name=&amp;quot;columnName&amp;quot;&amp;gt;Name of column to retrieve the value from&amp;lt;/param&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;returns&amp;gt;Column Value&amp;lt;/returns&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;exception cref=&amp;quot;NullReferenceException&amp;quot;&amp;gt;If T is not nullable and the column value is null&amp;lt;/exception&amp;gt;&lt;/p&gt;
&lt;p&gt;public static T GetColumnValue&amp;lt;T&amp;gt;(this IDataReader reader, string columnName)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (reader.IsDBNull(reader.GetOrdinal(columnName)))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (typeof(T).IsGenericType &amp;amp;&amp;amp; typeof(T).GetGenericTypeDefinition() == typeof(Nullable&amp;lt;&amp;gt;))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; || typeof(T) == typeof(string)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return default(T);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else throw new NullReferenceException(&amp;quot;DB Value is null&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; else return (T)reader[columnName];&lt;/p&gt;
&lt;p&gt; }&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75238" width="1" height="1"&gt;</description></item><item><title>re: A Type Safe IDataReader Wrapper</title><link>http://www.lostechies.com/blogs/derickbailey/archive/2010/03/15/a-type-safe-idatareader-wrapper.aspx#75232</link><pubDate>Tue, 16 Mar 2010 13:16:06 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:75232</guid><dc:creator>derick.bailey</dc:creator><description>&lt;p&gt;@travis,&lt;/p&gt;
&lt;p&gt;we have something similar to fluent ado... not quite as full featured, but it suits our needs quite nicely. &lt;/p&gt;
&lt;p&gt;@steve,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not trying to encapsulate the the data reader, entirely - that&amp;#39;s why i&amp;#39;m not implementing IDataReader for this object. I&amp;#39;m going to convert this to extension methods, too, as @jeff suggested.&lt;/p&gt;
&lt;p&gt;i like the caching idea for the name lookups! that will definitely help for large data sets (which we have)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=75232" width="1" height="1"&gt;</description></item></channel></rss>