OdeToCode IC Logo

The Three Phases of OOP Matter

Wednesday, August 24, 2011

Gas

public static class Logger  {

    public static void Log(string message, LogTypeEnum type) {
        // ...
    }

}

 

Liquid

public class Logger  {

    public void LogError(Exception ex) {
        // ...
    }

}

 

Solid

public class Logger : ILog, IAudit  {

    public Logger(IExceptionFormatter exceptionFormatter,
                  IStackTraceFormatter stackTraceFormatter,
                  IClock clock,
                  ITextWriter writer) {
        // ...
    }

    public void LogError(Exception ex) {
        // ...
    }
}