C# Creational Patterns6 03# 추상 팩토리(Abstract Factory) 패턴 Creational Patterns static void Main(string[] args) { //BuilderExample(); FactoryExample(); //Console.WriteLine("Hello World!"); Console.ReadKey(); } static void FactoryExample() { ContinentFactory africa = new AfricaFactory(); AnimalWorld world = new AnimalWorld(africa); world.RunFoodChain(); ContinentFactory america = new AmericaFactory(); world = new AnimalWorld(america); world.RunFoodChain(); } main.cs using Sy.. 2019. 5. 22. 02# Builder 패턴 Creational Patterns using System; using DesignPatterns.Patterns.Builder; namespace DesignPatterns { class Program { static void Main(string[] args) { BuilderExample(); //Console.WriteLine("Hello World!"); } static void BuilderExample() { //Director 생성, Builder 데이터 입력자. Director director = new Director(); Builder b1 = new ConcreteBuilder1(); Builder b2 = new ConcreteBuilder2(); //Product 데이터 입력 director.Construct(b1.. 2019. 5. 22. 이전 1 2 다음