Reading Time: 3 minutesPolymorphism 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 […]
Category Archives: C#
OOP Pillars – Inheritance in C#
Reading Time: 3 minutesOne 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 minutesIn 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 minutesBackground 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 […]
Understanding Classes in C#
Reading Time: 4 minutesIn today’s article I discuss Classes in C#. Classes are the most fundamental programming construct in .Net and an essential part of the OOP paradigm. Therefore it is crucial to understand classes in order to fully understand OOP concepts. Definition Formally, a class is defined as a user-defined type that is composed of field data […]
C# Value Types performance problems and solutions.
Reading Time: 4 minutesSome 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 […]