Swiss army knife

From CSSEMediaWiki
Revision as of 21:04, 20 October 2010 by Benjamin Gibson (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A Swiss Army Knife, also known as Kitchen Sink, is an excessively complex class interface. The designer attempts to provide for all possible uses of the class. In the attempt, he or she adds a large number of interface signatures in a futile attempt to meet all possible needs.

Real-world examples of Swiss Army Knife include from dozens to thousands of method signatures for a single class. The designer may not have a clear abstraction or purpose for the class, which is represented by the lack of focus in the interface.

Swiss Army Knives are prevalent in commercial software interfaces, where vendors are attempting to make their products applicable to all possible applications.


This AntiPattern is problematic because it ignores the force of managing complexity, that is, the complicated interface is difficult for other programmers to understand, and obscures how the class is intended to be used, even in simple cases. Other consequences of complexity include the difficulties of debugging, documentation, and maintenance.

from http://sourcemaking.com/antipatterns/swiss-army-knife

Related design maxims

Personal tools