---
title: "Keep interfaces small · Agent Wranglers"
url: https://agentwranglers.se/playbook/architecture/solid-and-dry/interface-segregation
updated: 2026-10-20
licence: "All rights reserved"
---

# Keep interfaces small

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [SOLID and DRY](https://agentwranglers.se/playbook/architecture/solid-and-dry)
- Rule: Split large interfaces into small role interfaces, so no class has to implement methods it does not use.
- How: Shape each interface around one caller's needs. A class may implement several small interfaces. If an implementation leaves methods empty or throwing, the interface is too big.
- Check: In review, no implementation has empty or throwing methods. A linter such as PHPMD `TooManyMethods` flags fat interfaces.

Example:

```php
// Bad: a printer must pretend to scan and fax
interface Machine { public function print(Doc $d): void; public function scan(): Doc; public function fax(Doc $d): void; }

// Good: one interface per role
interface Printer { public function print(Doc $d): void; }
interface Scanner { public function scan(): Doc; }
```

```ts
// Good: one interface per role
interface Printer { print(doc: Doc): void }
interface Scanner { scan(): Doc }
class OfficePrinter implements Printer { print(doc: Doc) { /* ... */ } }
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/solid-and-dry/interface-segregation`.

- Previous: [Prefer composition over inheritance](https://agentwranglers.se/playbook/architecture/solid-and-dry/composition-over-inheritance)
- Next: [Depend on abstractions at the edges](https://agentwranglers.se/playbook/architecture/solid-and-dry/dependency-inversion)
- [SOLID and DRY](https://agentwranglers.se/playbook/architecture/solid-and-dry)
