Skip to content

🧱 Interface Design

Interface design is the discipline of defining clear, minimal, and stable contracts that classes, modules, or services expose to each other. A well‑designed interface tells consumers what they can do, not how it is done. It is one of the most important foundations of maintainable, testable, and evolvable software.


Interface design is the process of defining public contracts that specify the operations a component provides, the inputs it accepts, the outputs it returns, and the rules governing its behavior. A good interface hides implementation details, reduces coupling, and makes collaboration predictable.

It answers:

  • What capabilities does this component expose?
  • What is the minimal set of operations consumers need?
  • How do we ensure stability even when internals change?

Good interface design:

  • Reduces coupling between components
  • Makes code easier to test (mocking, dependency injection)
  • Enables independent evolution of modules
  • Improves readability and discoverability
  • Prevents accidental misuse
  • Supports clean architecture and SOLID principles

Poor interface design leads to brittle, tangled systems.


  • Abstraction — expose what to do, not how
  • Encapsulation — hide internal details
  • Cohesion — interfaces should group related operations
  • Low coupling — avoid unnecessary dependencies
  • Interface Segregation — prefer small, focused interfaces
  • Clear contracts — define expectations, constraints, and invariants
  • Stability — interfaces should change rarely
  • Predictability — consistent naming and behavior

These principles ensure interfaces remain clean and evolvable.


Expose only what consumers need.
Avoid “fat interfaces” with unrelated methods.

Each interface should represent a single capability or role.

Internal changes should not break consumers.

Naming, behavior, and error handling should follow predictable rules.

Interfaces should work well together without forcing tight coupling.

Interfaces should be easy to mock or stub.


  1. Identify the responsibility the interface represents
  2. Define the minimal set of operations needed
  3. Specify inputs, outputs, and constraints
  4. Ensure separation of concerns
  5. Review for cohesion and coupling
  6. Validate with real usage scenarios
  7. Refactor if needed

  • Interfaces that expose implementation details
  • Interfaces with too many unrelated methods
  • Interfaces that force consumers to depend on things they don’t use
  • Interfaces that change frequently
  • Interfaces that leak domain or infrastructure concerns
  • Interfaces that return overly generic types (e.g., object)

If you apply interface design to a Daily Scrum application:

  • Responsibility: generate daily summaries
  • Methods: Generate(DailySession session)
  • Notes: allows multiple summary algorithms (Strategy pattern)
  • Responsibility: export summaries to PDF
  • Methods: Export(Summary summary)
  • Notes: hides PDF library details
  • Responsibility: send notifications
  • Methods: SendReminder(Member member)
  • Notes: allows email, SMS, or push implementations

Each interface is small, focused, and stable.


Interface design defines clear, minimal, stable contracts between components. Good interface design reduces coupling, improves testability, and supports clean architecture. It is essential for building systems that are easy to evolve without breaking existing functionality.