OOP Pillars – Polymorphism in C#

Reading Time: 3 minutes Polymorphism is a concept where objects of different types are accessible via the same interface. In this post I talk about the third of the OOP Pillars – Polymorphism in C#. Please see my previous posts for the other OOP Pillars Inheritance and Encapsulation. Overview Polymosphism comes from the words Poly meaning many and Morph […]

OOP Pillars – Inheritance in C#

Reading Time: 3 minutes One of the most important principles of OOP is the DRY principle – Don’t Repeat Yourself. Inheritance is an aspect of OOP that facilitates code reuse and eliminates duplication. In this post I talk about the next of the OOP Pillars – Inheritance in C#. If you missed my previous post on Encapsulation, you can […]

OOP Pillars – Encapsulation in C#

Reading Time: 3 minutes In this article I talk about one of the first of the OOP Pillars – Encapsulation in C#. To fully understand encapsulation, you must have a basic knowledge of Classes in C#. Therefore, if you’re new to C# or need a refresher on Classes, please see my previous post on classes. Encapsulation is the concept […]

How to use Lazy initialization in C#

Reading Time: 3 minutes Background Lazy initialization (instantiation) is a technique to delay the creation of an object until the first time the application requires the object. This technique provides a mechanism to control when an object is created. Lazy initialization provides an advantage of improving performance by avoiding unnecessary computation and memory footprint. The most typical implementation of […]

C# Value Types performance problems and solutions.

Reading Time: 4 minutes Some years ago I worked on a project where I built a small rules engine. The rules runs anytime a user logs into the application and it deals with a fairly large amount of data. Therefore its performance is a key consideration. In this article I discuss: How Value Types are stored in memory How […]