![]() ![]() A cam belt is there only to synchronize the rotation of the crankshaft and the camshafts and so on.Įach of these components is atomic (unsplittable), self-contained and can be easily replaced. A spark plug exists only to ignite the fuel vapors. Even though the whole engine acts as a single unit, it consists of many components, each playing a specific role. In more simple language, this means that any given class should be responsible for only one specific functionality.īasically, your code should be structured like a car engine. Single responsibility principle states that, for every self-contained unit of code (which is, usually, a class), there should be one and only one reason to change. So, let’s go ahead and find out what it is and why you, as a developer, absolutely must know it. Arguably, it is also the most important principle from the list. ![]() Incidentally, as well as being the first principle in the abbreviation, it is also the one that is the easiest to grasp, the easiest to implement and the easiest to explain. I will explain it’s importance and provide some examples of it’s usage in C# code. In this particular post, we will focus on the first of these principles – single responsibility principle. For those who aren’t familiar with what they are, SOLID is an abbreviation that stands for the following: Every software developer who uses object-oriented programming languages needs to be familiar with SOLID software design principles and know how to apply them in their daily job. ![]()
0 Comments
Leave a Reply. |