Design Patterns: Open Closed Principle Explained Practically in C# (The O in SOLID)

IAmTimCorey April 2, 2018
Video Thumbnail
IAmTimCorey Logo

IAmTimCorey

@iamtimcorey

About

My goal is to make your life easier, specifically when it comes to learning software development. I remember what it was like to not know even what questions to ask. In every video I do, I try to answer those questions. You will notice that I don't usually do quick videos. That's because I would rather help you understand rather than just padding my watch percentages. If you want more in-depth training, feel free to head over to my website (https://www.iamtimcorey.com) where I have courses dedicated to C#, SQL, and more.

Video Description

When you are writing code, are you doing it right? That is a question that worries a lot of people, and it should probably at least be something every developer thinks through. Design patterns are best-practice concepts that we can implement into our code to make it better in some way. Think of them as guardrails that keep our code safe. In this video, we are going to look at the second entry in the famous SOLID principle. The O stands for Open Closed Principle. We are going to dive into what it means, how it should change our programming practices, and how far we should take it. Newsletter signup (with exclusive discounts): https://signup.iamtimcorey.com/ (your email will be kept safe and you will not be spammed). Source Code: https://www.iamtimcorey.com/downloads/?code=OInSOLID 0:00 - Intro 1:43 - Code behind demo application 5:36 - Open Closed Principle: when to apply 6:18 - Introducing changes in existing code base 18:20 - Identify the issues 21:40 - Implementing OCP: Use of interfaces 38:32 - Implementing OCP: Recap 40:46 - Summary 42:05 - Organizing the code base 43:55 - Note on Namespaces in folder structure 46:50 - Concluding remarks