---
title: "Design Patterns in C#"
url: "https://osherove.com/blog/2003/3/27/design-patterns-in-c.md"
canonical: "https://osherove.com/blog/2003/3/27/design-patterns-in-c.html"
published: "2003-03-27T09:27:00"
updated: "2003-03-27T09:27:00"
tags: []
author: "Roy Osherove"
description: "The data & object factory folks have a pretty cool list of design patterns all in C#. It looks like a comprehensive list drawn from the Gang of Four book . [ StronglyTyped ] Cool! The actual source for each pattern is…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Design Patterns in C\#

By Roy Osherove March 27, 2003

**Historical article** · Originally published March 27, 2003; technical details may be outdated.

The [data & object factory](http://www.dofactory.com/default.aspx) folks have a pretty cool list of [](http://www.dofactory.com/Patterns/Patterns.aspx#list)design patterns all in C#. It looks like a comprehensive list drawn from the [Gang of Four book](http://hillside.net/patterns/DPBook/DPBook.html).

\[[StronglyTyped](http://www.stronglytyped.com/#200053397)\]

Cool!

The actual source for each pattern is located [here](http://www.dofactory.com/Patterns/Patterns.aspx). Would it be naughty of me to just paste the whole thing..? for the actual links you'll need to go to their site though :)

<table><tbody><tr><td colspan="2">&nbsp;&nbsp;<b>Creational Patterns</b></td></tr><tr><td>&nbsp;&nbsp;Abstract Factory</td><td>&nbsp;&nbsp;Creates an instance of several families of classes</td></tr><tr><td>&nbsp;&nbsp;Builder</td><td>&nbsp;&nbsp;Separates object construction from its representation</td></tr><tr><td>&nbsp;&nbsp;Factory Method</td><td>&nbsp;&nbsp;Creates an instance of several derived classes</td></tr><tr><td>&nbsp;&nbsp;Prototype</td><td>&nbsp;&nbsp;A fully initialized instance to be copied or cloned</td></tr><tr><td>&nbsp;&nbsp;Singleton</td><td>&nbsp;&nbsp;A class of which only a single instance can exist</td></tr></tbody></table>

<table><tbody><tr><td colspan="2">&nbsp;&nbsp;<b>Structural Patterns</b></td></tr><tr><td>&nbsp;&nbsp;Adapter</td><td>&nbsp;&nbsp;Match interfaces of different classes</td></tr><tr><td>&nbsp;&nbsp;Bridge</td><td>&nbsp;&nbsp;Separates an object’s interface from its implementation</td></tr><tr><td>&nbsp;&nbsp;Composite</td><td>&nbsp;&nbsp;A tree structure of simple and composite objects</td></tr><tr><td>&nbsp;&nbsp;Decorator</td><td>&nbsp;&nbsp;Add responsibilities to objects dynamically</td></tr><tr><td>&nbsp;&nbsp;Façade</td><td>&nbsp;&nbsp;A single class that represents an entire subsystem</td></tr><tr><td>&nbsp;&nbsp;Flyweight</td><td>&nbsp;&nbsp;A fine-grained instance used for efficient sharing</td></tr><tr><td>&nbsp;&nbsp;Proxy</td><td>&nbsp;&nbsp;An object representing another object</td></tr></tbody></table>

<table><tbody><tr><td colspan="2">&nbsp;&nbsp;<b>Behavioral Patterns</b></td></tr><tr><td>&nbsp;&nbsp;Chain of Resp.</td><td>&nbsp;&nbsp;A way of passing a request between a chain of objects</td></tr><tr><td>&nbsp;&nbsp;Command</td><td>&nbsp;&nbsp;Encapsulate a command request as an object</td></tr><tr><td>&nbsp;&nbsp;Interpreter</td><td>&nbsp;&nbsp;A way to include language elements in a program</td></tr><tr><td>&nbsp;&nbsp;Iterator</td><td>&nbsp;&nbsp;Sequentially access the elements of a collection</td></tr><tr><td>&nbsp;&nbsp;Mediator</td><td>&nbsp;&nbsp;Defines simplified communication between classes</td></tr><tr><td>&nbsp;&nbsp;Memento</td><td>&nbsp;&nbsp;Capture and restore an object's internal state</td></tr><tr><td>&nbsp;&nbsp;Observer</td><td>&nbsp;&nbsp;A way of notifying change to a number of classes</td></tr><tr><td>&nbsp;&nbsp;State</td><td>&nbsp;&nbsp;Alter an object's behavior when its state changes</td></tr><tr><td>&nbsp;&nbsp;Strategy</td><td>&nbsp;&nbsp;Encapsulates an algorithm inside a class</td></tr><tr><td>&nbsp;&nbsp;Template Method</td><td>&nbsp;&nbsp;Defer the exact steps of an algorithm to a subclass</td></tr><tr><td>&nbsp;&nbsp;Visitor</td><td>&nbsp;&nbsp;Defines a new operation to a class without change</td></tr></tbody></table>


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
