liveBook · Manning

Upward dependency

As explained in Grokking Software Architecture

An upward dependency is a dependency from a lower software layer to a higher one.

An upward dependency occurs when a lower software layer depends on a higher one—for example, when an infrastructure repository directly updates a presentation-layer status label. section 4.3.2

That shortcut creates costly coupling:

  • It tangles responsibilities, makes the infrastructure layer harder to replace, and complicates isolated testing. section 4.3.2
  • It can also create circular dependencies, making the system brittle and difficult to understand. section 4.3.2

A lower layer can return data, such as a success value or saved object, to the Application Layer. The application service can then decide how to notify the presentation layer without reversing source-code dependencies. section 4.3.2

Figure 4.5 In a clean architecture, dependencies must only flow downward to the adjacent layer. Breaking this rule by "skipping" layers or creating upward dependencies (e.g., the Infrastructure Layer talking directly to the UI) creates a tangled web that makes the system impossible to test or modify without breaking everything.

The figure contrasts downward dependencies with upward and layer-skipping violations. section 4.3.2

How Grokking Software Architecture covers it

How deep it goes
Explains a repository-to-UI example, its consequences, and an Application Layer alternative.
Examples
Uses a repository that updates a UI status label and an Application Service that forwards returned data.
What you can do after
Evaluate whether a layer boundary creates tight coupling and route responses through the Application Layer instead.
How it connects
Connects to layered architecture, separation of concerns, replaceability, testability, and circular dependencies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.