Passing Interfaces Instead of Concrete Classes

I’ve just read a blog post about why you should pass interfaces instead of concrete classes as arguments to your methods.

I normally try to think about the most appropriate usages of interfaces for my own classes, but what this post alerted me to was the necessity to use interfaces when working with framework classes.
IE: IDictionary instead of Dictionary

The reasons the author discusses i believe are quite valid….It’s something i’m going to more actively do when writing code…


Related posts:

  1. Being driven down a path Recently, i've been looking more into TDD and mocking in...
  2. A Programming Job Interview Challenge #13 - Brackets As the title suggests, here is my solution for A...

Leave a Reply


The Tomes Of Experience - powered by WordPress (themed by selder) 0.354 seconds.
19:39:49 06-01-2009