Skip to main content

Design Patterns in C# and .NET

20h 15m 1s
English
Free

Course description

Discover the modern implementation of design patterns with C# and .NET. This course provides an overview of all the Gang of Four (GoF) design patterns as outlined in their seminal book, together with modern-day variations, adjustments, discussions of intrinsic use of patterns in the language.
Read more about the course

This course provides a comprehensive overview of Design Patterns in C# and .NET from a practical perspective. This course in particular covers patterns with the use of:

  • The latest versions of C# and the .NET framework
  • Use of modern programming approaches: dependency injection, reactive programming and more
  • Use of modern developer tools such as ReSharper
  • Discussions of pattern variations and alternative approaches

What are Design Patterns?

Design Patterns are reusable solutions to common programming problems. They were popularized with the 1994 book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, John Vlissides, Ralph Johnson and Richard Helm (who are commonly known as a Gang of Four, hence the GoF acronym).

The original book was written using C++ and Smalltalk as examples, but since then, design patterns have been adapted to every programming language imaginable: C#, Java, PHP and even programming languages that aren't strictly object-oriented, such as JavaScript.

The appeal of design patterns is immortal: we see them in libraries, some of them are intrinsic in programming languages, and you probably use them on a daily basis even if you don't realize they are there.

What Patterns Does This Course Cover?

This course covers all the GoF design patterns. In fact, here's the full list of what is covered:

  • SOLID Design Principles: Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion Principle
  • Creational Design Patterns: Builder, Factories (Factory Method and Abstract Factory), Prototype and Singleton
  • Structrural Design Patterns: Adapter, Bridge, Composite, Decorator, Façade, Flyweight and Proxy
  • Behavioral Design Patterns: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Null Object, Observer, State, Strategy, Template Method and Visitor

Who Is the Course For?

This course is for .NET/C# developers who want to see not just textbook examples of design patterns, but also the different variations and tricks that can be applied to implement design patterns in a modern way. For example, the introduction of the DLR allows us to use an ImpromptuObject, so that our DynamicObject exposes any interface we desire. This allows for dynamic programming, and many design patterns are presented in terms of their static and DLR-based variations.

Presentation Style

This course is presented as a (very large) series of live demonstrations being done in Microsoft Visual Studio. Most demos are single-file, so you can download the file attached to the lesson and run it in Visual Studio, Visual Studio Code, Rider or another IDE of your choice.

This course does not use UML class diagrams; all of demos are live coding. I use Visual Studio, various NuGet packages, R# unit test runner and even dotMemoryUnit.

Requirements:
  • Good understanding of C#
  • Familiarity with latest C# features
  • Good understanding of object-oriented design principles
Who this course is for:
  • Beginner and experienced developers
  • Anyone interested in design patterns

What you'll learn:

  • Recognize and apply design patterns
  • Refactor existing designs to use design patterns
  • Reason about applicability and usability of design patterns

Watch Online

0:00 0:00
#Lesson TitleDuration
1Introduction07:13
2Overview01:17
3Single Responsibility Principle07:31
4Open-Closed Principle17:25
5Liskov Substitution Principle06:38
6Interface Segregation Principle06:34
7Dependency Inversion Principle11:12
8Summary05:26
9Gamma Categorization03:38
10Overview01:44
11Life Without Builder03:35
12Builder09:07
13Fluent Builder01:17
14Fluent Builder Inheritance with Recursive Generics12:38
15Stepwise Builder09:01
16Functional Builder10:21
17Faceted Builder11:12
18Summary00:59
19Overview02:23
20Point Example04:39
21Factory Method05:04
22Asynchronous Factory Method05:03
23Factory03:00
24Object Tracking and Bulk Replacement12:02
25Inner Factory05:43
26Abstract Factory11:22
27Abstract Factory and OCP09:53
28Summary01:06
29Overview02:00
30ICloneable is Bad07:38
31Copy Constructors03:56
32Explicit Deep Copy Interface02:35
33Prototype Inheritance20:25
34Copy Through Serialization09:06
35Summary01:09
36Overview02:45
37Singleton Implementation08:41
38Testability Issues07:23
39Singleton in Dependency Injection08:59
40Monostate03:47
41Per-Thread Singleton04:26
42Ambient Context12:27
43Summary02:16
44Overview02:37
45Vector/Raster Demo08:36
46Adapter Caching06:05
47Generic Value Adapter25:19
48Adapter in Dependency Injection09:08
49Summary01:11
50Overview02:51
51Bridge09:51
52Summary01:34
53Overview01:54
54Geometric Shapes07:34
55Neural Networks08:01
56Composite Specification05:59
57Summary01:12
58Overview02:35
59Custom String Builder06:20
60Adapter-Decorator06:34
61Multiple Inheritance with Interfaces08:41
62Multiple Inheritance with Default Interface Members07:45
63Dynamic Decorator Composition07:40
64Detecting Decorator Cycles22:03
65Static Decorator Composition09:31
66Decorator in Dependency Injection06:12
67Summary02:03
68Overview03:10
69Façade08:00
70Summary01:26
71Overview05:25
72Repeating User Names12:30
73Text Formatting08:54
74Summary00:59
75Overview03:13
76Protection Proxy03:12
77Property Proxy09:25
78Value Proxy12:06
79Composite Proxy: SoA/AoS11:31
80Composite Proxy with Array-Backed Properties06:43
81Dynamic Proxy for Logging11:51
82Proxy vs. Decorator01:28
83ViewModel08:43
84Bit Fragging25:05
85Summary00:56
86Overview03:34
87Command Query Separation01:29
88Method Chain12:16
89Broker Chain13:51
90Summary01:19
91Overview03:07
92Command07:48
93Undo Operations06:06
94Composite Command12:12
95Summary01:10
96Overview04:01
97Handmade Interpreter: Lexing07:53
98Handmade Interpreter: Parsing12:06
99ANTLR02:45
100Summary01:04
101Overview01:43
102Iterator Object11:50
103Iterator Method06:58
104Iterators and Duck Typing04:07
105Array-Backed Properties05:52
106Summary01:29
107Overview01:14
108Chat Room10:43
109Event Broker15:31
110Introduction to MediatR13:21
111Summary01:17
112Overview01:42
113Memento06:05
114Undo and Redo07:16
115Memento for Interop06:39
116Summary01:18
117Overview01:59
118Null Object08:54
119Null Object Singleton05:09
120Dynamic Null Object06:12
121Summary00:42
122Overview02:12
123Observer via the 'event' Keyword07:10
124Weak Event Pattern08:26
125Observer via Special Interfaces18:29
126Observable Collections09:46
127Bidirectional Observer14:49
128Property Dependencies13:31
129Declarative Event Subscriptions with Interfaces27:09
130Summary00:57
131Overview03:10
132Classic Implementation12:33
133Handmade State Machine06:45
134Switch-Based State Machine06:39
135Switch Expressions08:50
136State Machine with Stateless05:38
137Summary01:01
138Overview01:51
139Dynamic Strategy08:26
140Static Strategy04:08
141Equality and Comparison Strategies07:42
142Summary00:27
143Overview01:31
144Template Method07:24
145Functional Template Method03:39
146Summary00:46
147Overview04:47
148Intrusive Visitor04:42
149Reflective Visitor09:11
150Classic Visitor (Double Dispatch)10:22
151Reductions and Transforms14:25
152Dynamic Visitor via the DLR07:12
153Acyclic Visitor12:02
154Summary01:10
155Creational Paterns Summary04:42
156Structural Patterns Summary06:14
157Behavioral Patterns Summary08:49
158End of Course00:55
159An ASCII C# String13:59
160Continuation Passing Style11:08
161Local Inversion of Control17:44
162DI Container and Event Broker Integration10:12
163Beyond the Elvis Operator14:48
164CQRS and Event Sourcing26:43
165Overview05:11
166Builder04:58
167Decorator04:40
168Factory08:16
169Interpreter09:59
170Strategy05:39
171Template Method10:07
172Summary02:56

Comments

0 comments

Want to join the conversation?

Sign in to comment

Similar courses

Fullstack ASP.NET Core and React Masterclass | Learnify

Fullstack ASP.NET Core and React Masterclass | Learnify

Sources: fullstack.io
Learnify is a self-paced, online Masterclass, where you will master ASP.NET CORE and React by building a practical, real-world application from scratch.
20 hours 40 minutes 31 seconds
Pragmatic Clean Architecture

Pragmatic Clean Architecture

Sources: Milan Jovanović
This comprehensive course will teach you the system I use to ship production-ready applications using Clean Architecture. Learn how to apply the best practices of modern softwar...
6 hours 21 minutes 27 seconds
.NET Logging Done Right: An Opinionated Approach Using Serilog

.NET Logging Done Right: An Opinionated Approach Using Serilog

Sources: pluralsight
Establishing a foundational framework for logging can save hours in troubleshooting and provide valuable insights to both utilization and performance within all of your applicat...
5 hours 2 minutes 40 seconds