Folder structure is not a dependency map
A directory shows where files live, but does not explain who imports whom, which modules are central, or which changes will have a large impact radius. Safe planning requires external and internal dependencies, reverse references, and signals of architectural cycles.
| View | Question |
|---|---|
| External dependencies | Which libraries are declared, and which are actually installed? |
| Internal dependencies | Which modules import or call one another? |
| Reverse dependencies | Who uses the central file or service? |
| Architectural risks | Are there cycles or violations of layer direction? |
Start with manifests and the dependency tree
- Read manifests and lockfiles.
- Separate direct dependencies from transitive ones.
- Obtain the full dependency tree when needed.
- Analyze imports and calls between internal modules.
- Find reverse references for central components.
- Add only compact relationships and risks to the inventory.
./gradlew dependencies --configuration runtimeClasspath > deps-backend.txt
npm ls --all > deps-frontend.txt
git grep "RefundPolicy" backend/src backend/testMark the strength of each conclusion
[confirmed]— the relationship was found directly;[needs verification]— there is a signal, but the evidence is incomplete;[unverified]— the area has not yet been investigated.
Dependencies as an impact radius
| Observation | Practical conclusion |
|---|---|
| Many modules reference a service | The change has a potentially broad impact |
| Modules import each other | A separate cycle check is needed |
| A direct dependency appears only in the manifest | It is declared, but usage still needs confirmation |
| The relationship is visible only from a folder name | This is a hypothesis, not evidence |
Do not refactor during initial mapping
A discovered cycle or cross-layer import may be an important signal, but discovery and correction are different tasks. First record the dependency, source, and confidence level; decide about refactoring separately.
Canonical lesson source · JavaRush
Open JavaRush material