Tag: solid principles

  • An introduction to Single Responsibility principle (SRP)

    This is the fifth and last article describing SOLID principles. This article is about the Single Responsibility principle. Hopefully it will help you understand what the principle is all about and why it’s important to keep it in mind when designing and writing your code. What is the Single Responsibility principle? Here is the definition…

  • An introduction to Open Closed principle (OCP)

    This is the fourth article on SOLID principles which I started a few weeks ago. I hope this is useful for you and that it gives you a simple understanding of what the Open/Closed principle is all about. What is the Open Closed principle? Bertrand Meyer coined the term Open/Closed Principle which appeared in his book…

  • An introduction to Liskov substitution principle (LSP)

    This post is about the Liskov substitution principle (LSP). This is also the third of my posts about SOLID principles, following the posts I wrote about DI and ISP in the past few weeks. What is Liskov substitution principle (LSP)? This principle is based on Barbara Liskov’s definition of subtyping, commonly known as the Liskov substitution principle…

  • An introduction to Interface Segregation Principle (ISP)

    Last week I wrote a post about Dependency Injection (DI) with some basic examples in C#. Today I would like to write and offer a simple example of what is known as Interface Segregation Principle (ISP) which can happen if you are not careful when using and implementing interfaces in your code. What is Interface…

  • An introduction to Dependency Injection (DI) and Inversion of Control (IoC)

    There is so much confusion and arguing about what dependency injection is and whether is the same as inversion of control or just one form of it. If you are new to these terms it can be very confusing to say the least. I’ll try to describe what these are with some examples written in C# and…