Pattern Overengineering
Pattern overengineering is the senior tax on junior enthusiasm: every new wrapped in Factory, every interface with one implementation, 8-layer stacks before CRUD hits the database.
Introduction
Pattern overengineering is the senior tax on junior enthusiasm: every new wrapped in Factory, every interface with one implementation, 8-layer stacks before CRUD hits the database. This lesson names symptoms and prescribes deletion moves.
The story
Consultants audited a 3-year codebase: 47 one-impl interfaces, 12 fixed-type factories, 7-layer CRUD stack. A 4-week deletion sprint removed 40% of abstractions. Coverage up, test time −50%, velocity doubled.
The business problem
Abstraction zoo slows every change and hides domain logic:
- Navigation cost: 7 hops to find where SQL runs.
- Test bloat: mock every layer for simple behavior test.
- Review fatigue: patterns look "professional" — nobody deletes.
- Velocity collapse: simple feature touches 12 files.
The problem teams faced
Overengineering symptoms:
- Factory returns only one concrete type ever.
- Interface per class "for testability" with one mock.
- Layer count exceeds team size without clear ownership.
- New engineer onboarding measured in weeks not days.
Understanding the topic
Intent: Recognize and reverse pattern decoration without force.
- Symptom catalog — name smells by pattern type.
- Deletion moves — inline, collapse layers, remove indirection.
- Measure — lines removed, test time, files touched per feature.
- Culture — deletion sprint as legitimate work.
Internal architecture
Before / after layer stack:
// ❌ 7 layers for GET /users/:idController → Facade → Manager → Service → Helper → DAO → Repository → DB// ✅ 3 layers with clear seamsController → UserService (domain) → UserRepository (DB)// Delete Manager, Helper, DAO — no force preserved them
Visual explanation
Three diagrams cover symptom catalog, layer collapse, and deletion sprint:
Informative example
Before / after — Abstract Factory with one product:
// ❌ Abstract Factory — one family foreverinterface UIFactory { createButton(): Button; createDialog(): Dialog }class WinFactory implements UIFactory { ... } // only impl// ✅ Direct construction until second platformconst button = new WinButton()const dialog = new WinDialog()// Add MacFactory when Mac port is real — not in year-one web app
Execution workflow
Audit
Count 1-impl interfaces, fixed factories.
Real-world use
Consulting architecture audits; "architecture astronauts" antipattern; deletion sprints at mature startups; Sandi Metz rules on small objects vs layer explosion.
Production case study
3-year codebase audit:
- Found: 47 one-impl interfaces; 7-layer CRUD.
- 4-week sprint: 40% abstractions removed.
- Outcome: test time −50%; velocity doubled.
Trade-offs
- Pro: faster changes; clearer domain; cheaper tests.
- Con: may re-add abstraction when variant arrives.
- Con: politically hard — patterns feel like progress.
Decision framework
- If abstraction has one impl for 12+ months → deletion candidate.
- Layer needs named owner and force — else collapse.
- Measure deletion sprint like feature sprint.
Best practices
- Quarterly abstraction audit — automated impl counts.
- PR review asks "what force?" not "where's the pattern?"
- Celebrate line-count-negative PRs.
Anti-patterns to avoid
- Factory wrapping every new — "enterprise Java" in TypeScript.
- Interface-per-class for SOLID theater.
- Deletion blocked because "we might need it."
Common mistakes
- Deleting seam that actually has second impl coming next sprint — check roadmap.
- Collapsing layers that enforce security/compliance boundary.
Debugging tips
- Trace request path — count hops to DB; target ≤4 for simple CRUD.
Optimization strategies
- Start deletion on highest-churn modules — immediate dev feedback.
Common misconceptions
- More patterns ≠ better architecture — often inverse at scale.
- Overengineering ≠ big system — small teams do it too from books.
Advanced interview questions
Interview Prep
Practice concise answers, then expand each card for the explanation.
1IntermediateQuestionSigns of pattern overengineering?+
Answer
Follow-up
2AdvancedQuestionHow fix without rewrite?+
Answer
Follow-up
3IntermediateQuestionOverengineering vs proper layering?+
Answer
Follow-up
Summary
You can audit overengineering, run deletion moves, and cite the consulting sprint. Tell the 47-interface story — if you can do that, you own Pattern Overengineering.