private static void TestFactory() { Console.WriteLine("Test Factory!"); var middlewareFactory = new MiddlewareFactory(); IMiddleware middleware = middlewareFactory.GetMiddleware((int)CommonObj.SQLEnum.SQLServer); middleware.DoAction(); middleware = middlewareFactory.GetMiddleware((int)CommonObj.SQLEnum.MySQL); middleware.DoAction(); }
public static void Main() { var middlewareFactory = new MiddleFactory(); IMiddleware middleware = middlewareFactory.GetMiddleware(1); middleware.DoAction(); middleware = middlewareFactory.GetMiddleware(2); middleware.DoAction(); }
static void main(string[] args) { var middlewayFactory = new MiddlewareFactory(); IMiddleware middleware = middlewayFactory.GetMiddleware(1); middleware.DoAction(); middleware = middlewayFactory.GetMiddleware(2); middleware.DoAction(); Console.Read(); }
static bool TestFactoryPattern() { Console.WriteLine("TESTING THE FACTORY DESIGN PATTERN: "); var middlewareFactory = new MiddlewareFactory(); IMiddleware middleware = middlewareFactory.GetMiddleware(1); middleware.DoAction(); middleware = middlewareFactory.GetMiddleware(2); middleware.DoAction(); return(true); }