Download the source code: [ Ссылка ]
There is an ever-lasting issue of extending the behavior of classes while not having to change their implementation. In this video, we delve into one of the solutions - the Decorator design pattern. A cornerstone of object-oriented design principles such as the Single Responsibility Principle, the Open Closed Principle, and the Liskov Substitution Principle, the Decorator pattern offers a powerful approach to modifying an object's behavior without changing its class.
The Decorator steps in to add or enhance the functionalities of an object around the execution of a specific method. That allows the object to continue performing its core role while the Decorator adds to or alters its behavior.
A significant advantage of the Decorator pattern is its ability to combat logic duplication. Through a meticulous application of the decorator in the demo code, we will remove duplicated clauses from all subject classes. The decorator will effectively add the shared responsibility uniformly across all the relevant implementations of an interface.
In essence, the Decorator stands as an intermediary, letting the original classes operate as intended while ensuring that shared logic (such as excluding certain conditions) is managed consistently across all instances.
By improving modularity and reducing duplication, this tool can significantly enhance the quality of your code. We encourage you to dive into this pattern and leverage it in your work.
Thank you so much for watching! Please like, comment & share this video as it helps me a ton!! Don't forget to subscribe to my channel for more amazing videos and make sure to hit the bell icon to never miss any updates.🔥❤️
✅🔔 Become a patron ► [ Ссылка ]
✅🔔 Subscribe ► [ Ссылка ]
⭐ Learn more from video courses:
Beginning Object-oriented Programming with C# ► [ Ссылка ]
⭐ Collections and Generics in C# ► [ Ссылка ]
⭐ Making Your C# Code More Object-oriented ► [ Ссылка ]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️ Have a look at our other Videos :
👉 Using GitHub Copilot to Write Complex Code | Step-by-step Tutorial ► [ Ссылка ]
👉 Coding with GitHub Copilot - Beginner to Master | VS Code Demo ► [ Ссылка ]
👉 What is Covariance and Contravariance in C# ► [ Ссылка ]
How to Initialize a Clean ASP.NET Core Project with Entity Framework Core and Identity ► [ Ссылка ]
👉 The Null Conundrum: A Guide to Optional Objects in C# ► [ Ссылка ]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⭐ CONNECT WITH ME 📱👨
🌐Become a patron ► [ Ссылка ]
🌐Buy me a Coffee ► [ Ссылка ]
🗳 Pluralsight Courses ► [ Ссылка ]
📸 Udemy Courses ► [ Ссылка ]
📸 Join me on Twitter ► [ Ссылка ]
🌐 Read my Articles ► [ Ссылка ]
📸 Join me on LinkedIn ► [ Ссылка ]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
👨 About Me 👨
Hi, I’m Zoran, I have more than 20 years of experience as a software developer, architect, team lead, and more. I have been programming in C# since its inception in the early 2000s. Since 2017 I have started publishing professional video courses at Pluralsight and Udemy and by this point, there are over 100 hours of the highest-quality videos you can watch on those platforms. On my YouTube channel, you can find shorter video forms focused on clarifying practical issues in coding, design, and architecture of .NET applications.❤️
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️RIGHT NOTICE:
The Copyright Laws of the United States recognize a “fair use” of copyrighted content. Section 107 of the U.S. Copyright Act states: “Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phono records or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright." This video and our youtube channel, in general, may contain certain copyrighted works that were not specifically authorized to be used by the copyright holder(s), but which we believe in good faith are protected by federal law and the Fair use doctrine for one or more of the reasons noted above.
⭐For copyright or any inquiries, please contact us at zh@codinghelmet.com
#csharp #dotnet #designpatterns
Ещё видео!