Framework Design Guidelines – Conventions, Idioms, and Patterns for Reusable .NET Libraries is one of those few books you keep in reaching distance from your desk. For me, it sits right next to Jeffrey Richter’s oldie but goodie – Applied Microsoft .NET Framework Programming. ( I was even able to squeeze in Sahil’s Pro ADO.NET 2.0 :) Although I was originally worried that it would be more theoretical in nature and mainly apply only to architect types, such is not the case. It is a great combination of 1) best practices concerning fundamental API and class design; 2) great tutorials on .NET framework classes and the when, why, and how to use them; and 3) common design patterns for better manageability and extensibility of your frameworks.
Best Practices on API and Class Design
The book is filled with too many recommendations to mention
- When to use a property or a method
- Choosing between an interface or a base class
- Proper use of constructors
- Pitfalls and expectations when returning arrays
- How to name everything including your first born
- Creating overloaded methods.
Trust me when I say the book includes answers to everything and the kitchen sink as well as good and poor examples in the .NET Framework. Top that off with annotations by many respected developers and authors giving their 2 cents with respect to performance, manageability, usability, etc. And, hey, sometimes they don’t always agree
Great Tutorials on .NET Framework Classes – The Good, The Bad, and The Ugly
Great information on the stuff that I often struggle with and for which I will always need a book to make sure I am doing it “right.”
Great information like:
- When to use Structs vs. Classes
- Proper Enum Use and The [Flags] Attribute
- Passing by Reference and Value
- Throwing Exceptions
- Using Collections
- Boxing and UnBoxing
And a whole bunch of different perspectives and sometimes differences of opinions on when and why they matter.
Common Design Patterns
If you are going through all the trouble of building a framework, which is no small task, right along with making sure it is usable and intuitive is the need for making sure it can be easily maintained and evolve with future needs. Hence, you will need to use some common design patterns to make sure you don’t code yourself into a corner. The book touches on a few:
- Aggregate Component
- Dispose Pattern
- Async Pattern
- Good ‘ol Template Method
- Factories and Factory Method
- Optional Feature Pattern
This is by no means complete, but it is a good start for those interested in common design patterns for frameworks.
Good book for developers of all skills and roles. I highly recommend it.
Related Topics and Books:
- Framework Design Fundamentals
- OOP and Design Pattern Resources
- Agile Software Development Principles, Patterns, and Practices Book Review Conclusion
- Agile Software Development Book Review Index
- Applying UML and Patterns and GRASP Patterns Index
- Articles on OOP and Design Patterns