Joseph

C# Delegation

C# delegation works like C/C++ function pointer (type safe). We can use delegation as the parameter of a method and pass them between methods. This helps the programmer to follow one of SOLID principles – OCP. By using delegation, we don’t have to write long and tedious if-else or switch statements. The example of using […]

C# Delegation Read More »

SQL CASE

When you are familiar with CASE, you can make your SQL statement more flexible and reduce redundant semantics. CASE can be categorized into two cases. One is simple case CASE   WHEN condition THEN result   [WHEN···]   [ELSE result] END; and the other one is searched case CASE expression   WHEN value THEN result   [WHEN···]   [ELSE

SQL CASE Read More »

SOLID principle – DIP

This article will introduce one of solid principles DIP which is the abbreviation of Dependency Inversion Principle. High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions Interpretation: Use abstraction rather than concrete object  Example: Say you go to

SOLID principle – DIP Read More »