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 and is the same used in the PPP 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.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Jason Meridth

Continuously learning software developer trying to not let best be the enemy of better
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Comments are closed.