Dependency Graph
The dependency graph shows file-level and module-level dependencies in the legacy codebase. This goes deeper than the context map — it shows which files import which, where shared controllers create coupling, and where circular dependencies exist.
Interactive Visualization
Section titled “Interactive Visualization”What This Shows
Section titled “What This Shows”The dependency graph renders cross-module relationships from the ERPNext reference dataset:
- Nodes represent modules or files
- Edges show import/dependency relationships
- Edge weight reflects the strength of coupling (number of shared references)
- Clusters indicate natural bounded context boundaries
- Red edges highlight circular dependencies that complicate extraction
Why Dependencies Matter for Modernization
Section titled “Why Dependencies Matter for Modernization”Legacy systems accumulate implicit dependencies over years. In ERPNext:
accounts_controller.py(4,412 lines) is imported by every transaction type- The hooks system creates invisible execution paths across modules
- Regional overrides create country-specific dependency branches
Understanding these dependencies is a prerequisite for safe extraction. The dependency graph makes the invisible visible.
Controller Inheritance Example
Section titled “Controller Inheritance Example”ERPNext’s controller inheritance chain demonstrates deep coupling:
A single method change in AccountsController can affect every transaction type in the system.
Identifying Extraction Boundaries
Section titled “Identifying Extraction Boundaries”The dependency graph helps identify:
| Pattern | Meaning | Action |
|---|---|---|
| Dense cluster | High internal cohesion — good bounded context | Extract as a unit |
| Few cross-cluster edges | Low external coupling | Clean extraction boundary |
| Hub node | Many incoming/outgoing edges — shared controller | Decompose before extraction |
| Circular dependency | Modules depend on each other | Break cycle with ACL before extraction |
Next Steps
Section titled “Next Steps”- Complexity Heatmap — See where complexity concentrates
- domains.json Specification — Define bounded contexts