분류 전체보기 422

[Behavioral Pattern] - State

https://refactoring.guru/design-patterns/state StateUse the State pattern when you have an object that behaves differently depending on its current state, the number of states is enormous, and the state-specific code changes frequently. The pattern suggests that you extract all state-specific code into a serefactoring.guru 특정 모듈의 상태를 하나의 객에 안에서 통합처리하는 것이 아닌, 각자의 상태 객체에서 처리를 전담하게 한다.   예제 - Music..

[Behavioral Pattern] - Observer

https://refactoring.guru/design-patterns/observer Observer/ Design Patterns / Behavioral Patterns Observer Also known as: Event-Subscriber, Listener Intent Observer is a behavioral design pattern that lets you define a subscription mechanism to notify multiple objects about any events that happen to the object trefactoring.guru  Observer로 등록된 모든 객체들에게 관련 메시지를 notify 한다. 각 observer 들은 해당 메시지를 각기 ..

[Behavioral Pattern] - Memento

https://refactoring.guru/design-patterns/memento Memento/ Design Patterns / Behavioral Patterns Memento Also known as: Snapshot Intent Memento is a behavioral design pattern that lets you save and restore the previous state of an object without revealing the details of its implementation. Problem Imagine thatrefactoring.guru   객체의 상태를 특정 시점에 백업하고 이를 저장해 놓는다. 원하는 때에 원하는 상태로 객체의 백업해 놓은 데이터를 이용해 되돌..

[Behavioral Pattern] - Command

https://refactoring.guru/design-patterns/command Command/ Design Patterns / Behavioral Patterns Command Also known as: Action, Transaction Intent Command is a behavioral design pattern that turns a request into a stand-alone object that contains all information about the request. This transformation lets you prefactoring.guru  Dependency Inversion 의 핵심과 같은 패턴.  모듈 내 특정 상황에 맞는 행동을 설정된 외부 객체에 의해 c..

[Behavioral Pattern] - Chain Of Responsibility

https://refactoring.guru/design-patterns/chain-of-responsibility Chain of Responsibility/ Design Patterns / Behavioral Patterns Chain of Responsibility Also known as: CoR, Chain of Command Intent Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handlerefactoring.guru  특정 메시지 혹은 이벤트 등을 관련 있는 모두에서 전달하며, 알아서..

[Structural Pattern] - Proxy

https://refactoring.guru/design-patterns/proxy ProxyThere are dozens of ways to utilize the Proxy pattern. Let’s go over the most popular uses. Access control (protection proxy). This is when you want only specific clients to be able to use the service object; for instance, when your objects are crucial prefactoring.guru 특정 객체를 wrapping해서 일종의 대리 처럼 사용하며, 그 과정에서 추가적인 기능을 구현할때.=> 로깅, 캐싱, deferred ..

[Structural Pattern] - Flyweight

https://refactoring.guru/design-patterns/flyweight Flyweight/ Design Patterns / Structural Patterns Flyweight Also known as: Cache Intent Flyweight is a structural design pattern that lets you fit more objects into the available amount of RAM by sharing common parts of state between multiple objects instead of keeprefactoring.guru 자원의 효율적 사용을 위해 특정 키를 부여하고 이 키를 통해 자원을 캐싱 하고자 할때. 예시  - TextureCac..

[Structural Pattern] - Facade

https://refactoring.guru/design-patterns/facade FacadeIntent Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes. Problem Imagine that you must make your code work with a broad set of objects that belong to a sophisticatedrefactoring.guru 하나의 객체가 다른 여러개의 객체의 조합으로 이루어 지고, 이를 통해 관련 구현을 하고자 할 때.  => 작은 모듈로 구성된 대부분..

[Structural Pattern] - Decorator

https://refactoring.guru/design-patterns/decorator Decorator/ Design Patterns / Structural Patterns Decorator Also known as: Wrapper Intent Decorator is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors. Probrefactoring.guru  특정 기본 행위 위에 별도로 특정 행위를 추가적으로 하고자 할 때 사용.예시  - Lobby Card Renderer..

[Structural Pattern] - Composite

https://refactoring.guru/design-patterns/composite Composite/ Design Patterns / Structural Patterns Composite Also known as: Object Tree Intent Composite is a structural design pattern that lets you compose objects into tree structures and then work with these structures as if they were individual objects. Problemrefactoring.guru 어떤 특정 객체가 같은 객체를 재귀적으로 목록으로 가질 수 있는 경우를 표현할 때. 예시  - Dialog System..