Software Architecture
Analyze and design the internal structure of software systems: modules, layers, boundaries, design patterns, and quality attributes. Produce Architecture Decision Records and validate structural integrity.
Guiding Principle
"Good software architecture maximizes the number of decisions not made — it preserves options while enforcing the constraints that matter."
Procedure
Step 1 — Structural Analysis
- Map the codebase into modules, packages, and layers
- Calculate coupling metrics: afferent coupling (Ca), efferent coupling (Ce), instability (I)
- Identify dependency cycles and layering violations
- Classify components by volatility and stability
- Produce a dependency graph with hotspots annotated
Step 2 — Pattern Application
- Identify recurring design problems in the codebase
- Match problems to appropriate design patterns (GoF, domain, architectural)
- Evaluate pattern trade-offs: complexity vs. flexibility vs. testability
- Design pattern implementation with concrete interfaces and contracts
- Document pattern rationale in ADR format
Step 3 — Quality Attribute Engineering
- Identify critical quality attributes: maintainability, testability, modifiability, performance
- Define architectural tactics for each quality attribute
- Map tactics to code-level decisions (DI, interfaces, abstractions)
- Design fitness functions to guard each quality attribute
- Establish measurable thresholds for each attribute
Step 4 — ADR Generation
- Identify each significant architectural decision made
- Document context: what forces led to this decision point
- Record the decision and alternatives considered
- Analyze consequences: trade-offs, risks, technical debt
- Link ADRs to affected modules and quality attributes
Quality Criteria
- Dependency graph shows no circular dependencies between modules
- Every architectural pattern has an ADR with rationale and alternatives
- Quality attributes have measurable fitness functions defined
- Layer boundaries are enforced by build tooling or linting rules
Anti-Patterns
- Big Ball of Mud: no discernible module boundaries or layering
- Golden Hammer: applying the same pattern everywhere regardless of context
- Architecture by buzzword: choosing patterns for trend rather than fit
- Decision amnesia: no record of why architectural choices were made