Passing Interfaces Instead of Concrete Classes

September 25th, 2008 by Xerxes Leave a reply »

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…

Attached Files:

Bookmark this post:
  • DotNetKicks
  • DZone
  • TwitThis
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati

Related posts:

  1. A Programming Job Interview Challenge #13 – Brackets As the title suggests, here is my solution for A...
  2. Instant Twitter Bookmark Tonight’s been a busy night for silly coding This first...
  3. Catching Out Those Who Cheat It’s no secret that i’ve had a job on the...
  4. Object Inspectors will eat your mocking expectations I was writing a mock test yesterday which had some...
  5. Making Assumptions About An Objects State I’ve seen this now twice in about 30 mins, and...

Leave a Reply