<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-dependency-rule-lrwnug8yh" -->

---
title: The Dependency Rule | daily.dev
description: Explains Uncle Bob&#x27;s Dependency Rule from Clean Architecture, which states that code dependencies must only point inward — inner layers cannot depend on outer...
canonical: https://daily.dev/posts/the-dependency-rule-lrwnug8yh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Dependency Rule | daily.dev
og:description: Explains Uncle Bob&#x27;s Dependency Rule from Clean Architecture, which states that code dependencies must only point inward — inner layers cannot depend on outer...
og:url: https://daily.dev/posts/the-dependency-rule-lrwnug8yh
og:image: https://api.daily.dev/og/posts/LRwNUg8yH.png
og:image:alt: The Dependency Rule
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Dependency Rule

**[Khalil Stemmler](https://daily.dev/sources/khalilstemmler)** · 5 min read · 0 upvotes · 0 comments

## Summary

Explains Uncle Bob's Dependency Rule from Clean Architecture, which states that code dependencies must only point inward — inner layers cannot depend on outer layers. Covers how this applies to Domain, Application (Use Case), and Infrastructure layers, with TypeScript code examples showing a violation and its fix via dependency inversion. Also introduces the Ports and Adapters pattern as a practical application of the rule.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://khalilstemmler.com/wiki/dependency-rule>

## Similar posts on daily.dev

- [Clean Architecture Explained: Building Software That Stands the Test of Time](https://daily.dev/posts/clean-architecture-explained-building-software-that-stands-the-test-of-time-acdblphuf) · Medium · 1 upvotes · 0 comments
- [A Dependency Is Not Just a Relationship Where One Piece of Code Uses Another](https://daily.dev/posts/a-dependency-is-not-just-a-relationship-where-one-piece-of-code-uses-another-ifwuvqqsh) · Medium · 1 upvotes · 1 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#typescript](https://daily.dev/tags/typescript), [#domain-driven-design](https://daily.dev/tags/domain-driven-design)

[View this post on daily.dev](https://daily.dev/posts/the-dependency-rule-lrwnug8yh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Dependency Rule","url":"https://daily.dev/posts/the-dependency-rule-lrwnug8yh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-dependency-rule-lrwnug8yh"},"datePublished":"2026-06-17T11:25:54.147Z","dateModified":"2026-06-17T11:29:39.244Z","description":"Explains Uncle Bob's Dependency Rule from Clean Architecture, which states that code dependencies must only point inward — inner layers cannot depend on outer...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/201faa07600acaac86e41c2c9af2a9ec?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/201faa07600acaac86e41c2c9af2a9ec?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Khalil Stemmler","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Khalil Stemmler","logo":"https://media.daily.dev/image/upload/s--q08_7jGC--/f_auto,q_auto/v1781695534/logos/khalilstemmler?_a=BAMAMiWQ0","url":"https://daily.dev/sources/khalilstemmler"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-dependency-rule-lrwnug8yh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,typescript,domain-driven-design","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Khalil Stemmler","item":"https://daily.dev/sources/khalilstemmler"},{"@type":"ListItem","position":3,"name":"The Dependency Rule"}]}
```

