<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Krzysztof Cwalina : General API Design</title><link>http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx</link><description>Tags: General API Design</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Extensible Framework Design Studio Released</title><link>http://blogs.msdn.com/kcwalina/archive/2008/08/30/8910353.aspx</link><pubDate>Sat, 30 Aug 2008 20:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8910353</guid><dc:creator>kcwalina</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/8910353.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=8910353</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=8910353</wfw:comment><description>&lt;P&gt;This summer we had a high school intern, Nick Moloney, who worked on incorporating &lt;A class="" href="http://blogs.msdn.com/kcwalina/archive/2008/04/25/MEF.aspx" mce_href="http://blogs.msdn.com/kcwalina/archive/2008/04/25/MEF.aspx"&gt;MEF&lt;/A&gt; into &lt;A class="" href="http://blogs.msdn.com/kcwalina/archive/2008/04/04/8357773.aspx" mce_href="http://blogs.msdn.com/kcwalina/archive/2008/04/04/8357773.aspx"&gt;FDS&lt;/A&gt;. The fruits of his labor are now on code gallery. You can download the extensible FDS &lt;A class="" href="http://code.msdn.microsoft.com/fds" mce_href="http://code.msdn.microsoft.com/fds"&gt;here&lt;/A&gt;. Congratulations to Nick!&lt;/P&gt;
&lt;P&gt;The current release has just a few extensibility points, but you should expect&amp;nbsp;more in the future.&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8910353" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/MEF/default.aspx">MEF</category></item><item><title>API Design Myth: Exceptions are for "Exceptional Errors"</title><link>http://blogs.msdn.com/kcwalina/archive/2008/07/17/ExceptionalError.aspx</link><pubDate>Thu, 17 Jul 2008 23:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8744883</guid><dc:creator>kcwalina</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/8744883.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=8744883</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=8744883</wfw:comment><description>&lt;P&gt;I was updating FDG section on exceptions. I added one anntation that I thought I would post here as well:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;
&lt;TABLE class=MsoNormalTable style="MARGIN: auto auto auto 9pt; BORDER-COLLAPSE: collapse; mso-table-layout-alt: fixed; mso-padding-alt: 9.0pt 9.0pt 9.0pt 9.0pt" cellSpacing=0 cellPadding=0 border=0 class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 80pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: black 3pt solid; PADDING-RIGHT: 9pt; BORDER-TOP: black 3pt solid; PADDING-LEFT: 9pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 9pt; BORDER-LEFT: black 3pt solid; WIDTH: 423pt; PADDING-TOP: 9pt; BORDER-BOTTOM: black 3pt solid; HEIGHT: 80pt; mso-shading: windowtext; mso-pattern: solid #E6E6E6" vAlign=top width=564&gt;
&lt;P class=AnnotationHead style="MARGIN: 6pt 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-no-proof: yes; mso-font-width: 100%"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"&gt;&lt;/v:path&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:lock v:ext="edit" aspectratio="t"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;v:shape id=Picture_x0020_12 style="VISIBILITY: visible; WIDTH: 12.75pt; HEIGHT: 8.25pt; mso-wrap-style: square" type="#_x0000_t75" o:spid="_x0000_i1025"&gt;&lt;v:imagedata mce_src="file:///C:\Users\KRZYSZ~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.wmz" o:title="" src="file:///C:\Users\KRZYSZ~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.wmz"&gt;&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-font-width: 100%"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=AnnotationHead style="MARGIN: 6pt 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-font-width: 100%"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;KRZYSZTOF CWALINA&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=AnnotationBody style="MARGIN: 9pt 0in 12pt"&gt;&lt;SPAN style="mso-font-width: 100%"&gt;&lt;FONT face=Batang&gt;One of the biggest misconceptions about exceptions is that they are for “exceptional conditions.” The reality is that they are for communicating &lt;U&gt;error&lt;/U&gt; conditions. From a framework design perspective, there is no such thing as an “exceptional condition”. Whether a condition is exceptional or not depends on the context of usage, --- but reusable libraries rarely know how they will be used. For example, OutOfMemoryException might be exceptional for a simple data entry application; it’s not so exceptional for applications doing their own memory management (e.g. SQL server). In other words, one man’s exceptional condition is another man’s chronic condition.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8744883" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item><item><title>Nullable&lt;T&gt; Usage Guidelines</title><link>http://blogs.msdn.com/kcwalina/archive/2008/07/16/Nullable.aspx</link><pubDate>Wed, 16 Jul 2008 23:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8740209</guid><dc:creator>kcwalina</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/8740209.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=8740209</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=8740209</wfw:comment><description>&lt;H2 style="MARGIN: 12pt 0in 6pt"&gt;&lt;A class="" name=_Toc33351794&gt;&lt;/A&gt;&lt;FONT face=Verdana color=#808080&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/H2&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;These guidelines were just added as part of an update to the Framework Design Guidelines book (&lt;A class="" href="http://blogs.msdn.com/kcwalina/archive/2008/01/03/FrameworkDesignGuidelines2ndEdition.aspx" mce_href="http://blogs.msdn.com/kcwalina/archive/2008/01/03/FrameworkDesignGuidelines2ndEdition.aspx"&gt;upcomming 2nd edition&lt;/A&gt;). Hope you find them useful.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;Nullable&amp;lt;T&amp;gt; is a simple type added to the .NET Framework 2.0. The type was designed to be able to represent Value Types with “null” values. &lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;Nullable&amp;lt;int&amp;gt; x = null;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;Nullable&amp;lt;int&amp;gt; y = 5;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;Console.WriteLine(x == null); // prints true&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;Console.WriteLine(y == null); // prints false&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;Note that C# provides special support for Nullable&amp;lt;T&amp;gt; in the form of language aliases for Nullable types, lifted operators, and the new coalescing operator. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;int? x = null; // &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;long? d = x; // calls cast operator from Int32 to Int64&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;Console.WriteLine(d??10); // coalescing; prints 10 because d == null&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=checkbox&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #00b050; FONT-FAMILY: Wingdings"&gt;þ&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-size: 10.0pt"&gt;CONSIDER&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt; using Nullable&amp;lt;T&amp;gt;&lt;I&gt; &lt;/I&gt;to represent values that might not be present (i.e. optional values). For example, use it when returning a strongly typed record from a database with a property representing an optional table column.&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: red; FONT-FAMILY: Wingdings; mso-bidi-font-size: 10.0pt"&gt;ý&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: red; mso-bidi-font-size: 10.0pt"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-size: 10.0pt"&gt;Do NOT&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;use Nullable&amp;lt;T&amp;gt; unless you would use a reference type in a similar manner, taking advantage of the fact that reference type values can be null.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;For example, you would not use null to represent optional parameters.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// bad design&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Foo {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp; public Foo(string name, int? id);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;} &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// good design&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Foo {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp; public Foo(string name, int id); &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp; public Foo(string name);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;} &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: red; FONT-FAMILY: Wingdings; mso-bidi-font-size: 10.0pt"&gt;ý&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: red; mso-bidi-font-size: 10.0pt"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-size: 10.0pt"&gt;AVOID&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;using Nullable&amp;lt;bool&amp;gt; to represent a general three-state value. &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;Nullable&amp;lt;bool&amp;gt; should only be used to represent truly optional Boolean values: true, false, and not available. If you simply want to represent three states (e.g. yes, no, cancel), consider using an enum.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Courier"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: red; FONT-FAMILY: Wingdings; mso-bidi-font-size: 10.0pt"&gt;ý&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: red; mso-bidi-font-size: 10.0pt"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;B&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-size: 10.0pt"&gt;AVOID&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;using System.DBNull. Prefer Nullable&amp;lt;T&amp;gt; instead. &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #e9fdf3; PADDING-BOTTOM: 1pt; MARGIN-LEFT: 12.25pt; BORDER-LEFT: windowtext 1pt solid; MARGIN-RIGHT: 0in; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt"&gt;
&lt;P class=note style="BACKGROUND: #e9fdf3; MARGIN: 6pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;EM&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;Nullable&amp;lt;T&amp;gt; is in general a better representation of optional database values. One thing to consider though it that while Nullable&amp;lt;T&amp;gt; gives you the ability to represent null values, you don’t get database null operational semantics. Specifically, you don’t get null propagation through operators and functions. If you deeply care about the propagation semantics, consider sticking with DBNull.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8740209" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item><item><title>Framework Design Guidelines Digest v2</title><link>http://blogs.msdn.com/kcwalina/archive/2008/04/09/FDGDigest.aspx</link><pubDate>Thu, 10 Apr 2008 00:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8373327</guid><dc:creator>kcwalina</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/8373327.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=8373327</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=8373327</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Almost 4 years ago, I &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/kcwalina/archive/2004/09/28/235232.aspx"&gt;&lt;FONT face=Calibri size=3&gt;blogged about Framework Design Guidelines Digest&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;. At that time, my blog engine did not support attaching files and I did not have a convenient online storage to put the document on, and so I asked people to email me if they want an offline copy. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Believe it or not, I still receive 1-2 emails a week with requests for the offline copy. Now that I have a convenient way to put the document online, and the fact that I wanted to make some small updates, I would like to repost the digest. &lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;The abstract is below and the full document can be downloaded &lt;/FONT&gt;&lt;A href="http://code.msdn.microsoft.com/fds/Release/ProjectReleases.aspx?ReleaseId=873"&gt;&lt;FONT face=Calibri size=3&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-size: 11.0pt"&gt;This document is a distillation and a simplification of the most basic guidelines described in detail in a book titled Framework Design Guidelines by Krzysztof Cwalina and Brad Abrams. &lt;/SPAN&gt;&lt;/I&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-size: 11.0pt"&gt;Framework Design Guidelines were created in the early days of .NET Framework development. They started as a small set of naming and design conventions but have been enhanced, scrutinized, and refined to a point where they are generally considered the canonical way to design frameworks at Microsoft. They carry the experience and cumulative wisdom of thousands of developer hours over several versions of the .NET Framework.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8373327" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item><item><title>Framework Design Studio Released</title><link>http://blogs.msdn.com/kcwalina/archive/2008/04/04/8357773.aspx</link><pubDate>Fri, 04 Apr 2008 21:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8357773</guid><dc:creator>kcwalina</dc:creator><slash:comments>21</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/8357773.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=8357773</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=8357773</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;When I was coming back from Mix 2007, I was bored on the plane and so started to write a dev tool. What a geeky thing to do on a plane. :-)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The tool allows comparing two versions of an assembly to identify API differences: API additions and removals. Comparing versions of APIs comes very handy during API design process. Often you want to ensure that things did not get removed accidentally (which can cause incompatibilities), and as APIs grow, you want to review the addition without having to re-review APIs that were already reviewed. The tool, called Framework Design Studio (FDS) supports these scenarios. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Later on, I got lots of help from Hongping Lim (a developer on our team), and David Fowler (our 2007 summer intern). David ported the application to WPF, and Hongping basically took it from an early prototype stage to what it is today and made it possible to ship it externally.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Anyway, you can get the tool at the MSDN &lt;/FONT&gt;&lt;A href="http://code.msdn.microsoft.com/fds"&gt;&lt;FONT face=Calibri size=3&gt;Code Gallery&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;, the user guide is attached to this post, and lastly, here is the API diff output that the tool generates. Hope you find it useful.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;IMG title=FDS style="WIDTH: 956px; HEIGHT: 543px" height=543 alt=FDS hspace=2 src="http://farm3.static.flickr.com/2402/2387235355_6c8c8f3565_o_d.jpg" width=956 align=absMiddle vspace=2 border=2 mce_src="http://farm3.static.flickr.com/2402/2387235355_6c8c8f3565_o_d.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8357773" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/kcwalina/attachment/8357773.ashx" length="393197" type="application/vnd.openxmlformats-officedocument.word" /><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+Programming/default.aspx">General Programming</category></item><item><title>Simulated Covariance for .NET Generics</title><link>http://blogs.msdn.com/kcwalina/archive/2008/04/02/SimulatedCovariance.aspx</link><pubDate>Wed, 02 Apr 2008 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8348605</guid><dc:creator>kcwalina</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/8348605.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=8348605</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=8348605</wfw:comment><description>&lt;H2 style="MARGIN: 12pt 0in 6pt 0.4in; mso-list: none"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#943634 size=3&gt;I&amp;nbsp;just&amp;nbsp;wrote this pattern,&amp;nbsp;but I am not sure if I should add it&amp;nbsp;officially to the Framework Design Guidelines. It seems like a bit of a corner case scenario, though I do get questions about it from time to time. Anyway, let me know what you think.&lt;/FONT&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;Different constructed types don’t have a common root type. For example, there would not be a common representation of IEnumerable&amp;lt;string&amp;gt; and IEnumerable&amp;lt;object&amp;gt; if not for a pattern implemented by IEnumerable&amp;lt;T&amp;gt; called &lt;I style="mso-bidi-font-style: normal"&gt;Simulated Covariance&lt;/I&gt;. This post describes the details of the pattern.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;Generics is a very powerful type system feature added to the .NET Framework 2.0. It allows creation of so called parameterized types. For example, List&amp;lt;T&amp;gt; is such a type and it represents a list of objects of type T. The T is specified at the time when the instance of the list is created. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;List&amp;lt;string&amp;gt; names = new List&amp;lt;string&amp;gt;();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;names.Add(“John Smith”);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;names.Add(“Mary Johnson”);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;Such Generic data structures have many benefits over their non-Generic counterparts. But they also have some, sometimes surprising, limitations. For example, some users expect that a List&amp;lt;string&amp;gt; can be cast to List&amp;lt;object&amp;gt;, just as a String can be cast to Object. But unfortunately, the following code won’t even compile.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;List&amp;lt;string&amp;gt; names = new List&amp;lt;string&amp;gt;();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;List&amp;lt;object&amp;gt; objects = names; // this won’t compile&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;There is a very good reason for this limitation, and that is to allow for full strong typing. For example, if you could cast List&amp;lt;string&amp;gt; to a List&amp;lt;object&amp;gt; the following incorrect code would compile, but the program would fail at runtime.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;static void Main(){&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;List&amp;lt;string&amp;gt; names = new List&amp;lt;string&amp;gt;();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// this of course does not compile, but if it did&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// the whole program would compile, but would be incorrect as it &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// attempts to add arbitrary objects to a list of strings.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;AddObjects((List&amp;lt;object&amp;gt;)names); &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;string name = names[0]; // how could this work? &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// this would (and does) compile just fine.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;static void AddObjects(List&amp;lt;object&amp;gt; list){&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;list.Add(new object()); // it’s a list of strings, really. Should we throw?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;list.Add(new Button());&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;} &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;Unfortunately this limitation can also be undesired in some scenarios. For example, there is nothing wrong with casting a List&amp;lt;string&amp;gt; to IEnumerable&amp;lt;object&amp;gt;, like in the following example.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;List&amp;lt;string&amp;gt; names = new List&amp;lt;string&amp;gt;();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;IEnumerable&amp;lt;object&amp;gt; objects = names; // this won’t compile&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;foreach(object obj in objects){&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(obj.ToString());&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;In general, having a way to represent “any list” (or in general “any instance of this generic type”) is very useful. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// what type should ??? be?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;static void PrintItems(??? anyList){&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;foreach(object obj in anyList){&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(obj.ToString());&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;Unfortunately, unless List&amp;lt;T&amp;gt; implemented a pattern that will be described in a moment, the only common representation of all List&amp;lt;T&amp;gt; instances would be System.Object. But System.Object is too limiting and would not allow PrintItems method to enumerate items in the list.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;The reason that casting to IEnumerable&amp;lt;object&amp;gt; is just fine, but casting to List&amp;lt;object&amp;gt; can cause all sorts of problems is that in case of IEnumerable&amp;lt;object&amp;gt;, the object appears only in the output position (the return type of GetEnumerator is IEnumerator&amp;lt;object&amp;gt;). In case of List&amp;lt;object&amp;gt;, the object represents both output and input types. For example, object is the type of the input to the Add method. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// T does not appear as input to any members or dependencies of this interface&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public interface IEnumerable&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;IEnumerator&amp;lt;T&amp;gt; GetEnumerator(); &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public interface IEnumerator&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;T Current { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;bool MoveNext();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;} &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;// T does appear as input to members of List&amp;lt;T&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class List&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public void Add(T item); // T is an input here&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T this[int index]{&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;get; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;set; // T is actually an input here&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;In other words, we say that in IEnumerable&amp;lt;T&amp;gt;, the T is at covariant positions (outputs). In List&amp;lt;T&amp;gt;, the T is at covariant and contravariant (inputs) positions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;To solve the problem of not having a common type representing the root of all constructions of a generic type, you can implement what’s called the &lt;I style="mso-bidi-font-style: normal"&gt;Simulated Covariance Pattern&lt;/I&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Given a generic type (class or interface) and its dependencies&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Foo&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property1 { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property2 { set; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property3 { get; set; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public void Method1(T arg1);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public T Method2();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Method3(T arg);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public Type1&amp;lt;T&amp;gt; GetMethod1(); &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public Type2&amp;lt;T&amp;gt; GetMethod2();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Type1&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Type2&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property { get; set; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Create a new interface (&lt;I style="mso-bidi-font-style: normal"&gt;Root Type&lt;/I&gt;) with all members containing Ts at contravariant positions removed. In addition, feel free to remove all members that might not make sense in the context of the trimmed down type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public interface IFoo&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;T Property1 { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;T Property3 { get; } // setter removed&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;T Method2();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Type1&amp;lt;T&amp;gt; GetMethod1();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;IType2&amp;lt;T&amp;gt; GetMethod2(); // note that the return type changed&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public interface IType2&amp;lt;T&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;T Property { get; } // setter removed&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;The generic type should then implement the interface explicitly and “add back” the strongly typed members (using T instead of object) to its public API surface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Foo&amp;lt;T&amp;gt; : IFoo&amp;lt;object&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property1 { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property2 { set; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property3 { get; set;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public void Method1(T arg1);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Method2();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Method3(T arg);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public Type1&amp;lt;T&amp;gt; GetMethod1();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public Type2&amp;lt;T&amp;gt; GetMethod2();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;object IFoo&amp;lt;object&amp;gt;.Property1 { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;object IFoo&amp;lt;object&amp;gt;.Property3 { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;object IFoo&amp;lt;object&amp;gt;.Method2() { return null; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Type1&amp;lt;object&amp;gt; IFoo&amp;lt;object&amp;gt;.GetMethod1();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;IType2&amp;lt;object&amp;gt; IFoo&amp;lt;object&amp;gt;.GetMethod2();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Type2&amp;lt;T&amp;gt; : IType2&amp;lt;object&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property { get; set; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;object IType2&amp;lt;object&amp;gt;.Property { get; }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Now, all constructed instantiation of Foo&amp;lt;T&amp;gt; have a common root type IFoo&amp;lt;object&amp;gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;var foos = new List&amp;lt;IFoo&amp;lt;object&amp;gt;&amp;gt;();&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;foos.Add(new Foo&amp;lt;int&amp;gt;());&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;foos.Add(new Foo&amp;lt;string&amp;gt;());&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;…&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;foreach(IFoo&amp;lt;object&amp;gt; foo in foos){&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(foo.Property1);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(foo.GetMethod2().Property);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=checkbox&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #00b050; FONT-FAMILY: Wingdings; mso-bidi-font-family: ZapfDingbats; mso-ascii-font-family: ZapfDingbats; mso-hansi-font-family: ZapfDingbats; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-bidi-font-size: 16.0pt"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;þ&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-family: MetaBlack-Roman"&gt;CONSIDER&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt; using the &lt;I style="mso-bidi-font-style: normal"&gt;Simulated Covariance Pattern&lt;/I&gt;, if there is a need to have a representation for all instantiations of a generic type&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 0in 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;The pattern should not be used frivolously as it results in additional types in the library and can makes the existing types more complex.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 0in 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face=Verdana&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=checkbox&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #00b050; FONT-FAMILY: Wingdings; mso-bidi-font-family: ZapfDingbats; mso-ascii-font-family: ZapfDingbats; mso-hansi-font-family: ZapfDingbats; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-bidi-font-size: 16.0pt"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;þ&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-family: MetaBlack-Roman"&gt;DO&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt; ensure that the implementation of the root’s members is equivalent to the implementation of the corresponding generic type members. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 0in 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt;&lt;FONT face=Verdana&gt;There should not be an observable difference between calling a member on the root type and calling the corresponding member on the generic type. In many cases the members of the root are implemented by calling members on the generic type.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;public class Foo&amp;lt;T&amp;gt; : IFoo&amp;lt;object&amp;gt; {&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public T Property3 { get { ... } set { ... } }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;object IFoo&amp;lt;object&amp;gt;.Property3 { get { return Property3; } }&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;…&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt 0.25in"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;FONT face="Courier New"&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 0in 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 0in 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=checkbox&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #00b050; FONT-FAMILY: Wingdings; mso-bidi-font-family: ZapfDingbats; mso-ascii-font-family: ZapfDingbats; mso-hansi-font-family: ZapfDingbats; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-bidi-font-size: 16.0pt"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;þ&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN class=DO1&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-family: MetaBlack-Roman"&gt;CONSIDER&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt; using an abstract class instead of an interface to represent the root. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt"&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="mso-bookmark: _Toc33351794"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt;This might sometimes be a better option as interfaces are more difficult to evolve (see section X). On the other hand there are some problem with using abstract classes for the root. Abstract class members cannot be implemented explicitly and the subtypes need to use the &lt;I style="mso-bidi-font-style: normal"&gt;new&lt;/I&gt; modifier. This makes it tricky to implement the root’s members by delegating to the generic type members. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-language: HE"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 0in 0in 3pt 12.25pt; TEXT-INDENT: -12.25pt"&gt;&lt;SPAN class=checkbox&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #00b050; FONT-FAMILY: Wingdings; mso-bidi-font-family: ZapfDingbats; mso-ascii-font-family: ZapfDingbats; mso-hansi-font-family: ZapfDingbats; mso-char-type: symbol; mso-symbol-font-family: Wingdings; mso-bidi-font-size: 16.0pt"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;þ&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;&lt;SPAN style="FONT-SIZE: 11pt"&gt; &lt;/SPAN&gt;&lt;SPAN class=DO1&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="FONT-SIZE: 11pt; mso-bidi-font-family: MetaBlack-Roman"&gt;CONSIDER&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-language: HE"&gt; using a non-generic root type, if such type is already available. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt;&lt;FONT face=Verdana&gt;For example, List&amp;lt;T&amp;gt; implements IEnumerable for the purpose of simulating covariance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in 3pt 12.25pt"&gt;&lt;SPAN style="mso-bidi-language: HE"&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8348605" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/System.Collections/default.aspx">System.Collections</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item><item><title>Job Openings on the .NET Framework Core Team</title><link>http://blogs.msdn.com/kcwalina/archive/2008/03/14/8209671.aspx</link><pubDate>Fri, 14 Mar 2008 22:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8209671</guid><dc:creator>kcwalina</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/8209671.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=8209671</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=8209671</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;We have been incubating ideas about building a simple extensibility framework for some time. Now, as plans for the next version of the .NET Framework crystallize a bit more, we decided to productize the project. As a result, we have opened a job position (and most probably will be opening more) on the .NET Framework team. If you are interested, please see details &lt;/FONT&gt;&lt;A href="http://members.microsoft.com/careers/search/details.aspx?JobID=508DA780-65F1-480C-B831-F72A0FAA91E9&amp;amp;start=1&amp;amp;interval=10&amp;amp;SortCol=DatePosted"&gt;&lt;FONT face=Calibri size=3&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; and send me an email at “kcwalina at microsoft.com.”&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;So, what is this extensibility framework? Initially, it will be a low level core .NET Framework feature to make it easy for applications to expose extensibility points and consume extensions. Think about what for example FxCop has to do define rule contracts and load rule implemented by the community&lt;B&gt;&lt;I&gt;&lt;SPAN style="COLOR: #943634"&gt;. &lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;These are the basics, and we can talk about the broader and longer term vision when you come to Redmond for an interview :-)&lt;B&gt;&lt;I&gt;&lt;SPAN style="COLOR: #943634"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #943634"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;This is a technical Program Manager position&lt;B&gt;&lt;I&gt; &lt;/I&gt;&lt;/B&gt;in Redmond, WA, and it’s basically exactly the job I did when I joined Microsoft. Besides working on the Framework features, all Program Managers on the core team have opportunities to work on API design and architecture projects.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8209671" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+Programming/default.aspx">General Programming</category></item><item><title>Video Recording of "Framework Engineering: Architecting, Designing, and Developing Reusable Libraries"</title><link>http://blogs.msdn.com/kcwalina/archive/2008/01/08/FrameworkEngineering.aspx</link><pubDate>Tue, 08 Jan 2008 21:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7031258</guid><dc:creator>kcwalina</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/7031258.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=7031258</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=7031258</wfw:comment><description>&lt;SPAN style="COLOR: #0070c0; FONT-FAMILY: 'Arial Narrow','sans-serif'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;FONT color=#000000&gt;I just&amp;nbsp;received&amp;nbsp;a video recording of a talk I did at the last TechEd. You can find the abstract below, and the WMV file can be downloaded from &lt;/FONT&gt;&lt;A href="http://download.microsoft.com/download/b/d/1/bd133733-9647-445f-bc06-238ae9c0dd48/FrameworkEngineering.wmv" mce_href="http://download.microsoft.com/download/b/d/1/bd133733-9647-445f-bc06-238ae9c0dd48/FrameworkEngineering.wmv"&gt;here&lt;/A&gt;&lt;FONT color=#000000&gt;. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;FONT color=#000000&gt;Hope you find it useful.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;FONT color=#000000&gt;[UPDATE: I attched the slides in xps format. The ppt file is 10x larger]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #0070c0; FONT-FAMILY: 'Arial Narrow','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;EM&gt;Framework Engineering: Architecting, Designing, and Developing Reusable Libraries&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #0070c0; FONT-FAMILY: 'Arial Narrow','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;EM&gt;This session covers the main aspects of reusable library design: API design, architecture, and general framework engineering processes. Well-designed APIs are critical to the success of reusable libraries, but there are other aspects of framework development that are equally important, yet not widely covered in literature. Organizations creating reusable libraries often struggle with the process of managing dependencies, compatibility, and other design processes so critical to the success of modern frameworks. Come to this session and learn about how Microsoft creates its frameworks. The session is based on experiences from the development of the .NET Framework and Silverlight, and will cover processes Microsoft uses in the development of managed frameworks.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7031258" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/kcwalina/attachment/7031258.ashx" length="1315748" type="application/vnd.ms-xpsdocument" /><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+Programming/default.aspx">General Programming</category></item><item><title>Framework Design Guidelines 2nd Edition</title><link>http://blogs.msdn.com/kcwalina/archive/2008/01/03/FrameworkDesignGuidelines2ndEdition.aspx</link><pubDate>Fri, 04 Jan 2008 01:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6972782</guid><dc:creator>kcwalina</dc:creator><slash:comments>35</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/6972782.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=6972782</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=6972782</wfw:comment><description>&lt;P&gt;My blog was &lt;SPAN lang=EN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;relatively &lt;/SPAN&gt;silent for several weeks. First, I was traveling to Europe for the TechEd, then was busy at work, then the holiday break. It's time to go back to more regular posting. &lt;/P&gt;
&lt;P&gt;I will start with an announcement (or at least a more formal and broader announcement): after my TechEd presentation, the first question I got from the audience was whether we are working on&amp;nbsp;a new edition of the Framework Design Guidelines. The answer is "yes", which I am super excited about. Right before the conference, we signed formal documents with the publisher and&amp;nbsp;started wortking on the book. It's going to cover the new&amp;nbsp;features in the .NET Framework 3.0, 3.5, and new advances in languages (e.g. LINQ) that are &lt;SPAN lang=EN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;relevant &lt;/SPAN&gt;to&amp;nbsp;Framework design.&amp;nbsp;BTW, I would appreciate feedback on what specifically you would like to get covered or clarified.&lt;/P&gt;
&lt;P&gt;We are shooting to have the book ready around the end of 2008, but the publisher already sent me a draft of the cover art:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://farm3.static.flickr.com/2117/2178655346_e7a2e0f59e_d.jpg" mce_src="http://farm3.static.flickr.com/2117/2178655346_e7a2e0f59e_d.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6972782" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item><item><title>What Do Swimmers Have to Say About Framework Design?</title><link>http://blogs.msdn.com/kcwalina/archive/2007/10/04/TechEdBarcelona.aspx</link><pubDate>Fri, 05 Oct 2007 03:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5280111</guid><dc:creator>kcwalina</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/5280111.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=5280111</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=5280111</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I am starting to feel pressure to finish up slides for my presentation at the upcoming TechEd in Barcelona. I will be talking about framework architecture and design. Here is the abstract I took from the &lt;/FONT&gt;&lt;A href="http://www.mseventseurope.com/teched/07/developers/content/Pages/Default.aspx"&gt;&lt;FONT face=Calibri size=3&gt;conference’s site&lt;/FONT&gt;&lt;/A&gt;:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #0070c0; FONT-FAMILY: 'Arial Narrow','sans-serif'"&gt;&lt;FONT size=3&gt;WIN304 Framework Engineering: Architecting, Designing, and Developing Reusable Libraries&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: #0070c0; FONT-FAMILY: 'Arial Narrow','sans-serif'"&gt;&lt;FONT size=3&gt;This session covers the main aspects of reusable library design: API design, architecture, and general framework engineering processes. Well-designed APIs are critical to the success of reusable libraries, but there are other aspects of framework development that are equally important, yet not widely covered in literature. Organizations creating reusable libraries often struggle with the process of managing dependencies, compatibility, and other design processes so critical to the success of modern frameworks. Come to this session and learn about how Microsoft creates its frameworks. The session is based on experiences from the development of the .NET Framework and Silverlight, and will cover processes Microsoft uses in the development of managed frameworks.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I am super excited about the talk, which I want to make into a continuation to the API design pre-con I did with &lt;A class="" href="http://blogs.msdn.com/brada" mce_href="http://blogs.msdn.com/brada"&gt;Brad Abrams&lt;/A&gt; at the last PDC (BTW, the same content is available &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/kcwalina/archive/2007/03/29/1989896.aspx"&gt;&lt;FONT face=Calibri size=3&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;). The PDC talk was about designing the API surface, but there is so much more to framework design!&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I am also excited coming back to the wonderful city of Barcelona. Last time I was there, believe it or not, I was on the Polish swimming team competing in the Olympics (&lt;/FONT&gt;&lt;A href="http://en.wikipedia.org/wiki/Swimming_at_the_1992_Summer_Olympics_-_Men%27s_4_x_200_metre_freestyle_relay"&gt;&lt;FONT face=Calibri size=3&gt;see #13&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;). I hope this trip will bring back some memories from the other and completely different “career” I had in the past.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5280111" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+Programming/default.aspx">General Programming</category></item><item><title>China Trip</title><link>http://blogs.msdn.com/kcwalina/archive/2007/10/02/5246364.aspx</link><pubDate>Tue, 02 Oct 2007 21:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5246364</guid><dc:creator>kcwalina</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/5246364.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=5246364</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=5246364</wfw:comment><description>&lt;FONT face=Calibri&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;Sorry for not blogging for such a long time. First I was on a combined business/vacations trip to China and when I came back, I got involved in some intensive planning for the future releases of the platform. I will try to post something about software in the next couple of days.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;The trip to China was great. First day I taught a class on API design at the Microsoft center in Beijing and then my wife and I stayed for several days doing sightseeing, drinking the best &lt;/FONT&gt;&lt;A href="http://www.flickr.com/photos/krzysc/1283290852/in/set-72157601679531990/" mce_href="http://www.flickr.com/photos/krzysc/1283290852/in/set-72157601679531990/"&gt;&lt;FONT size=3&gt;tea&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; ever, and indulging ourselves in great &lt;/FONT&gt;&lt;A href="http://www.flickr.com/photos/krzysc/1283483672/in/set-72157601679531990/" mce_href="http://www.flickr.com/photos/krzysc/1283483672/in/set-72157601679531990/"&gt;&lt;FONT size=3&gt;food&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt; (complete photo documentary is &lt;/FONT&gt;&lt;A href="http://www.flickr.com/photos/krzysc/sets/72157601679531990/show/" mce_href="http://www.flickr.com/photos/krzysc/sets/72157601679531990/show/"&gt;&lt;FONT color=#0000ff size=3&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;). &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5246364" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item><item><title>FxCop Designers Honored with the Chairman's Award</title><link>http://blogs.msdn.com/kcwalina/archive/2007/07/03/EEAward.aspx</link><pubDate>Wed, 04 Jul 2007 02:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3677999</guid><dc:creator>kcwalina</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/3677999.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=3677999</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=3677999</wfw:comment><description>&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;
&lt;P class=MsoNormal style="MARGIN: 24pt 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Last week, during the annual Engineering Excellence week, several Microsoft engineers and managers involved in development of engineering tools and practices were presented with Engineering Excellence Awards. In addition, the principal designers of three static analysis tools were honored with so called “Engineering Excellence Chairman’s Award,” which is given for contributions that our chairman (Bill) considers especially important. The Chairman award was given twice in the history of Microsoft.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 24pt 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Mike Fanning, &lt;A class="" href="http://blogs.msdn.com/brada/" mce_href="http://blogs.msdn.com/brada/"&gt;Brad Abrams&lt;/A&gt;, and I received nice glass statuettes and a framed &lt;A class="" href="http://farm2.static.flickr.com/1273/709216423_8f7793a7c9_o_d.jpg" mce_href="http://farm2.static.flickr.com/1273/709216423_8f7793a7c9_o_d.jpg"&gt;letters&lt;/A&gt; from Bill and Jon (our VP responsible for EE). See pictures below. The letter says “The Engineering Excellence Chairman’s Award is the Microsoft’s highest award for engineering group employees worldwide.” &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 24pt 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;It’s extremely rewarding to receive something like that for what started as a hobby project on which we worked mainly in our free time (at least, before it was officially productized). I would like to thank Brad for being the “let’s do it now” person, pushing the whole effort of design guidelines and fxcop development, and Mike for his passion for quality and being the super-developer on the team.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 24pt 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;Of course, many others contributed to the success of fxcop. Once we gather all the names, we will post a new entry or update this one to thank everybody and record all the contributions for posterity. [UPDATE: Brad just posted&amp;nbsp;on this &lt;A class="" href="http://blogs.msdn.com/brada/archive/2007/07/05/fxcop-honored-with-chairman-s-award-for-engineering-excellence.aspx" mce_href="http://blogs.msdn.com/brada/archive/2007/07/05/fxcop-honored-with-chairman-s-award-for-engineering-excellence.aspx"&gt;here&lt;/A&gt;.]&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 24pt 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;IMG src="http://farm2.static.flickr.com/1425/710089160_e7ec30923e_o_d.jpg" mce_src="http://farm2.static.flickr.com/1425/710089160_e7ec30923e_o_d.jpg"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3677999" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+Programming/default.aspx">General Programming</category></item><item><title>Generic Methods as Casts</title><link>http://blogs.msdn.com/kcwalina/archive/2007/06/07/GenericMethodsAsCasts.aspx</link><pubDate>Thu, 07 Jun 2007 20:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3145835</guid><dc:creator>kcwalina</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/3145835.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=3145835</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=3145835</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0in"&gt;&lt;FONT face=Calibri size=3&gt;Somebody just asked me which of the following API design alternatives is better. They both do what we could call “casting.”&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face="Lucida Console"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;// Generic Method&lt;SPAN style="mso-bidi-font-size: 10.0pt"&gt; “Cast”&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-bidi-font-size: 10.0pt"&gt;var foo&lt;/SPAN&gt; = someInstance.SomeMethod&amp;lt;IFoo&amp;gt;();&lt;SPAN style="mso-bidi-font-size: 10.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Lucida Console"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;// Simple Cast&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-bidi-font-size: 10.0pt"&gt;var foo = (IFoo)&lt;/SPAN&gt;someInstance.SomeMethod();&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0in"&gt;&lt;FONT face=Calibri size=3&gt;The Generic method approach can potentially have two benefits. A constraint can tell users what the subset of valid casts is. For example, the following API will allow casts to a collection (a subtype of IEnumerable):&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;public TCollection SomeMethod&amp;lt;TCollection&amp;gt;() where TCollection:IEnumerable {&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;…&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;} &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0in"&gt;&lt;FONT face=Calibri size=3&gt;If the user calls this method and tries to “cast” the return value to let’s say an Int32, the compiler with complain. For example,&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;var int someInstance.SomeMethod&amp;lt;int&amp;gt;(); &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0in"&gt;&lt;FONT face=Calibri size=3&gt;… will generate the following error:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;The type 'int' must be convertible to 'System.Collections.IEnumerable' in order to use it as parameter 'TCollection' in the generic type or method 'SomeClass.SomeMethod&amp;lt;TCollection&amp;gt;()'&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0in"&gt;&lt;FONT face=Calibri size=3&gt;Secondly, the Generic method might do different things based on the type parameter. The method relying on a simple cast has now knowledge about the type the user will cast it’s return value to.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;public TCollection SomeMethod&amp;lt; TCollection &amp;gt;() &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;where TCollection:IEnumerable,new() {&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT face="Lucida Console"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;TCollection newCollection = new TCollection ();&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ArrayList newArray = newCollection as ArrayList;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if (newArray != null) newArray.Capacity = 0;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;return newCollection;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;}&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0in"&gt;&lt;FONT face=Calibri size=3&gt;If neither of these benefits applies in your case, I would use a simple cast. It’s more transparent in terms of what’s going on. The users of a generic method might wonder what kind of “magic” is being done with the generic type parameter. &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3145835" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+Programming/default.aspx">General Programming</category></item><item><title>Framework design lecture avaliable for download</title><link>http://blogs.msdn.com/kcwalina/archive/2007/06/01/FDGLecture.aspx</link><pubDate>Fri, 01 Jun 2007 23:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3029881</guid><dc:creator>kcwalina</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/3029881.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=3029881</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=3029881</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;I have good news for all who asked about an off line version of the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/kcwalina/archive/2007/03/29/1989896.aspx"&gt;&lt;FONT face=Calibri size=3&gt;API design lecture I blogged about a few weeks ago&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;. After literally a hundred emails and comments on the blog (thanks for pushing me to get this done), weeks of trying to get this setup, including the difficulty of finding a server to host a 500MB file, and -- ultimately getting some help from &lt;A class="" href="http://weblogs.asp.net/scottgu/" mce_href="http://weblogs.asp.net/scottgu/"&gt;Scott Guthrie&lt;/A&gt;&amp;nbsp;(thanks!), the zip file is finally available for download &lt;/FONT&gt;&lt;A href="http://download.microsoft.com/download/8/0/8/808412ec-2561-413d-a9e3-5cd47d37d763/FDGNetCast.zip"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;. Enjoy!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3029881" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item><item><title>Nullable&lt;bool&gt; usage guideline</title><link>http://blogs.msdn.com/kcwalina/archive/2007/04/27/NullableOfBool.aspx</link><pubDate>Fri, 27 Apr 2007 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2273538</guid><dc:creator>kcwalina</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/kcwalina/comments/2273538.aspx</comments><wfw:commentRss>http://blogs.msdn.com/kcwalina/commentrss.aspx?PostID=2273538</wfw:commentRss><wfw:comment>http://blogs.msdn.com/kcwalina/rsscomments.aspx?PostID=2273538</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0.25in"&gt;&lt;FONT face=Calibri size=3&gt;I am starting to work on some updates to the framework design guidelines related to new framework and language features added in .NET 2.0, 3.0, and 3.5. One of such additions are the nullable types (Nullable&amp;lt;T&amp;gt;). &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0.25in"&gt;&lt;FONT face=Calibri size=3&gt;Coincidentally, somebody asked me today whether they should use Nullable&amp;lt;bool&amp;gt;. Here is the question:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0.25in"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Q: Do the guidelines have anything to say about the use of nullable types in public API? Subject came up here in context of a proposal to return Nullable&amp;lt;bool&amp;gt; from a method to retrieve an attribute value (null means attribute not found, true means value retrieved, false means no value for existing attribute). &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0.25in"&gt;&lt;FONT face=Calibri size=3&gt;… and in the absence of formal guidelines, here is what I recommended:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 12pt 0.3in 3pt 0.25in"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;A: I would say that the rule of thumb is that you should use Nullable&amp;lt;bool&amp;gt;, if it’s obvious what all three values mean. For example, it there is an optional column in a database of type Boolean, it’s clear that true means true, false means false, and null means the value is not there. In your example, you had to explain what the values mean, so I would not recommend using nullable types.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2273538" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/kcwalina/archive/tags/Design+Guidelines/default.aspx">Design Guidelines</category><category domain="http://blogs.msdn.com/kcwalina/archive/tags/General+API+Design/default.aspx">General API Design</category></item></channel></rss>