Liskov Substitution Principle in C#
Among all the SOLID principles for object-oriented programming paradigm, the Liskov Substitution Principle is one of my favorites. This principle was created by Barbara Liskov and has the main objective of avoid throwing exceptions in a system when inheritance is not used in a recommended way. Additionally, this principle has the intention of facilitating the overall maintenance of the code over time, prevent the creation of complex hierarchies for classes. Inheritance in Object-Oriented Paradigm is the feature that allows us to reuse the implementation from a parent class across the system within child classes, which represents one of the main advantages of this paradigm. But, when we are designing classes for a particular domain that we are trying to solve or abstract, some good practices (or bad ones) can affect the overall maintainability of the software in long term.
Oct-28-2021, 11:10:07 GMT
- Technology: