# Dependency Inversion Principle

*noun*

say it: **“dih-PEN-dun-see in-VUR-zhun PRIN-suh-pul”** **/dɪˈpɛndənsi ɪnˈvɜrʒən ˈprɪnsəpəl/**

The principle that high-level code and low-level details should both depend on a promise, and that the promise belongs to the high-level code.

## What is **Dependency Inversion Principle**?

The **Dependency Inversion Principle** says important code should depend on interfaces, not on specific tools. `OrderService` depends on `IEmailSender`, not on a particular email company.

```csharp
public class OrderService
{
    private readonly IEmailSender email;   // an interface, not SendGridClient
    public OrderService(IEmailSender email) => this.email = email;
}
```

## In a sentence

- “The **dependency inversion principle** turned the arrows around: the email server now keeps a promise the report-card sender owns.”

Level: Freelancer · [More OOP terms at this level](https://www.ask-codey.com/glossary?category=oop&level=4)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/dependency-inversion-principle
