Archives for OOP Lessons Learnt - Page 2
Abstract Factory in C# – Equally useful for manufacturing operations (services) and products
This article assumes some familiarity with the Factory pattern. The factory concept is equally useful for creating products (ProductFactory) or for creating services (ServiceFactory). A good way to start is…
Abstract Methods versus Virtual Methods
Both (abstract methods and virtual methods) offer similar functionality – when should you use virtual methods and when should you use abstract methods? Base Functionality Driven If you want a…
Large Method Signatures (too many arguments)
The Problem A recent project of mine had me looking at C# code which had been brought over from old C/C++ code. One of the first things that struck me…
Static qualifier at a class level versus member level (in C#)
The static qualifier is available at both the class level as well as the individual member level (both fields and methods) in C#. This article discusses when to use it…