My TypeScript Software Design & Architecture book just prelaunched! Check out solidbook.io.
Close

The Dependency Rule

Updated Jul 30th, 2019 / 1 min read

About this...

A software architecture rule that specifies the relationship between layers, namely that an inner layer should never rely on anything from an outer layer.




The Dependency Rule

In Uncle Bob's book, he describes the dependency rule.

That rule specifies that something declared in an outer circle must not be mentioned in the code by an inner circle.

In other diagrams, there are many more layers. The rule still applies.

That means that code can only point inwards.

Domain Layer code can't depend on Infrastructure Layer code.

But Infrastructure Layer Code can depend on Domain Layer code (because it goes inwards).

When we follow this rule, we're essentially following the Dependency Inversion rule from the SOLID Principles.

0 Comments

Be the first to leave a comment

Submit