반응형

소스 파일 143

[설계 패턴 C#] 원형 패턴(Prototype Pattern)

4. 원형 패턴(Prototype Pattern) "본문 내용"은 언제나 휴일 본 사이트에 있습니다. ▶ZoomLens.cs namespace Prototype { enum TypeZoomLens{ NM_NM, NM_NF, NF_NF, MF_NF, MF_MF } class ProLine { ZoomLens pt = null; public ProLine(TypeZoomLens typezoomlens) { switch (typezoomlens) { case TypeZoomLens.NM_NM: pt = new ZoomLens(20, 70, 1, 100); break; case TypeZoomLens.NM_NF: pt = new ZoomLens(20, 70, 1, 200); break; case TypeZoom..

[설계 패턴 C#] 팩토리 메서드 패턴(Factory Method Pattern)

팩토리 메서드 패턴(Factory Method Pattern) "본문 내용"은 언제나 휴일 본 사이트에 있습니다. ▶EHApp.cs namespace FactoryMethod { interface IView { void Show();//보여주기 기능에 대한 메서드 약속 } } ▶MyView.cs using System; namespace FactoryMethod { class MyApp:EHApp { public override void InitInstance()//재정의 { Console.WriteLine("MyApp 초기화"); base.InitInstance(); } public override void ExitInstance()//재정의 { base.ExitInstance(); Console.Wr..

[설계 패턴 C#] 빌더 패턴(Builder Pattern)

본문 바로가기 ▶Picture.cs namespace Builder { abstract class PictureBuilder { public Picture Picture { get; protected set; } public abstract void SetSubject(string subject); //상을 맺히는 기능 public abstract void Change();//이미지를 수정하는 기능 } } ▶SmoothBuilder.cs namespace Builder { class REPreventBuilder:PictureBuilder { const string red_eye = "RedEye"; const string normal_eye = "NomalEye"; const int max_length..

반응형