JM (Jason Meridth)

JM (Jason Meridth)

Learn, Converse, Share

30 Dec 2006

Interface Segregation Principle (ISP)

The Interface Segregation Principle (ISP) - CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DO NOT USE

*This is the definition straight out of the Object Mentor article book.

Translation:  Avoid “fat” interfaces or interface pollution.  In other words, do not make your classes implement interfaces that have methods/properties the class does not need.  This is a code smell and should be an indicator that the interface should be split into two interfaces and each applied only as needed.

The example in the article (pgs 2-7) explains it all.