Language Matters

My Design Patterns are Code Smells post has been picked up by TheServerSide.com. It is interesting to read through the comments. One side exchange about Test-Driven Development includes this observation:

I think the point of the TDD comment is that TDD forces you to consider using interfaces to reduce coupling between classes.

Yes, near 100% of my data access interfaces have exactly one implementation. But I never create these interfaces because, gosh, I may want to change from Oracle to Some-New-Cool-Database in the future.

This is a terrific example of how implementation languages color your thinking. Notice how easy it is to switch between concept and implementation details:

  • "TDD forces you to consider..." (conceptual)
  • "...using interfaces to..." (language-specific)
  • "...reduce coupling..." (conceptual)
  • "...between classes." (language-specific)

There is nothing wrong with this level-jumping; it is often more concise than speaking at a single level could be. Just make sure that you understand what level you are playing at, and why. Otherwise you might conclude that

  • "If only I had an interface ..." (language-specific)
  • "...then I could mock my data access layer..." (conceptual)

which says more about your platform choice than it does about the problem at hand.

Get In Touch