반응형

C# 63

[설계 패턴 C#] 18. 반복자 패턴(Iterator Pattern)

[설계 패턴 C#] 18. 반복자 패턴(Iterator Pattern) "본문 내용"[Escort GoF의 디자인 패턴 C#] 18. 반복자 패턴(Iterator Pattern)[Escort GoF의 디자인 패턴 C#] 18. 반복자 패턴(Iterator Pattern) 설계[Escort GoF의 디자인 패턴 C#] 18. 반복자 패턴(Iterator Pattern) 구현 ▶ IContainer.csusing System;namespace Iterator{ interface IContainer { bool Add(Object elem); void Remove(Object elem); void Clear(); int Count { get; } } } ▶ IIterator.csusing System;name..

[설계 패턴 C#] 17. 해석자 패턴(Interpreter Pattern)

[설계 패턴 C#] 17. 해석자 패턴(Interpreter Pattern) "본문 내용"[Escort GoF의 디자인 패턴 C#] 17. 해석자 패턴(Interpreter Pattern)[Escort GoF의 디자인 패턴 C#] 17. 해석자 패턴(Interpreter Pattern) 설계[Escort GoF의 디자인 패턴 C#] 17. 해석자 패턴(Interpreter Pattern) 구현 ▶ Picture.csusing System;namespace Interpreter{ class Picture { string name; int tone; int brightness; int saturation; public Picture(string name,int tone,int brightness,int sa..

[설계 패턴 C#] 16. 명령 패턴(Command Pattern)

[설계 패턴 C#] 16. 명령 패턴(Command Pattern) "본문 내용"[Escort GoF의 디자인 패턴 C#] 16. 명령 패턴(Command Pattern)[Escort GoF의 디자인 패턴 C#] 16. 명령 패턴(Command Pattern) 설계[Escort GoF의 디자인 패턴 C#] 16. 명령 패턴(Command Pattern) 구현 ▶ Picture.csnamespace Command{ class Picture { public string Name { get; private set; } public string User { get; private set; } public Picture(string name,string user) { Name = name; User = user;..

[설계 패턴 C#] 15. 책임 연쇄 패턴(Chain of Responsibility Pattern)

15. 책임 연쇄 패턴(Chain of Responsibility Pattern) "본문 내용"[Escort GoF의 디자인 패턴]15. 책임 연쇄 패턴(Chain of Responsibility Pattern)[Escort GoF의 디자인 패턴] 15. 책임 연쇄 패턴(Chain of Responsibility Pattern) 설계[Escort GoF의 디자인 패턴] 15. 책임 연쇄 패턴(Chain of Responsibility Pattern) 구현 ▶ ChangeHandler.csusing System.Collections.Generic; namespace ChainofResponsibility{ abstract class ChangeHandler { public ChangeHandler Succ..

온라인 무료 공개 "Escort GoF의 디자인 패턴 C#"

온라인 무료 공개 "Escort GoF의 디자인 패턴 C#"목차[소프트웨어 설계 C#] 1부 생성 패턴들1. 추상 팩토리 패턴 (Abstract Factory Pattern)1. 추상 팩토리 패턴 (Abstract Factory Pattern) 설계1. 추상 팩토리 패턴 (Abstract Factory Pattern) 구현2. 빌더 패턴(Builder Pattern)2. 빌더 패턴(Builder Pattern) 설계2. 빌더 패턴(Builder Pattern) 구현3. 팩토리 메서드 패턴(Factory Method Pattern)3. 팩토리 메서드 패턴(Factory Method Pattern) 설계3. 팩토리 메서드 패턴(Factory Method Pattern) 구현4. 원형 패턴(Prototype ..

[설계 패턴 C#]14. 프락스 패턴(Proxy Pattern) - 보호용 프락시

14. 프락스 패턴(Proxy Pattern) - 보호용 프락시"본문 내용"14. 프락시 패턴(Proxy Pattern) – 보호용 프락시14. 보호용 프락시 설계14. 보호용 프락시 구현▶ IView.csnamespace ProtectionProxy{ interface IView { void View(); string Owner { get; } }} ▶ Picture.csusing System;namespace ProtectionProxy{ class Picture:IView { string name; public string Owner { get; private set; } public Picture(string name,string owner) { this.name = name; Owner = ow..

[설계 패턴 C#]13. 프락스 패턴(Proxy Pattern) - 가상 프락시

13. 프락스 패턴(Proxy Pattern) - 가상 프락시 ▶ IConvert.csnamespace VirtualProxy{ interface IConvert { string Image { get; set; } void ClearImage(); string ConvertImage(); }} ▶ ImageConverter.csusing System;using System.Threading;namespace VirtualProxy{ class ImageConverter:IConvert { public string Image { get; set; } public ImageConverter() { Image = string.Empty; } public void ClearImage() { Image = str..

[설계 패턴 C#]12. 프락스 패턴(Proxy Pattern) - 원격지 프락시

12. 프락스 패턴(Proxy Pattern) - 원격지 프락시"본문 내용"은 언제나 휴일 본 사이트에 있습니다.서버 측 코드▶ ITake.csnamespace RemoteClient{ interface ITake //실제 개체인 카메라가 수행할 수 있는 기능 약속 { string TakeAPicture(); void ChangeMode(bool mode); bool GetMode(); } enum MsgId //실제 개체에 내릴 수 있는 명령 종류 { TAKE=1, CHANGE, GET }} ▶ Camera.csusing System;namespace RemoteProxy{ class Camera:ITake { bool mode = false; //true: 수동 모드, false: 자동 모드 publ..

[설계 패턴 C#] 11. 플라이급 패턴(Flyweight Pattern)

11. 플라이급 패턴(Flyweight Pattern)"본문 내용"은 언제나 휴일 본 사이트에 있습니다.▶ Meta.cs using System; namespace Flyweight{ //사진 촬영 조건에 관한 열거형 정의 public enum BodyType { EH_BA, EH_BB, EH_BC }; public enum LensType { EH_L1, EH_L2, EH_L3 }; public enum LightType { LT_CLEAR, LT_CLOUDY, LT_LAMP }; class Meta //사진 파일들이 공유할 수 있는 촬영 조건을 정의한 클래스 { static readonly string[] bodyname = {"EH_BA","EH_BB","EH_BC"}; static readonly..

[설계 패턴 C#] 10. 퍼샤드 패턴

10. 퍼샤드 패턴"본문 내용"은 언제나 휴일 본 사이트에 있습니다.▶ Picture.cs namespace Facade { class Compensator //하위 계층 서비스 { public void Change(Picture picture, int tone, int brightness, int saturation) { picture.Change(tone, brightness, saturation); } } } ▶ PictureManager.cs namespace Facade { class SmartManager // 사용자가 하위 계층의 기능을 쉽게 사용할 수 있게 제공 { Compensator compensator = new Compensator(); //사진을 수정하는 개체 PictureMana..

반응형