---
title: Why Cyclic Dependencies are a Problem
description: Lattix Architect can help you detect and correct cyclic dependencies as they occur by checking your architecture regularly.
image: https://blog.lattix.com/hubfs/One%20Giant%20Component-2.jpg
---

[![Lattix Logo](https://blog.lattix.com/hs-fs/hubfs/lattix-logo-1.jpg?width=1251&height=418&name=lattix-logo-1.jpg "Lattix Logo")](https://www.lattix.com)

Open main menu Close main menu

- [PRODUCTS](https://www.lattix.com/products) Open the submenu 
    - [LATTIX 2021](https://www.lattix.com/products/lattix-2021)
    - [LATTIX ARCHITECT](https://www.lattix.com/products/#architect)
    - [LATTIX SUITE](https://www.lattix.com/products/#lattix_suite)
    - [CI/DEVOPS](https://www.lattix.com/products/#devops)
- [SOLUTIONS](https://www.lattix.com/solutions) Open the submenu 
    - [OVERVIEW](https://www.lattix.com/solutions/#overview)
    - [ARCHITECTURE ANALYSIS](https://www.lattix.com/solutions/architecture-analysis)
    - [CI DEVOPS](https://www.lattix.com/solutions/ci-devops)
    - [ARCHITECTURAL REFACTORING](https://www.lattix.com/solutions/architectural-refactoring)
    - [IMPROVE BUILD](https://www.lattix.com/solutions/improve-build)
    - [IMPROVE TESTING](https://www.lattix.com/solutions/improve-testing)
    - [COMPLIANCE](https://www.lattix.com/solutions/functional-safety-compliance) Open the submenu 
          - [MEDICAL](https://www.lattix.com/solutions/functional-safety-compliance/medical)
          - [AUTOMOTIVE](https://www.lattix.com/solutions/functional-safety-compliance/automotive)
          - [AVIONICS/MILITARY](https://www.lattix.com/solutions/functional-safety-compliance/avionics-military)
          - [FINANCE](https://www.lattix.com/solutions/finance-pci-compliance)
    - [SYSTEMS ENGINEERING](https://www.lattix.com/solutions/systems-engineering)
- [SERVICES](https://www.lattix.com/services) Open the submenu 
    - [OVERVIEW](https://www.lattix.com/services/#overview)
    - [ARCHITECTURAL CONSULTING](https://www.lattix.com/services/architecture-consulting)
    - [REFACTORING CONSULTING](https://www.lattix.com/refactoring-consulting)
    - [FUNCTIONAL SAFETY CONSULTING](https://www.lattix.com/services/functional-safety-consulting)
    - [CI DEVOPS SERVICES](https://www.lattix.com/services/ci-devops-services)
    - [SYSTEMS ENGINEERING SERVICES](https://www.lattix.com/services/systems-engineering-services)
- [RESOURCES](https://www.lattix.com/resources) Open the submenu 
    - [CASE STUDIES](https://www.lattix.com/resources/#casestudies)
    - [WHITEPAPERS](https://www.lattix.com/resources/#whitepapers)
    - [VIDEOS](https://www.lattix.com/resources/#videos)
    - [BLOG](https://www.lattix.com/enterprise-architecture-blog)
- [ABOUT](https://www.lattix.com/architecture-solutions-about) Open the submenu 
    - [MANAGEMENT](https://www.lattix.com/architecture-solutions-about/#management)
    - [FAQ](https://www.lattix.com/architecture-solutions-about/#faq)
    - [CONTACT US](https://www.lattix.com/architecture-solutions-about/#contact)
    - [EVENTS](https://www.lattix.com/architecture-solutions-about/events)
    - [PARTNERS](https://www.lattix.com/partners) Open the submenu 
          - [SERVICES PARTNERS](https://www.lattix.com/partners/services-partners)
          - [VALUE ADDED RESELLERS](https://www.lattix.com/partners/value-added-resellers)
          - [TECHNOLOGY PARTNERS](https://www.lattix.com/partners/technology-partners/parasoft) Open the submenu 
                  - [PARASOFT](https://www.lattix.com/partners/technology-partners/parasoft)
    - [PRIVACY POLICY](https://www.lattix.com/architecture-solutions-about/privacy-policy)

[Lattix Architect](https://blog.lattix.com/tag/lattix-architect)

# Why Cyclic Dependencies are a Problem

![Sean Barow](https://blog.lattix.com/hs-fs/hubfs/WIN_20170321_13_30_11_Pro.jpg?width=45&name=WIN_20170321_13_30_11_Pro.jpg) 

[Sean Barow](https://blog.lattix.com/author/sean-barow)

[Share this blog post on Twitter](https://twitter.com/intent/tweet?text=I+found+this+interesting+blog+post&url=https://blog.lattix.com/why-cyclic-dependencies-are-a-problem) [Share this blog post on Facebook](http://www.facebook.com/share.php?u=https://blog.lattix.com/why-cyclic-dependencies-are-a-problem) [Share this blog post on LinkedIn](http://www.linkedin.com/shareArticle?mini=true&url=https://blog.lattix.com/why-cyclic-dependencies-are-a-problem)

![](https://blog.lattix.com/hubfs/One%20Giant%20Component-2.jpg)

 

In software development, divide and conquer is a design strategy where you recursively break down a problem into two or more sub-problems, until the problem becomes simple enough to be solved directly. This is where software components (packages, assemblies, modules, classes, etc.) come into play. Components break up large blocks of code into smaller, more manageable pieces. One rule of thumb is a component should only include closely related code. This makes deployment and maintenance easier to manage. Ideally, you would like all components to be independent of each other, but inevitably some dependencies are necessary.

#### Levelization

Often we quantify code as “high-level” or “low-level”. This is a standard way of managing dependencies (levels). You have high-level layers and low-level layers. Each layer should depend only on the layers below it, not on any layer above it. If you are new to a codebase, it is often helpful to understand what the high-level code is and what the low-level code is.

This is helpful because you can make sure that low-level code does not inadvertently rely on high-level code. You can easily order your components using Lattix Architect by applying component partitioning to the DSM. This [levelization](https://www.amazon.com/Large-Scale-Software-Design-John-Lakos/dp/0201633620) is important because that is how you divide and conquer. First you divide the software into components, then you conquer by making sure there are no dependencies between components. In a typical embedded software system, there is usually a high-level communications layer, a middle hardware abstraction layer (HAL), and a low-level drivers layer. Here is a standard picture (standard layer):

![standard layer no cyclic dependency](https://www.lattix.com/wp-content/uploads/2019/07/StandardLayer2-171x300.jpg)

Having a dependency from the bottom layer to the top layer is a circular dependency (cyclic dependency)

![Cyclic Dependency](https://www.lattix.com/wp-content/uploads/2019/07/Cyclic-Dependency-122x300.jpg)

Because of the cyclic dependency, there is no layering between components. They are all on the same layer (one giant component).

![](https://blog.lattix.com/hubfs/One%20Giant%20Component-jpg.jpeg)

This has ruined the “divide and conquer” approach of having components. Instead of having three components, now you have one giant component that is three times larger and much more complicated and can not be developed or tested independently. (With [Lattix Architect](https://www.lattix.com/products-architecture-issues/#architect), it is easy to see cyclic dependencies in the DSM after it has been partitioned).

#### Why Cyclic Dependencies are Bad

Cyclic dependencies between components inhibit understanding, testing, and reuse (you need to understand both components to use either). This makes the system less maintainable because understanding the code is harder. Lack of understanding makes changes harder and more error-prone. Also, if components are in a circular dependency they are more difficult to test because they can not be tested separately. Cyclic dependencies can cause unwanted side effects in a software system. When you make a small change to a software system it can cause a ripple effect on other modules, which can have global ramifications (bugs, crashes, etc.). Finally, if two modules are tightly coupled and mutually dependent on each other, the reuse of an individual module becomes extremely difficult or even impossible.

#### Summary

Cyclic dependencies cause problems. If you find that components are in a cycle with each other, there are three things you can do:

1. Repackage them so they are no longer mutually dependent
2. Combine them into a single component
3. Think of them as if there were a single component

The best solution is to detect and correct cyclic dependencies as soon as they occur. You can do this by checking your architecture regularly. A tool like [Lattix Architect](https://www.lattix.com/products-architecture-issues/#architect) can help.

For more than 10 years, Lattix has helped refactor architecture, pinpoint problematic dependencies and  
manage the evolution of system design, supporting technologies such as C/C++, Java, .NET, Fortran, Ada, Javascript, Actionscript, Pascal, Python, UML/SysML, Rhapsody, Sparx EA, Oracle, SQLServer, Sybase, LDI and Excel.

 

![Sean Barow](https://blog.lattix.com/hs-fs/hubfs/WIN_20170321_13_30_11_Pro.jpg?width=150&name=WIN_20170321_13_30_11_Pro.jpg)

#### Sean Barow

[Follow me on my website](https://blog.lattix.com/www.lattix.com) [Follow me on LinkedIn](https://www.linkedin.com/in/sean-barow-0011bb1/) [Follow me on LinkedIn](https://twitter.com/lattixdsm)

Sean is Director of Sales and Marketing at Lattix.

### Leave a Comment

## Related Articles

[![](https://www.lattix.com/wp-content/uploads/2019/07/SystemStabilitySource-300x213.png)](https://blog.lattix.com/measure-your-software-architectural-health)

[Architecture](https://blog.lattix.com/tag/architecture)

### [The Importance of Measuring Your Software Architectural Health](https://blog.lattix.com/measure-your-software-architectural-health)

![Sean Barow](https://blog.lattix.com/hs-fs/hubfs/WIN_20170321_13_30_11_Pro.jpg?width=45&name=WIN_20170321_13_30_11_Pro.jpg) 

[Sean Barow](https://blog.lattix.com/author/sean-barow) 

[Read More](https://blog.lattix.com/measure-your-software-architectural-health)

[![](https://blog.lattix.com/hubfs/Imported%20sitepage%20images/ArchitecturalAnalysisPic.jpg)](https://blog.lattix.com/architecture-erosion-in-agile-development)

[Software Complexity](https://blog.lattix.com/tag/software-complexity)

### [Architecture Erosion in Agile Development](https://blog.lattix.com/architecture-erosion-in-agile-development)

Software architecture erosion refers to the gap between the planned and actual architecture of a software system as observed in its implementation.1

![Sean Barow](https://blog.lattix.com/hs-fs/hubfs/WIN_20170321_13_30_11_Pro.jpg?width=45&name=WIN_20170321_13_30_11_Pro.jpg) 

[Sean Barow](https://blog.lattix.com/author/sean-barow) 

[Read More](https://blog.lattix.com/architecture-erosion-in-agile-development)

#### PRODUCTS

- [LATTIX 2021](https://www.lattix.com)
- [LATTIX ARCHITECT](https://www.lattix.com/products/#architect)
- [LATTIX SUITE](https://www.lattix.com/products/#_lattix_suite)
- [CI/DEVOPS](https://www.lattix.com/products/#devops)
- [SUPPORTED TECHNOLOGIES](https://www.lattix.com/supported-technologies/)

#### SOLUTIONS

- [OVERVIEW](https://www.lattix.com/solutions/#overview)
- [ARCHITECTURE ANALYSIS](https://www.lattix.com/solutions/architecture-analysis)
- [CI DEVOPS](https://www.lattix.com/solutions/ci-devops)
- [ARCHITECTURAL REFACTORING](https://www.lattix.com/solutions/architectural-refactoring)
- [IMPROVE BUILD](https://www.lattix.com/solutions/improve-build)
- [IMPROVE TESTING](https://www.lattix.com/solutions/improve-testing)
- [COMPLIANCE](https://www.lattix.com/solutions/functional-safety-compliance)
- [SYSTEMS ENGINEERING](https://www.lattix.com/solutions/systems-engineering)

#### SERVICES

- [OVERVIEW](https://www.lattix.com/services/overview)
- [ARCHITECTURAL CONSULTING](https://www.lattix.com/services/architecture-consulting)
- [REFACTORING CONSULTING](https://www.lattix.com/refactoring-consulting)
- [FUNCTIONAL SAFETY CONSULTING](https://www.lattix.com/services/functional-safety-consulting)
- [CI DEVOPS SERVICES](https://www.lattix.com/services/ci-devops-services)
- [SYSTEMS ENGINEERING SERVICES](https://www.lattix.com/services/systems-engineering-services)

#### RESOURCES

- [CASE STUDIES](https://www.lattix.com/resources/#casestudies)
- [WHITEPAPERS](https://www.lattix.com/resources/#whitepapers)
- [VIDEOS](https://www.lattix.com/resources/#videos)
- [BLOG](https://www.lattix.com/enterprise-architecture-blog)

#### About

- [MANAGEMENT](https://www.lattix.com/architecture-solutions-about/#management)
- [FAQ](https://www.lattix.com/architecture-solutions-about/#faq)
- [CONTACT US](https://www.lattix.com/architecture-solutions-about/#contact)
- [EVENTS](https://www.lattix.com/architecture-solutions-about/events)
- [PARTNERS](https://www.lattix.com/partners)
- [PRIVACY POLICY](https://www.lattix.com/architecture-solutions-about/privacy-policy)

Follow us on Facebook Follow us on LinkedIn Follow us on Twitter Follow us on Instagram

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Sean Barow",
    "url" : "https://blog.lattix.com/author/sean-barow"
  },
  "dateModified" : "2022-07-27T19:07:38.091Z",
  "datePublished" : "2022-07-27T19:07:38.000Z",
  "headline" : "Why Cyclic Dependencies are a Problem",
  "image" : [ "https://blog.lattix.com/hubfs/One%20Giant%20Component-2.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.lattix.com/why-cyclic-dependencies-are-a-problem",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.lattix.com/hubfs/lattix-logo-1.jpg"
    },
    "name" : "Lattix"
  }
}
```