Fat Interfaces and Their Problems
What you'll learn: You'll discover why bloated interfaces harm your codebase by forcing unnecessary dependencies and implementations.
The Core Problem
A fat interface (also called a polluted or bloated interface) is an interface that tries to do too much—it bundles together many methods that different clients need, even though no single client needs all of them. This violates the Interface Segregation Principle you just learned.
When you create a fat interface, you force every implementing class to provide code for methods it may never actually use. Even worse, every client that depends on the interface becomes coupled to methods it doesn't care about.
Why This Hurts
Unnecessary coupling: If a client only needs one method from a ten-method interface, it still depends on all ten. Changes to any of those methods can force recompilation or retesting of code that doesn't even use them.
Forced irrelevant implementations: Classes implementing the fat interface must write stub code for methods they don't need—often throwing exceptions or returning dummy values. This clutters the codebase and can hide design problems.
Harder to understand and maintain: Fat interfaces obscure what a class actually does. Developers waste time reading through method signatures that aren't relevant to their use case.
A Simple Analogy
Imagine a Swiss Army knife with 50 tools, but you only ever use the blade. You're still carrying around 49 extra tools everywhere you go—adding weight, complexity, and potential failure points you don't need.
Key Takeaway: Fat interfaces create unnecessary coupling and force classes to implement methods they don't use, making code harder to maintain and understand. Split them into smaller, focused interfaces instead.