Suggest an editImprove this articleRefine the answer for “What does the "dependency rule" mean?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)The **Dependency Rule** is the core principle of Clean Architecture stating that all dependencies point inward, toward the center of the architecture: inner layers (business logic) know nothing about outer ones (infrastructure, UI, frameworks). **Key point:** an inner layer depends not on specific technologies but only on abstractions (interfaces) defined within itself.Shown above the full answer for quick recall.Answer (EN)ImageThe **Dependency Rule** is the core principle of **Clean Architecture** that defines the direction of dependencies between the system's layers. --- ### The essence of the rule > **All dependencies point inward, toward the center of the architecture.** > > Inner layers (business logic) must know nothing about outer ones (infrastructure, UI, frameworks). --- ### What it looks like ```javascript [ Frameworks & UI ] ↓ [ Interface Adapters ] ↓ [ Use Cases ] ↓ [ Entities ] ``` - Code in an **outer** layer can call into an **inner** one. - An inner layer must not depend on an outer one, only on **abstractions (interfaces)** defined within itself. --- ### Example - **Allowed:** a controller calls `CreateOrderUseCase`. - **Not allowed:** `CreateOrderUseCase` uses `Django ORM` or `Flask` directly. Instead, the use case calls the `OrderRepository` abstraction, and an adapter (an outer layer) implements that interface using a specific technology. --- ### Why it matters 1. **Isolate business logic from frameworks.** 2. **Make the system independent of external changes.** 3. **Make testing and technology replacement easier.** --- **Summary:** > The **Dependency Rule** states that dependencies always point **from details to abstractions**, > and **from outer to inner**, so the system's core stays stable, clean, and independent.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.