C-Sharp Design Patterns Decorator
This course presents one of the classic Gang of Four patterns: the Decorator. The Decorator pattern allows you to dynamically add functionality to classes without changing the target clas...
Prerequisites: You must be comfortable with object-oriented concepts in C#, particularly the use of interfaces.
The Decorator Pattern is a Gang of Four structural design pattern that allows you to dynamically add behavior to a class without making changes to it. Adding this behavior via the Decorator pattern allows you to maintain a strong separation of concerns in your code base, while giving you the flexibility to add, remove, or reorder behaviors as needed.
Since the Decorator class implements the same interface as the original Component object, there is no need to modify the calling code. So you can override this whole object structure where you previously used a simple WeatherService.
Sign in to read this course
A free account unlocks all 514 courses. 20 are readable without one.
What's inside
10 sections- 1 Table of Contents
- 2 Course Overview
- 3 The Decorator pattern — Fundamental concepts
- 4 Creating your first Decorator
- 5 Using Multiple Decorators Together
- 6 Using Decorators with Dependency Injection
- 7 The Decorator Pattern in .NET itself
- 8 Use cases and best practices
- 9 Structure of the demonstration project
- 10 Summary and conclusion
More Testing, Patterns & Architecture courses
View all 29ASP.NET Core Clean Architecture
Implement Clean Architecture with the GloboTicket app — core, infrastructure, API, Blazor UI and testing.
Automation Testing Strategies with ASP.NET Core
Unit, integration, UI, E2E (Playwright) and performance (NBomber) testing in a CI/CD pipeline.
Unit Testing an ASP.NET Core MVC Web Application
Unit test MVC controllers with xUnit, Moq and FluentAssertions — isolation, mocking and CI/CD.
Debugging and Error Handling in ASP.NET Core
Debugging tools, error-handling middleware, Problem Details, custom exceptions and remote debugging.
Logging and Monitoring in ASP.NET Core
ILogger, structured logging, providers, scopes, source generators, health checks and OpenTelemetry.
C-Sharp 8 Design Patterns Composite
This course covers the Composite design pattern in C#. The Composite pattern provides a way to work with tree structures in a consistent manner, regardless of whether you are manipulating...
Interested in this course?
Contact us to book it or get a custom training plan for your team.