Simplifying the Liskov Substitution Principle of SOLID in C#

Before I start writing this article, I want to thank Steve Smith for his great course on the same topic with Pluralsight. This post is inspired by that course. Read full article on the Infragistics blog here The Liskov Substitution Principle says that the object of a derived class should be able to replace an…… Continue reading Simplifying the Liskov Substitution Principle of SOLID in C#

C# basics: why we override Equals method

You may have come across questions, Why to override Equals method? How to determine whether two object are equal? How to determine whether two objects are identical? To get answer of all the above questions, let us consider Product class as listed next:   We are creating two instances of the Product class, foo and…… Continue reading C# basics: why we override Equals method

C-Sharp Basics: What is Checked and Unchecked operations

You may have come across questions, What is checked and unchecked primitive operations? How to handle overflow in C-Sharp? Does CLR handles overflow or developers? So let us start with understanding a program. Consider the code listed below:   On running you will get 44 as the output. There is one serious observation about the…… Continue reading C-Sharp Basics: What is Checked and Unchecked operations

Decorator Pattern in C#

Read full article on Falafel blog “Decorator pattern attach additional functionalities or responsibilities to an existing object at the runtime”. It adds new behaviour to an individual object without affecting other objects of the same class. New behaviour or functionalities can be either added dynamically at the run time or statically. The decorator pattern: ·…… Continue reading Decorator Pattern in C#