Active vs Commented Implementations

This code file demonstrates three different architectural approaches to building a database operation system with logging capabilities. Let's analyze each approach in detail.

Structure Overview

The file contains three distinct implementations:

  1. Active Code: Delegate-based logging approach (currently running)
  2. First Commented Section: Direct logging approach using abstract base class
  3. Second Commented Section: Interface-based approach with direct logging

1. ACTIVE CODE - Delegate-Based Approach (Lines 1-150)

Core Components

Program Class - Entry Point

static void Main(string[] args)
{
    Console.WriteLine("1: SQL , 2: MYSQL");
    int choice = Convert.ToInt32(Console.ReadLine());

    DBFactory dBFactory = new DBFactory();
    Database database = dBFactory.GetDatabase(choice);

    MyDelegate pointer = new MyDelegate(Logger.CurrentLogger.Log);
    database.Update(pointer);
}

Key Features:

MyDelegate - Function Pointer

public delegate void MyDelegate(string message);

Purpose: