Course info
May 4, 2020
Your 10-day individual free trial includes:

Expert-led courses

Keep up with the pace of change with thousands of expert-led, in-depth courses.

In this course, C# Design Patterns: Singleton, you’ll learn to apply the Singleton design pattern to enforce single instance behavior for certain classes. First, you’ll explore the need for limiting the number of instances of certain classes. Next, you’ll discover how to use the Singleton pattern to enforce this behavior. Finally, you’ll learn how to apply other (potentially better) approaches to solving this same class of problems. When you’re finished with this course, you’ll have the skills and knowledge of the Singleton design pattern needed to address the need to ensure certain classes only have a single instance in your applications.

About the author
About the author

Steve Smith (@ardalis) is an entrepreneur and software developer with a passion for building quality software as effectively as possible.

More from the author
Working with C# Generics: Best Practices
2h 40m
Jun 4, 2021
Domain-Driven Design Fundamentals
4h 47m
May 14, 2021
Kanban: Getting Started
2h 16m
Jan 22, 2021
More courses by Steve Smith
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Steve Smith, aka @ardalis, and welcome to my course, C# Design Patterns: Singleton. I am an experienced .NET developer, architect, and trainer. My on‑site workshops and Pluralsight courses have helped thousands of developers and teams write better code faster. You'll find me online everywhere under the name @ardalis. Design patterns have fascinated me for years. They're like individual tools you can add to your toolkit as a software developer. They don't take long to introduce, but they can take a lot of practice to master. In this course, we are going to explore the singleton design pattern, one of the most well known, but also most often misused patterns. Some of the major topics that we will cover include what problem is the singleton pattern meant to solve? What are some different ways that we can implement the pattern, both good and bad? Why is the singleton pattern often referred to as an anti‑pattern? And what are some other ways we can achieve the same behavior without using the actual singleton pattern? By the end of this course, you'll be able to recognize situations where the singleton pattern makes sense and be able to apply it, or an alternative to it, with confidence. I hope you'll join me in learning about the singleton design pattern for C#, and I hope you'll continue exploring other design patterns as well, here on Pluralsight.