Interface Segregation Principle

Episode #314 | 14 minutes | published on December 7, 2017 | Uses Xcode-9.1
Subscribers Only
In this episode we examine ISP (the Interface Segregation Principle). This one states that a type should not depend on methods from an interface that it will never use. Often times this means that the type probably carries too many responsibilities, but breaking it apart is difficult for other reasons (perhaps too many things depend on it and changing it would be expensive). You can extract smaller interfaces that support the individual responsibilities, but still have the same class adopt it. Doing so opens up opportunities for further refactoring and testing.
blog comments powered by Disqus