-
디자인 패턴이란?
소프트웨어 엔지니어링에서 소프트웨어 디자인 패턴은 소프트웨어 디자인에 주어진 컨텍스트 내에서 일반적으로 발생하는 문제에 대한 일반적이고 재사용 가능한 솔루션이다.
디자인 패턴을 사용함으로써의 장점
- 디자인 패턴을 사용함으로써 개발의 속도를 높일 수 있다.
- 구현후에 숨겨져 있는 버그등이 생기는 것을 방지 할 수 있다.
- 패턴에 익숙한 코더와 아키텍트의 코드 가독성을 향상시킨다.
패턴의 종류
Type of Design Pattern 1. Creational Pattern
class instantiation이나 object creation에 대한 디자인 패턴이다.
- Class-Creational Pattern이나 Object Creational 패턴으로 구분할 수 있다.
- 클래스 생성 패턴은 인스턴스화 하는 과정에서 상속을 주로 사용한다
- object-creational 패턴은 위임(Delegation)을 주로 사용하여 작업을 완료한다.
- Factory Method, Abstract Factory, Builder, Singleton, Object Pool, Prototype 패턴 등이 있다
Loose coupling을 실현하기 위해 Factory Pattern을 사용한다던지 손쉬운 로드 관리등을 위해 DBConnection을 Singleton Pattern등으로 구현 할 수 있다
2. Structural Pattern
서로 다른 클래스나 객체를 정리하여 큰 구조나 새로운 기능을 제공하게 만들 때에 사용되어지는 디자인 패턴
- Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Private Class Data, Proxy 패턴 등이 있다.
- 두개의 인터페이스가 서로 호환되지 않을 때 adapter 패턴 등을 이용해 관계를 만들어 호환시킬 수 있다.
3. Behavioral Pattern
행동 패턴은 객체간의 일반 커뮤니케이션 패턴을 식별하고 실현하는 것을 말한다
Chain of responsibility, Command, Interter, Iterator, Mediator, Memento, Null Object, Observer, State, Strategy, Template Method, Visitor등이 있다
References
en.wikipedia.org/wiki/Software_design_pattern#cite_note-McConnell2004-14
Software design pattern - Wikipedia
From Wikipedia, the free encyclopedia Jump to navigation Jump to search Reusable solution to a commonly occurring software problem In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a g
en.wikipedia.org
www.geeksforgeeks.org/design-patterns-set-1-introduction/?ref=lbp
Design Patterns | Set 1 (Introduction) - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
'디자인 패턴' 카테고리의 다른 글
Decorator Pattern (0) 2022.02.08 Observer Pattern (0) 2022.02.03 Strategy Pattern (0) 2022.02.02 싱글톤 패턴(Singleton Pattern) (0) 2021.10.28 Facade Pattern (0) 2021.10.27