Visualize the System
Visualizing the system composed of containers is crucial for understanding dependencies and interactions within your application. Here’s how to effectively use the visualization tool.
We’ll explore:
- Using the
compose.graph
: How to visualize the system composed of containers.
Example
Expected Result
The output of compose.graph
provides a detailed breakdown of each container:
- Direct Dependencies:
- Strict: Lists containers that are
strict
dependencies of the current container. - Optional: Lists containers that are
optional
dependencies of the current container.
- Strict: Lists containers that are
- Transitive Dependencies:
- Strict: Lists containers that are
strict
dependencies, inherited through a chain of dependencies. - Optional: Lists containers that are
optional
dependencies, inherited through a chain of dependencies.
- Strict: Lists containers that are
- Transitive Dependency Paths:
- Each transitive dependency includes a path that describes how the dependency is reached, which is helpful for tracing and debugging.
When to Use compose.graph
- Debugging: Use the graph output to identify and resolve potential issues, such as missing or transitive (hidden) dependencies.
- Optimizing Architecture: Analyze the dependency structure to refactor and optimize your application’s architecture.
- Documenting Dependencies: Generate a visual representation to document the architecture for your team.
Notes
- Ensure that all containers are defined with proper
dependsOn
andoptionalDependsOn
attributes. - The
compose.graph
function does not modify your containers; it only provides a visualization of the dependencies.
Conclusion
Using compose.graph
allows you to have a comprehensive understanding of the container-based architecture of your application. This tool is essential for debugging, optimizing, and documenting the dependencies and interactions between various parts of your system.