DocuEye Logo

Containers should not have cyclic dependencies

Containers must not depend on each other in a cyclic manner to avoid tight coupling and maintainability issues.

Identifier

C4-ARCH-001

Severity

Error - High impact on architecture quality

Scope

General - This rule is evaluated against the overall architecture model.

Default expression
GeneralIssuesFinder.CyclicDependenciesExists("Container",@ModelRelationships)
Explanation

Containers should form an acyclic dependency graph in which the direction of dependencies is unambiguous and consistent with architectural responsibilities. A cyclic dependency occurs when container A depends (directly or indirectly) on container B, and container B also depends on container A.

Container-level cyclic dependencies indicate a violation of separation of responsibility and a lack of clear architectural boundaries. They create strong coupling, preventing independent versioning, deployment, testing, and refactoring of containers. In extreme cases, cyclic dependencies can lead to problems with initialization, configuration, or dependency loading at system startup.

This rule enforces an architecture based on unidirectional dependencies, consistent with principles such as the Dependency Rule, the Stable Dependencies Principle, and the Clean Architecture.

Example of violation - direct cycle

ContainerA → ContainerB
ContainerB → ContainerA

Example of violation - indirect cycle

ContainerA → ContainerB → ContainerC → ContainerA
Recommendations

DocuEye - Visualize architecture.

Free and open source tool for software architecture visualization with built-in architecture linter.
Documentation as a code approach based C4 Model.

Copyright © 2026 DocuEye - All rights reserved

Resources

Sources and documentationC4 modelStructurizr DSL language reference