I - Interface Segregation (ISP)
About
A class should not implement interfaces that it won't use.
Usually impacts reduction of unecessary re-compilation.
Example
In this example, the Exec class, which is the class that uses the method, specifies what it wants from ClassA.
So now, Exec don't know ClassA anymore, it only knows Interface2. And if ClassA changes in the future, Exec won't need to be re-compiled (Since there is no more import A from '.../ClassA').
Last updated