P&P Summit: Day one keynote: Principles of Framework Design
Today’s keynote was given by Brad Abrams. I saw Brad give a talk last year at PDC along with Krzysztof Cwalina on Designing Frameworks. The talk back then was based on the book they had just put out. Today’s talk brought in a lot of the same type of content, but I still got a few more gems out of it.
Brad’s key principles are:
-
Treat Simplicity as a Feature:
- Make your framework simple to use.
- You may remove some more complex features in order to make the overall framework better and less cluttered.
- Design for the 80% case in mind. Provide other mechanisms to cover the other 20% as they come up, or offer extensibility points to get around this.
-
Know your user:
- Make it easy for your user to just “fall” into the right way to do things. Make it very intuitive on how to handle the 80% case.
- Make it very simple to experiment with your framework.
-
Think of the developer ecosystem:
- Ensure you have good intellisense support.
- Maybe provide some custom visualizers for the debugger into complex types.
- Use common abstractions such as utilizing the least specialized types for your parameters.
-
Use the power of consistency:
- Brad used a great example (same one from PDC) where he talked about how you didn’t read the owner’s manual on the rental car even though it’s a different car than your own. It’s because there is a consistent interface. Utilizing consistent and well known patterns will help your framework be adopted and easy to use.
-
Designing to last:
- Make sure you find the really useful extensibility points and make those exposed to your consumers.
- Test the abstractions in your framework. Make sure you ship at least one or two concrete classes for you interfaces, and at least have real world examples in your unit tests to ensure you have exercised your extension points.
Again, a lot of the same stuff that was in his PDC talk, but it was still really good. Overall a great opening to the sessions.