Design Patterns in C# and .NET

Discover the modern implementation of design patterns with C# and .NET

4.55 (11876 reviews)
Udemy
platform
English
language
Programming Languages
category
instructor
83,328
students
20.5 hours
content
Mar 2022
last update
$99.99
regular price

What you will learn

Recognize and apply design patterns

Refactor existing designs to use design patterns

Reason about applicability and usability of design patterns

Description

Course Overview

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

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.

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.


Content

The SOLID Design Principles

Overview
Single Responsibility Principle
Open-Closed Principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency Inversion Principle
Summary

Builder

Gamma Categorization
Overview
Life Without Builder
Builder
Fluent Builder
Fluent Builder Inheritance with Recursive Generics
Functional Builder
Faceted Builder
Builder Coding Exercise
Summary

Factories

Overview
Point Example
Factory Method
Asynchronous Factory Method
Factory
Inner Factory
Abstract Factory
Abstract Factory and OCP
Factory Coding Exercise
Summary

Prototype

Overview
ICloneable is Bad
Copy Constructors
Explicit Deep Copy Interface
Copy Through Serialization
Prototype Coding Exercise
Summary

Singleton

Overview
Singleton Implementation
Testability Issues
Singleton in Dependency Injection
Monostate
Singleton Coding Exercise
Summary

Adapter

Overview
Vector/Raster Demo
Adapter Caching
Generic Value Adapter
Adapter in Dependency Injection
Adapter Coding Exercise
Summary

Bridge

Overview
Bridge
Bridge Coding Exercise
Summary

Composite

Overview
Geometric Shapes
Neural Networks
Composite Coding Exercise
Summary

Decorator

Overview
Custom String Builder
Adapter-Decorator
Multiple Inheritance with Interfaces
Multiple Inheritance with Default Interface Members
Dynamic Decorator Composition
Static Decorator Composition
Decorator in Dependency Injection
Decorator Coding Exercise
Summary

Façade

Overview
Façade
Facade Coding Exercise
Summary

Flyweight

Overview
Repeating User Names
Text Formatting
Flyweight Coding Exercise
Summary

Proxy

Overview
Protection Proxy
Property Proxy
Value Proxy
Composite Proxy: SoA/AoS
Composite Proxy with Array-Backed Properties
Dynamic Proxy for Logging
Proxy vs. Decorator
Proxy Coding Exercise
Summary

Chain of Responsibility

Overview
Command Query Separation
Method Chain
Broker Chain
Chain of Responsibility Coding Exercise
Summary

Command

Overview
Command
Undo Operations
Composite Command
Command Coding Exercise
Summary

Interpreter

Overview
Handmade Interpreter: Lexing
Handmade Interpreter: Parsing
ANTLR
Interpreter Coding Exercise
Summary

Iterator

Overview
Iterator Object
Iterator Method
Iterators and Duck Typing
Array-Backed Properties
Iterator Coding Exercise
Summary

Mediator

Overview
Chat Room
Event Broker
Introduction to MediatR
Mediator Coding Exercise
Summary

Memento

Overview
Memento
Undo and Redo
Memento for Interop
Memento Coding Exercise
Summary

Null Object

Overview
Null Object
Dynamic Null Object
Null Object Coding Exercise
Summary

Observer

Overview
Observer via the 'event' Keyword
Weak Event Pattern
Observable Properties and Sequences
Declarative Event Subscriptions with Interfaces
Observer Coding Exercise
Summary

State

Overview
Handmade State Machine
Switch-Based State Machine
State Machine with Stateless
State Coding Exercise
Summary

Strategy

Overview
Dynamic Strategy
Static Strategy
Equality and Comparison Strategies
Strategy Coding Exercise
Summary

Template Method

Overview
Template Method
Functional Template Method
Template Method Coding Exercise
Summary

Visitor

Overview
Intrusive Expression Printing
Reflection-Based Printing
Classic Visitor (Double Dispatch)
Dynamic Visitor via the DLR
Acyclic Visitor
Visitor Coding Exercise
Summary

Course Summary

Creational Paterns Summary
Structural Patterns Summary
Behavioral Patterns Summary
End of Course

Bonus Lectures

An ASCII C# String
Continuation Passing Style
Local Inversion of Control
DI Container and Event Broker Integration
Beyond the Elvis Operator
CQRS and Event Sourcing
Bonus Lecture: Other Courses at a Discount

Screenshots

Design Patterns in C# and .NET - Screenshot_01Design Patterns in C# and .NET - Screenshot_02Design Patterns in C# and .NET - Screenshot_03Design Patterns in C# and .NET - Screenshot_04

Reviews

Paweł
November 13, 2023
Wow! That was amazing! Great course, but definitelly this isn't for eveeyone. Yo must be at least intermediate in C#. Teacher also shows many interesting advenced C# topics.
Mustafa
October 29, 2023
I couldn't even continue watching!! I bought the course to learn, and I was expecting from the instructor to teach. What I found is someone is like reading a story and showing that he knows how to implement! Not clear, not organized and the worst course I bought ever!!
J.Subhashini
October 5, 2023
This course seems good to illustrate the Object Oriented Design Patterns and SOLID Principle.The topics are a little difficult to understand but explanation is appropriate.
Alexander
September 13, 2023
Course delivers on going through design patterns for the C# language with examples and homework that can be done at the end of each section. Definitely need a strong understanding of the C# language to understand the examples.
Ing.
September 6, 2023
The theme is showed on real examples in the way that we can easily understand. It contains the comments came from experience and prevention from often done bugs. Some of exercises are to liberal to do it, but it doesn't lower the value of the course.
Thibault
September 1, 2023
Some of the exercices are way too specific, and the tests cases are really not clear at all sometimes.
PATRICK
August 31, 2023
The extensive code examples add another layer of complexity to understanding the design patterns, which is not needed in my opinion. Easier examples should have been used, which would make it easier to understand the patterns. Also the presentation is not very suitable. It's mostly live-coding, but no images or diagrams are used for explaining these concepts.
Arles
August 26, 2023
Very great lecture. It's well presented and we have the ability to discover useful nuget package and F# which I'd never use. Thanks a lot !
Brad
August 15, 2023
Really, really clear and concise. Speaker may want to slow down a little to allow for the concepts to be understood... it seems he's rushing a bit.
Silviu
August 10, 2023
Amazing course! I got much more than expected. The author clearly knows what he is talking about. I didn't gave it a 5 star rating because my questions were not answered. As a suggestion: you should explain first what you want to achieve: what do you want to have in the Main method or at least what type of interaction you want there. I noticed that as the course progressed this was done better. I am a junior dev and this things are not so easily understood. I liked the coding exercises but I had problems with Udemy compiling valid code. I learned also a lot of C# concepts. I had to search most of them as you treat them as known but I think it's ok to be like this.
Peter
August 9, 2023
Great overview of design patterns. Good examples. Tutor is a bit fast, but you can rewind the video and listen again. I had issues understanding what needs to be done in the coding excercises.
Burak
August 8, 2023
This was a great course to start learning Design Patterns in depth. Even though most examples also work in .Net Core, there are still examples that don't. I think there should be alternatives for these cases, other than that I enjoyed the course a lot although there were times it was hard to understand
Barış
June 14, 2023
I have to say that even some of the patterns I'm familiar with or confident seem extremely complex and almost out of context at some point. Some implementations are not even possible without paid plugins from certain IDEs. This course is far from teaching the idea behind design patterns. It's more like trying out extreme ideas that hardly ever need to be implemented at any given time. I wouldn't say it's completely pointless, but it doesn't help to learn and develop the ideas of design patterns.
Shashank
March 11, 2023
I feel examples in this course Like Foo() class does not make any sense to understand real world example. Rather examples should be some practical real world examples Like CreditCardClass , PaymentClass etc . BuilderPattern- Design ReportBuilder, ReportDirector etc it make sense to give such examples Its more easy to learn and understand the content. No Offense please
Roberto
January 30, 2023
A didática deixa a desejar, pois a explicação é feita de uma forma que não leva o aluno a pensar. Os exercícios exigem muito menos do que é exposto nas videoaulas

Charts

Price

Design Patterns in C# and .NET - Price chart

Rating

Design Patterns in C# and .NET - Ratings chart

Enrollment distribution

Design Patterns in C# and .NET - Distribution chart
1148688
udemy ID
3/17/2017
course created date
7/31/2019
course indexed date
Bot
course submited by