45 subscribers








OOP Lessons Learnt
  |  Technology  |  Science Stuff  |  Travel  |  Entertainment  |  Buddhism  |  Finance and Investing  |  Austin  |  India  |  Diet, Health  |  Petitions, Causes  |  

Interfaces, abstract classes, c# OOP

The Problem Statement
Imagine that you have just built a sophisticated application to work against a SQL Server database. You followed a best-practices approach and separated out your presentation, business logic and data access layer. Your application is service oriented – … Continue reading


Refactoring Interfaces– separating concerns | Posted on by Anuj Varma

Interfaces are the starting point for designing any service oriented architecture – whether they be externally facing web services or internally facing local services. Hence, the correct design of interfaces is an important step in achieving scalability down the road. … Continue reading


Say you have a set of services that your application (the server side) exposes. These could be categorized by feature:

Account Service – contains methods for Creation, Deletion, Updating of Account Info
Security Service – contains methods for authenticating users, controlling access … Continue reading


If there was a pattern that could be used just about anywhere, in any situation – and still work, what would that pattern be? For me, the answer is the State Pattern. Using a couple of simple modeling scenarios (modeling … Continue reading


Command Pattern to the rescue | Posted on by Anuj Varma

Recently, I was asked to take an existing library of methods (written in c#) that worked against a particular platform (say Oracle on the backend) and build an equivalent set to work against another platform (say SQLServer).  The methods were … Continue reading


Property Bags–A Life Saver for the practicing OO Developer | Posted on by Anuj Varma

(Full Source Code Available at the end of this article)
The basic idea is simple enough – you have a type (class) with certain properties that is being used by various consumers.  The type represents some entity – say ‘Employee’. Let … Continue reading


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 to look at what the client really needs from the … Continue reading


Abstract Methods versus Virtual Methods | Posted on by Anuj Varma

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 base behavior as the default behavior and allow child behavior to override … Continue reading


Large Method Signatures (too many arguments) | Posted on by Anuj Varma

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 was the sheer number of arguments in each method. It wasn’t … Continue reading


Static qualifier at a class level versus member level (in C#) | Posted on by Anuj Varma

static class static members c#, when to use static in c# Continue reading