# Decorator Pattern

A pattern that wraps an object to add behavior without changing its class.

## What is **Decorator Pattern**?

The **Decorator pattern** wraps an object to add behavior without changing its class, like adding whipped cream to a coffee order. Wrappers can be stacked.

```csharp
ICoffee order = new WhippedCream(new ExtraShot(new BasicCoffee()));
Console.WriteLine(order.Cost());
```

Level: Freelancer · [More OOP terms at this level](https://www.ask-codey.com/glossary/subjects/oop/freelancer)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/decorator-pattern
