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)
- "If only I had an interface ..." (language-specific)
- "...then I could mock my data access layer..." (conceptual)
Post a comment