Clients should not be forced to depend on methods that they do not use.In other words, this principle states that if a class performs multiple functions that may be used by different client classes, then those functions should be seperated out into different interfaces according to their usage. The idea behind this principle is to confine the aount of rework to only clients that use a certain interface, should the interface of a depended-upon class changes.
Monday, August 28, 2006
ISP: Interface Segregation Principle
The Interface Segregation Principle (ISP) deals with cohesion and is closely related to the Single Responsibility Principle (SRP). In Uncle Bob's terms, the ISP states that: