본문 바로가기

C# design patterns4

15# ChainOfResponsibility 패턴 Behavioral Patterns static void Main(string[] args) { //BuilderExample(); //FactoryExample(); //FactoryMethodExample(); //FactoryMethodExample2(); //ProtoTypeExample(); //SingletonExample(); //AdapterExample(); //BridgeExample(); //CompositeExample(); //DecoratorExample(); //FacadeExample(); //FlyweightExample(); //ProxyExample(); ChainOfResponsibilityExample(); //Console.WriteLine("Hello World!"); Console.ReadKey(.. 2019. 6. 19.
14# Proxy패턴 Structural Patterns static void Main(string[] args) { //BuilderExample(); //FactoryExample(); //FactoryMethodExample(); //FactoryMethodExample2(); //ProtoTypeExample(); //SingletonExample(); //AdapterExample(); //BridgeExample(); //CompositeExample(); //DecoratorExample(); //FacadeExample(); //FlyweightExample(); ProxyExample(); //Console.WriteLine("Hello World!"); Console.ReadKey(); } static void ProxyExample() { .. 2019. 6. 19.
06# Prototype 패턴 Creational Patterns static void Main(string[] args) { //BuilderExample(); //FactoryExample(); //FactoryMethodExample(); //FactoryMethodExample2(); ProtoTypeExample(); //Console.WriteLine("Hello World!"); Console.ReadKey(); } static void ProtoTypeExample() { ColorManager colorManager = new ColorManager(); colorManager["red"] = new Color(255, 0, 0); colorManager["green"] = new Color(0, 255, 0); colorManager["blue"] =.. 2019. 5. 23.
05# Factory Method 패턴2 Creational Patterns static void Main(string[] args) { //BuilderExample(); //FactoryExample(); //FactoryMethodExample(); FactoryMethodExample2(); //Console.WriteLine("Hello World!"); Console.ReadKey(); } static void FactoryMethodExample2() { LogManager logManager = new LogManager(); logManager.AddLog(typeof(Human).Name, new Human()); logManager.AddLog(typeof(Animal).Name, new Animal()); foreach (string key in logMan.. 2019. 5. 23.