Fat interfaces
Line 1: | Line 1: | ||
− | A fat interface is usually | + | An interface which provides too much access to data or functionality can be said to be a fat interface. A fat interface usually provides access to a large number of operations, and each operation is often very small. A fat interface is usually aimed at serving more than one set of clients. A fat interface looks powerful but is indeed quite harmful. Fat interfaces introduce high coupling between the interface and its clients. This means that a small change often propagates to many classes since the change is more likely to require an interface change and fat interfaces are usually used by many classes. As summarized by others before, your code should only be dependent on the interfaces it actually uses. |
The [[Interface segregation principle]] is targeted at avoiding fat interfaces. | The [[Interface segregation principle]] is targeted at avoiding fat interfaces. |
Revision as of 02:42, 27 July 2009
An interface which provides too much access to data or functionality can be said to be a fat interface. A fat interface usually provides access to a large number of operations, and each operation is often very small. A fat interface is usually aimed at serving more than one set of clients. A fat interface looks powerful but is indeed quite harmful. Fat interfaces introduce high coupling between the interface and its clients. This means that a small change often propagates to many classes since the change is more likely to require an interface change and fat interfaces are usually used by many classes. As summarized by others before, your code should only be dependent on the interfaces it actually uses.
The Interface segregation principle is targeted at avoiding fat interfaces.
External Links
Link for Interface Segregation Principle:
http://c2.com/cgi/wiki?InterfaceSegregationPrinciple;
http://doodleproject.sourceforge.net/articles/2001/interfaceSegregationPrinciple.html;
http://davidhayden.com/blog/dave/archive/2005/06/15/1482.aspx