This is the ‘eye’ of SOLID software design principles.
Definition:
Clients should not be forced to depend on methods that they do not use.
Alternate Definition (s):
The dependency of one class to another one should depend on the smallest possible interface
The idea
Consider two components- which interact with each other. The interaction between the two is defined by the [...]
Visit to the bank
You walk in to the bank- to deposit cash.
You stand in the line- meet the Teller who does the transaction with you.
Do you really care whether its Joe or Mary behind the counter?
No. You do not.
Because your contract with the Bank is via the teller (:read interface) not Joe who happens to be [...]
Following is a collection of some principles\suggestions\rules\guidelines- whatever you wish to call them- to be kept in mind while designing software.
Some of this was inspired by Head-First Design patterns book- which I concluded recently. An excellent read- BTW.
I would recommend every earnest programmer to keep these principles posted at a visible location in his/her work place.
A) [...]
Recent Comments