본문 바로가기

Design Patterns3

[Design Patterns] (Abstract) Factory Pattern (Abstract) Factory Pattern Factory method를 사용하여 직접적으로 객체 class를 사용하지 않고 객체를 생성하는 생성 패턴 creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. Purpose 객체 생성 함수를 노출시키고 subclass가 실제로 생성하도록 하도록 합니다. Exposes a method for creating objects, allowing subclasses to control the actual creation .. 2021. 8. 6.
[Design Patterns] Strategy Pattern Strategy Pattern 알고리즘을 동적으로 선택할 수 있게 하는 디자인 패턴 behavioral software design pattern that enables selecting an algorithm at runtime. Purpose 특정 행위를 하기 위해 교환할 수 있는 알고리즘을 정의할 수 있도록 합니다. Defines a set of encapsulated algorithms that can be swapped to carry out a specific behavior. Use When 행위기반적인 클래스들 간의 차이가 필요할 때 The only difference between many related classes is their behavior. 알고리즘의 다양한 버전, 변형이 필요.. 2021. 7. 30.
[Design Patterns] Composite Pattern Composite Pattern 클라이언트에서 단일 객체와 복합 객체 모두 동일하게 다루기 위해 사용하는 디자인 패턴 A design pattern used by clients to treat both single and complex objects the same. Purpose 각각의 객체는 독립적으로 동일한 인터페이스를 통해 중첩된 객체로 구현되어 계층구조 객체를 쉽게 만들수 있도록 합니다. Facilitates the creation of object hierarchies where each object can be treated independently or as a set of nested objects through the same interface. Use When 객체가 계층적으로 표현될.. 2021. 7. 26.