Comparison
Deep modulevsPass-through method
Deep module
the interface is three methods and the implementation is two thousand lines, and that ratio is the point.
Ousterhout's framing that a good module has a small interface relative to the functionality behind it, and a bad one — a shallow module — has an interface nearly as complicated as what it hides. It is the sharpest available argument against reflexively splitting classes: many small classes each with a wide interface is more total complexity, not less. It also explains why a pass-through method or a one-line wrapper class feels wrong even when it satisfies every principle on a checklist.
Full entry →Pass-through method
the service method's whole body is a call to the repository method with the same name and the same arguments.
A method, or a whole layer, that does nothing but forward to the next one down, added because the architecture diagram said there should be a layer there. It is the shallow-module problem at its most literal: interface as wide as the thing it hides, and no complexity absorbed. A layer earns its place by doing something — a transaction, a translation, a policy — and if it does not, deleting it is a genuine improvement.
Full entry →