O'Reilly logo

Refactoring with Microsoft Visual Studio 2010 by Peter Ritchie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interface segregation principle

With the power of Interface-based design, Dependency Injection, and Inversion of Control containers; there's a propensity for the Extract Interface refactoring to be invoked on many classes in a code base and those classes used solely through the new extracted interface. This takes a giant leap towards loosely coupling, but can create new, unnecessary couplings.

Each class has its own interface that is used (hopefully) by one or more other classes. Each class may use that class in a very specific way, that is, it may not use its entire interface. By simply extracting an interface from a class and forcing all users of the class to be coupled to that one interface, you're forcing all those classes to be coupled to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required