<?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>Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx</link><description>Continuing in our weekly blog post series that highlights a few of the new additions to the Framework Design Guidelines 2 nd edition .. This content is found in the Extensibility Mechanisms section of Chapter 6: Designing for Extensibility. It is interesting</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>infoblog &amp;raquo; Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9342061</link><pubDate>Tue, 20 Jan 2009 06:41:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9342061</guid><dc:creator>infoblog &amp;raquo; Framework Design Guidelines: Sealed Classes</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.a-foton.ru/index.php/2009/01/20/framework-design-guidelines-sealed-classes/"&gt;http://blog.a-foton.ru/index.php/2009/01/20/framework-design-guidelines-sealed-classes/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9345217</link><pubDate>Tue, 20 Jan 2009 13:11:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9345217</guid><dc:creator>daniel_lidstrom</dc:creator><description>&lt;p&gt;This looks dangerous to me. Unless OrdersQueue really IS-A MessageQueue, that is. In C++ at least, deriving from a concrete class should be private (my experience).&lt;/p&gt;
&lt;p&gt;Can't this be solved with extension methods instead? Convenience constructors can be provided with factory methods.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Daniel Lidstr&amp;#246;m&lt;/p&gt;
&lt;p&gt;Stockholm, Sweden&lt;/p&gt;
</description></item><item><title>re: Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9345504</link><pubDate>Tue, 20 Jan 2009 13:42:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9345504</guid><dc:creator>Rune Sundling</dc:creator><description>&lt;p&gt;Thank you for putting this in the guidelines! &lt;/p&gt;
&lt;p&gt;The often extreme focus Micrsoft has had on babysitting developers by sealing every class is a quite annoying practice. &lt;/p&gt;
</description></item><item><title>re: Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9347092</link><pubDate>Tue, 20 Jan 2009 16:54:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9347092</guid><dc:creator>Steve Dunn</dc:creator><description>&lt;p&gt;Leaving types unsealed is great, although I'm not sure about promoting the use of inheritance without first suggesting composition as a better alternative.&lt;/p&gt;
&lt;p&gt;Also, Phil's comment about making key members virtual and promoting the use of the Template Method pattern seems a tad dangerous; what are 'key members'? &amp;nbsp;Anything public? &amp;nbsp;Anything protected? &amp;nbsp;Surely the key members are specific to why you're deriving from the class in the first place? &amp;nbsp;I'd hate to see lots of abstract classes introduced into the Framework to facilitate the Template Method pattern.&lt;/p&gt;
</description></item><item><title>re: Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9355530</link><pubDate>Wed, 21 Jan 2009 09:56:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9355530</guid><dc:creator>AMO</dc:creator><description>&lt;p&gt;Interesting post. However, the title of the post gave me the expectation of providing a guideline on when to write sealed classes, not unsealed classes.&lt;/p&gt;
</description></item><item><title>re: Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9364347</link><pubDate>Thu, 22 Jan 2009 10:41:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9364347</guid><dc:creator>Sajida</dc:creator><description>&lt;p&gt;Dear Sir/ Madam,&lt;/p&gt;
&lt;p&gt;Based in UAE, I am currently employed as a Country Manager at PMDC( Property Management and Development Company).&lt;/p&gt;
&lt;p&gt;I have a total of 8 years experience in the property field and I believe that the skills I have acquired in the course of my professional and educational experience will be valuable assets for your organization.&lt;/p&gt;
&lt;p&gt;Attached are my contact details and detailed CV for your review. I would appreciate the opportunity to speak with a member of your organization and see the way to help and join you. Thank you very much for your consideration.&lt;/p&gt;
&lt;p&gt;Looking forward to your replay.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Sajida Ismail&lt;/p&gt;
&lt;p&gt;Dubai, Uae&lt;/p&gt;
&lt;p&gt;Tel: 00971- 5020-23087&lt;/p&gt;
&lt;p&gt;arwawail@hotmail.com&lt;/p&gt;
</description></item><item><title>Brad Abrams  : Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9372787</link><pubDate>Fri, 23 Jan 2009 18:51:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9372787</guid><dc:creator>DotNetShoutout</dc:creator><description>&lt;p&gt;Thank you for submitting this cool story - Trackback from DotNetShoutout&lt;/p&gt;
</description></item><item><title>re: Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9374728</link><pubDate>Sun, 25 Jan 2009 11:00:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9374728</guid><dc:creator>Dean Chalk</dc:creator><description>&lt;p&gt;On of the big issues with leaving classes un-sealed and members abstract or virtual is performance.&lt;/p&gt;
&lt;p&gt;The CLR will perform a special set of optimisations for a class if it's sealed to make it super-fast (the CLR doesnt have to worry about polymorphic access by super-classes). Also if a member's not virtual, the CLR can perform optimisations for it too.&lt;/p&gt;
&lt;p&gt;Classes should be sealed by default and then unsealed &amp;nbsp;by design.&lt;/p&gt;
&lt;p&gt;Static classes are particularly performant, because they are compiled as abstract and sealed, exposing on static members.&lt;/p&gt;
&lt;p&gt;Dean&lt;/p&gt;
</description></item><item><title>re: Framework Design Guidelines: Sealed Classes</title><link>http://blogs.msdn.com/brada/archive/2009/01/19/framework-design-guidelines-sealed-classes.aspx#9519854</link><pubDate>Mon, 30 Mar 2009 21:33:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9519854</guid><dc:creator>Jon Skeet</dc:creator><description>&lt;p&gt;Ick, no.&lt;/p&gt;
&lt;p&gt;I'm one of the crowd that think C# should seal classes by default. Inheritance is a powerful tool, but can be a pain if it's not thought about carefully. If you don't *design* for inheritance, you shouldn't *permit* it. Designing for inheritance is hard, and limits your implementation freedom later. Do you really want to document everywhere that the implementation calls a virtual method? You can't change your mind later - someone may be depending on that behaviour. (If you don't document it, they shouldn't depend on it but it becomes unexpected; if you *do* document it, you'd be breaking the contract.)&lt;/p&gt;
&lt;p&gt;If you want to be able to use a test double for a class, make it implement an interface and use the interface as the dependency.&lt;/p&gt;
&lt;p&gt;If you want to &amp;quot;add&amp;quot; methods to simplify the API, but without adding any extra data and only *using* the public API, use extension methods - they're great for that.&lt;/p&gt;
&lt;p&gt;Inheritance should be for *specialization* IMO, which doesn't really cover either of the reasons given here.&lt;/p&gt;
&lt;p&gt;For a more intelligent explanation of my point of view, read CLR via C# or Effective Java, both of which are written by smarter people than me :)&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;
</description></item></channel></rss>