Reputation: 12885
I use much Microsoft SQL Server propriate stuff. I do not need multiple concrete classes implementing the same interface.
So why should my DataProvider classes need an interface?
Upvotes: 1
Views: 180
Reputation: 27349
There are probably many ways to answer this, but one advantage of using an interface (especially with a pattern like the Repository pattern) on your DataProvider is so you can mock that interface, allowing you to unit test the code that makes use of the DataProvider more easily.
Upvotes: 1
Reputation: 499142
You should create interfaces in order to make testing code that depends on your data easier.
Having interfaces and coding to these interfaces means you can inject mocks and stubs in your tests.
Upvotes: 3