The Interface Segregation Principle

The Interface Segregation Principle is about keeping to the contract of interaction presented by your class small. More than small, the contract presented by your class should have a single responsibility.

Sometimes, having a class with a small single responsibility contract is difficult or not desired. In those instances, the class should implement multiple contracts instead of creating a combined contract. We want multiple contracts to reduce the number of far-reaching dependencies.

Every time a base class or interface is modified, the child classes must also be modified. At the very least, the child classes must now be recompiled. By limiting the scope of a contract, we can reduce the impact of changing that contract and improve the overall system architecture.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.188.241