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 [...]
This is one of the most powerful principle of OOP.
The Principle
Simply stated- what this means is- once you are done coding an entity - e.g Class,function etc- you should have no reason to modify it again (…hence closed), but that entity should be available for modification via extensions e.g inheritance or any other smart mechanism [...]
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 [...]
Recent Comments