<?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>Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx</link><description>(This is part one of a three-part series; part two is here .) If you've been in this business for any length of time you've undoubtedly seen some of the vast literature on "design patterns" -- you know, those standard solutions to common problems with</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10147846</link><pubDate>Wed, 30 Mar 2011 17:33:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10147846</guid><dc:creator>Ben Voigt</dc:creator><description>&lt;p&gt;@Peter, @Gabe: Why &amp;quot;C-flat&amp;quot; aka &amp;quot;B&amp;quot;? &amp;nbsp;Why not &amp;quot;C&amp;quot;? &amp;nbsp;It&amp;#39;s a surprisingly good fit, all things considered.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10147846" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10143245</link><pubDate>Fri, 18 Mar 2011 19:43:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10143245</guid><dc:creator>Scott B.</dc:creator><description>&lt;p&gt;This &amp;quot;explicit-this&amp;quot; stuff looks like &amp;quot;explicit-self&amp;quot; in Python :)&lt;/p&gt;
&lt;p&gt;For the sake of completeness, with:&lt;/p&gt;
&lt;p&gt;class Dog:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;def make_noise(self):&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return &amp;quot;yip&amp;quot;&lt;/p&gt;
&lt;p&gt;Calling &amp;quot;s = dog.make_noise()&amp;quot; is exactly equivalent to &amp;quot;s = Dog.make_noise(dog)&amp;quot;.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10143245" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142990</link><pubDate>Fri, 18 Mar 2011 10:41:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142990</guid><dc:creator>Alex Corrado</dc:creator><description>&lt;p&gt;Every time I put &amp;quot;virtual&amp;quot; before a method declaration I cringe at all the indirection. Thanks for reminding us that nothing is really magic.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142990" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142830</link><pubDate>Thu, 17 Mar 2011 22:43:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142830</guid><dc:creator>Peter</dc:creator><description>&lt;p&gt;@Gabe: That&amp;#39;s enharmonically equivalent to B, which is more than 40 years old (details are available at &lt;a rel="nofollow" target="_new" href="http://en.wikipedia.org/wiki/B_(programming_language)"&gt;en.wikipedia.org/.../B_(programming_language)&lt;/a&gt; for those who are unfamiliar with it). &amp;nbsp;More of a step backwards than I think Eric intended! &amp;nbsp;(See also &lt;a rel="nofollow" target="_new" href="http://en.wikipedia.org/wiki/Enharmonic"&gt;en.wikipedia.org/.../Enharmonic&lt;/a&gt;)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142830" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142736</link><pubDate>Thu, 17 Mar 2011 18:33:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142736</guid><dc:creator>Neal Gafter</dc:creator><description>&lt;p&gt;This implementation does not handle the Basenji.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142736" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142729</link><pubDate>Thu, 17 Mar 2011 18:20:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142729</guid><dc:creator>Keith J. Farmer</dc:creator><description>&lt;p&gt;The explicit-this implementation should be familiar to Pythonistas.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142729" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142704</link><pubDate>Thu, 17 Mar 2011 17:11:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142704</guid><dc:creator>Brian Hartung</dc:creator><description>&lt;p&gt;For anyone interested in an under-the-hood perspective, I think Chapter 5 of the Rotor Book (freely available on Joel Pobar&amp;#39;s blog: &lt;a rel="nofollow" target="_new" href="http://callvirt.net/blog/files/Shared%20Source%20CLI%202.0%20Internals.pdf"&gt;callvirt.net/.../Shared%20Source%20CLI%202.0%20Internals.pdf&lt;/a&gt;) does a nice job of explaining (at least the SSCLI&amp;#39;s implementation of) method dispatch all the way down to the level of the execution engine (stubs, generic resolvers, and slot maps, oh my!). &amp;nbsp;It includes shiny pictures and everything...(ok, there&amp;#39;s nothing shiny about the pictures, I was simply trying to appeal to the attention deficit crowd--plus I&amp;#39;m dumb as toast).&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142704" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142687</link><pubDate>Thu, 17 Mar 2011 16:38:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142687</guid><dc:creator>Joren</dc:creator><description>&lt;p&gt;Here&amp;#39;s hoping for a Part X: Interfaces somewhere in the future. :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142687" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142660</link><pubDate>Thu, 17 Mar 2011 15:21:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142660</guid><dc:creator>Aakash Mehendale</dc:creator><description>&lt;p&gt;Framework Design Guidelines-inspired nitpick: SoreThroat should be called HasSoreThroat :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142660" width="1" height="1"&gt;</description></item><item><title>re: Implementing the virtual method pattern in C#, Part One</title><link>http://blogs.msdn.com/b/ericlippert/archive/2011/03/17/implementing-the-virtual-method-pattern-in-c-part-one.aspx#10142656</link><pubDate>Thu, 17 Mar 2011 15:15:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10142656</guid><dc:creator>NickLarsen</dc:creator><description>&lt;p&gt;An aside from this, I just realized that extension methods are not as &amp;quot;broken&amp;quot; as I once thought, assuming they are guaranteed to make an unchecked call to a member of &amp;quot;_this&amp;quot; somewhere in their execution.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10142656" width="1" height="1"&gt;</description></item></channel></rss>