Site Map

Thoughts and ideas about things that I find interesting 

Facebook Twitter YouTube E-mail RSS

Applying SOLID Principles to .Net Development

The five SOLID design principles can be applied to .Net development in the following ways:

Single Responsibility
Each class and method should have exactly one purpose.

Use generic or abstract classes where future extension may be necessary rather than continually modifying an inherited base class.

Liskov Substitution
Use Code Contracts where appropriate for improved testability. (ccrewrite for run-time testing and cccheck for compile-time testing)

Interface Segregation
With MVC and MVVM you’re pushed into this naturally which is good. Just make sure you don’t have any business logic in your views, view models or controllers.

Dependency Inversion
Use factories, containers and interfaces where appropriate to make use of libraries in situations where it’s useful not to have to reference them directly.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home Technology Software Development Methodologies Applying SOLID Principles to .Net Development