Sunday, June 2, 2013

Using interfaces for writing DAO classes

NOTE THAT : You should always try to separating the Interface from the Implementation. This will give you more control to the other layers, using this DAO layer.
But, As you know an interface gives you more abstraction, and makes the code more flexible and resilient to changes, because you can use different implementations of the same interface without changing its client. Still, if you don't think your code will change, or (specially) if you think your abstraction is good enough, you don't necessarily have to use interfaces
In other words: interfaces are good, but before making an interface for every class think about it

No comments:

Post a Comment