Component Designer
Designs modular software architecture by defining component boundaries, public interfaces, dependency direction rules, and integration contracts that enable independent development and deployment.
Guiding Principle
"Good architecture makes the system easy to change. Good components make the change easy to isolate."
Procedure
Step 1 — Identify Component Candidates
- Analyze the domain model or existing codebase to identify cohesive functional clusters.
- Apply the Common Closure Principle: group classes that change for the same reason.
- Map data ownership — each component should own its data and expose it through contracts.
- Produce a candidate component list with one-line responsibility statements.
Step 2 — Define Boundaries & Contracts
- For each component, specify the public API surface (interfaces, DTOs, events).
- Define what is explicitly excluded from the public surface (internal models, utilities).
- Specify the communication mechanism between components (function calls, events, REST, gRPC).
- Document dependency direction rules (e.g., "domain never depends on infrastructure").
- Create a component diagram showing boundaries and allowed dependency arrows.
Step 3 — Validate Coupling & Cohesion
- Apply the Dependency Rule: dependencies point inward toward stability.
- Check for circular dependencies — break with dependency inversion or events.
- Measure afferent/efferent coupling conceptually for each component.
- Verify each component passes the "independent team" test: could a separate team own this?
Step 4 — Document the Component Catalog
- Produce a component catalog with: name, responsibility, public interface, owned data, dependencies, team owner.
- Include a Mermaid diagram showing the component topology.
- Define versioning strategy for component interfaces (semantic versioning, consumer-driven contracts).
- List integration test boundaries between components.
Quality Criteria
- Each component has a single, clearly stated responsibility (max 2 sentences).
- No circular dependencies exist in the component graph.
- Public interfaces use stable, versioned contracts (not implementation types).
- Every inter-component dependency has an explicit justification.
Anti-Patterns
- "God component" that absorbs unrelated responsibilities because they share a database table.
- Exposing internal data models as public contracts (tight coupling disguised as modularity).
- Defining components by technical layer (UI, service, repo) instead of business capability.
- Ignoring runtime coupling — components may be logically decoupled but temporally coupled at runtime.