GoF 디자인 패턴

Seo·2020년 4월 17일
14

design_pattern

목록 보기
2/11

배경

논문 "Using Pattern Languages for Object-Oriented Programs" (1987)을 통해 제안되었다.

이후 큰 유명세를 타게 된 것은 23개의 패턴을 수록한 'GoF'(Gang of Fours). Design Patterns: Elements of Reusable Object-Oriented Software. (1995)이다.

현재에는 수천여개의 패턴이 발표되어 있다.

객체 지향 프로그래밍이 각광받으면서 재사용 관점에서 상호간 커뮤니케이션 문제가 될 부분이 많이 있었다. 그래서 문제를 줄이고자 규약(프로토콜)을 만들어야될 필요가 자연스럽게 생기지 않았나 싶다.

GoF 디자인 패턴 종류

1. 생성(Creational) 패턴

객체 생성(인스턴스화)

특정 개체가 생성되거나 변경되어도 프로그램 구조에 영향을 크게 받지 않도록 유연성 제공

1.1 추상 팩토리(Abstract Factory)

추상 팩토리

1.2 빌더(Builder)

빌더

1.3 팩토리메서드(FactoryMethod)

팩토리매서드

1.4 프로토타입(Prototype)

프로토타입

1.5 싱글톤(Singleton)

싱글톤

2. 구조(Structural) 패턴

객체 결합(조합)

클래스나 객체를 조합하여 더 큰 구조를 만드는 패턴

2.1 어댑터(Adapter)

어댑터

2.2 브리지(Bridge)

브리지

2.3 컴포지트(Composite)

컴포지트

2.4 데코레이터(Decorator)

데코레이터

2.5 파사드(Facade)

2.6 플라이웨이트(Flyweight)

2.7 프록시(Proxy)

3. 행위(Behavioral) 패턴

객체 간 커뮤니케이션

객체(클래스)사이에 알고리즘이나 책임 분배에 관련한 패턴

결합도를 최소화하는 것에 중점을 둔다

3.1 책임 연쇄(Chain of Responsibility)

3.2 커맨드(Command)

3.3 인터프리터(InterPreter)

3.4 이터레이터(Iterator)

3.5 중재자(Mediator)

3.6 메멘토(Memento)

3.7 옵서버(Observer)

3.8 상태(State)

3.9 전략(Strategy)

3.10 템플릿메서드(Template Method)

3.11 방문자(Visitor)

Reference

빌드 패턴 : https://asfirstalways.tistory.com/350
팩토리메소드 패턴 : https://jdm.kr/blog/180
싱글톤 패턴 : https://elfinlas.github.io/2019/09/23/java-singleton/
어댑터 패턴 : https://gdtbgl93.tistory.com/141
어댑터 패턴 : https://blog.seotory.com/post/2017/09/java-adapter-pattern
Bridge 패턴 : https://ko.wikipedia.org/wiki/%EB%B8%8C%EB%A6%AC%EC%A7%80_%ED%8C%A8%ED%84%B4
컴포지트 패턴 : https://ko.wikipedia.org/wiki/%EC%BB%B4%ED%8F%AC%EC%A7%80%ED%8A%B8_%ED%8C%A8%ED%84%B4
컴포지트 패턴 : https://gmlwjd9405.github.io/2018/08/10/composite-pattern.html
데코레이터 패턴 : https://johngrib.github.io/wiki/decorator-pattern/#fnref:gof

profile
개발관심자

0개의 댓글