# Dependency

*noun*

say it: **“dih-PEN-den-see”** **/dɪˈpɛndənsi/**

Something a class needs to do its job, such as a database, a clock or an email sender.

## What is **Dependency**?

A **dependency** is something a class needs in order to do its job, such as a database connection, an email sender or a clock.

```csharp
public class OrderService
{
    private readonly IEmailSender email; // a dependency

    public OrderService(IEmailSender email) => this.email = email;
}
```

## In a sentence

- “OrderService has two **dependencies**: the order repository and the email sender.”

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

Updated: November 9, 2026

## In other subjects

- [Dependency in C#](https://www.ask-codey.com/glossary/dependency-c-sharp)
- [Dependency in Java](https://www.ask-codey.com/glossary/dependency)
- [Dependency in JavaScript](https://www.ask-codey.com/glossary/dependency-javascript)

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