Posts

Showing posts from July, 2020

SOLID Principles With .NET - Open Closed Principle

Image
The Open Closed Principle           is the SOLID principle which states that the software entities (classes or methods) should be open for extension but closed for modification. Open for extension but closed for modification ? Oh what does it really mean ?  In real time every business requirements changes so frequently, so while developing an application we should strive to write a code that doesn't require modification every time  business changes it requirement. The biggest benefit for an application to be adhered to OCP is, it potentially streamlines code maintenance and reduces the risk of breaking the existing implementation. Here , I will show you how we can implement a requirement with and without OCP rules.  This article is divided into the following sections :  Banking Service - Without  OCP   Example - Without  OCP  implemented  Conclusion     So let's start  Banking Service C...

SOLID Principles

SOLID PRINCIPLES  SOLID is an acronym for 5 important design principles when doing OOP (Object Oriented Programming) Solid Principles are the design principles that enables us to manage most of the software design problems. These principles provide us the way to move from tightly coupled code and little encapsulation to the desired results of loosely coupled and encapsulated real needs of business properly.   Every SOLID principle can be misused and overused . So be sure that as developer make sure to use them when there is need for clean code base on priority .  As said , SOLID is acronym and each of the letters in it stands for :  S -  Single Responsibility Principle (SRP) O - Open Closed Principle (OCP) L -  Liskov Substitution Principle (LSP) I  -  Interface Segregation Principle(ISP) D - Dependency Inversion Principle (DIP) Following this article , next throughout these articles each principle is explained with an explain with and withou...