Top-Down Design vs. Bottom-Up Design
This post is a definition of terms for Top-Down vs. Bottom-Up – including exam questions, core components, and tags.
In a Nutshell
- Top-Down starts with business goals and progressively decomposes them into subproblems and interfaces.
- Bottom-Up starts with existing building blocks (libs/frameworks/services) and composes a solution from them.
In practice, Meet in the Middle is often the sensible approach.
Compact Technical Description
Top-Down
- First goals, context, use cases
- Then refinement: subsystems → components → classes → operations
- Advantage: clear business divisions, good test derivation from requirements
Bottom-Up
- First reuse: libraries, SDKs, frameworks, existing systems
- Then composition + adaptation
- Advantage: fast start, lower implementation effort
Risks:
- Top-Down: technical constraints become visible too late
- Bottom-Up: technology-driven architecture, integration costs, vendor lock-in
Exam-Relevant Key Points
- Clearly distinguish definitions
- Keep coupling low, cohesion high
- Define stable interfaces
- Traceability: requirement → design → test
- Adapter/Anti-Corruption Layer for external components
- Meet in the Middle as realistic combination
Core Components
- Business goals + context
- Decomposition into subsystems
- Interface contracts
- Identification of existing components
- Adapter/Facade/ACL
- Quality goals/architecture rules
- SOLID/GRASP as guidelines
- Test strategy (acceptance → unit)
- Security/dependency checks/licenses
- ADRs (version decisions)
Practical Example (Payment Processing)
Top-Down:
- Goal: securely authorize payments
- Services: payment service, order service
- Ports: authorize(), cancel()
Bottom-Up:
- Available: payment SDK, HTTP client, event bus
- Adapter encapsulates SDK
- Contract tests against sandbox
Meet in the Middle:
- define business ports
- fill concrete adapter with SDK
Advantages and Disadvantages
Top-Down
- Advantages: clear business structure, stable ports, good testability
- Disadvantages: ramp-up phase, technical risks can emerge late
Bottom-Up
- Advantages: fast results, high reusability
- Disadvantages: risk of technology-driven divisions, integration/lock-in risk
Typical Exam Questions (with Brief Answer)
- Basic difference? Top-Down decomposes from the goal, Bottom-Up builds from building blocks.
- How does it affect coupling/cohesion? Top-Down strengthens business cohesion; Bottom-Up can increase coupling.
- How do you combine sensibly? Meet in the Middle + Adapter + ADRs.
Learning Strategy
- Draw both sketches for a mini-domain.
- Define ports as interfaces.
- Practice contract tests against external components.