Reviewing Framework Design Guidelines: Conventions, Idioms and Patterns for Reusable .NET libraries

I finally managed to get through the Framework Design Guidelines book, written by the people behind the .NET framework. They explain their experiences and insights on 4 versions of the .NET framework though a series of guidelines, that are being used by the Microsoft for the development of the .NET framework:

Framework Design Guidelines

The guidelines are provided in the following chapters:

  • Naming guidelines
  • Type design guidelines (Reference vs value, classes vs structs, abstract classes vs interfaces, static, …)
  • Member design guidelines (Methods vs properties, member overloading, optional parameters, params, ref, in and out, enumerations)
  • Designing for extensibility (Sealed vs unsealed, private vs public vs protected, events, virtual, …)
  • Handling exceptions
  • Usage guidelines (Arrays vs collections, ICloneable, Nullable, Object methods, …)
  • Common design patterns (Async pattern, IDisposable pattern, Factory pattern, Template method pattern, …)
  • Coding style conventions (brackets, spaces, indenting, comments, regions, …)
  • FxCop or Visual Studio Code Analysis

Even though the book is called Framework Design Guidelines and provides you an insight on how to effectively build public frameworks or components that will be used by other people, the experiences and insight they provide are usable for anyone writing .NET code. Whether you are writing public framework components, public interfaces or a simple a .NET application, you are most likely be able to write better code or have a better understanding of your code or the .NET framework after having read this book.

If you are writing a framework or a component that will be publicly accessible to external parties, then this book will just teach you what things to pay attention for to keep backwards compatibility, provide new features without breaking client code, …. It will discuss how to write extensible framework components with a focus on usability for your customers. The book mentions how the .NET framework evolved and why some of the current decisions were taken, getting a better understanding of how the framework is actually build up and how it should be used.

Some topics I found particularly interesting:

  • Why using default constructors
  • Disposing with IDisposable pattern and how to manage finalizers
  • Comparison with IEquatable<T> and IComparable<T>
  • Shallow vs deep copy
  • Flag enumerations
  • The difference between IEnumerable<T>, ICollection<T> and IList<T>
  • Abstract classes versus interfaces
  • Managing overloads

Perhaps for senior technical fellows this book might not be as interesting, but I found this to be an awesome book and I’m also very happy to have invested my time into it! It’s definitely going to get a prominent spot on my book shelf!

The Framework Design Guidelines book can be found on amazon


By Robbin Cremers Posted in Books