SOLID is an acronym formed from the most basic, yet very important principles in OOP, defined by Robert C. Martin, back in 2000: 1. Single Responsibility 2. Open/Closed 3. Liskov Substitution 4. Interface Segregation 5. Dependency Inversion What I love about these principles are 2 things: Simple to understand and remember. They are compact, very concrete, with smallest […]
IT
IT Realm: coding adventures, architecture, best practices, geeky stuff…
SOLID – Single Responsibility
Def. A class should have only a single responsibility (Robert C. Martin) “S” in SOLID acronym stands for Single Responsibility Principle.The definition seems quite obvious, intuitive and simple. But it’s not.Let’s clarify it. In order to proceed, I will introduce 2 new terms: Business Responsibility is business requirement, functionality that describe public class’ interface. It usually comes from […]
Code Contracts & VS Extensibility
Many times I’ve seen repetitive and obsessive validation of input parameters.It may be a consequence of confusion in what “defensive programming” paradigm really is.I will give a simple example – Let’s say we have a following code snippet: So, this made me think – is this a good practice or upper code snippet is too “defensive”?I think it’s a bad practice […]
Covariance
Covariance & Contravariance are one of the most confusing terms in C#, no surprise it’s very popular for geeky questions in job interviews. Any time someone mentions those terms, it takes quite a while to refresh my knowledge about it. So, I decided to write a couple posts explaining them in the simplest and shortest […]
.NET API Browser
There is an excelent all-in-one .NET API browser.You use filters for .NET versions, .NET Core, Xamarin etc. https://docs.microsoft.com/en-us/dotnet/api/