전체 글 336

[Design] - 고찰.

System 디자인, 설계 등이 왜 필요할까 생각해 본다.  프로그래머는 컴퓨터로 하여금 사람이 원하는 일을 시키도록 translate 작업을 하는 사람이다.  그렇다면 기능구현을 하는데서 그 1차 책임이 종료된다고 할 수 있다.  그렇다면 OOP, SOLID, Design Pattern등은 무엇 때문에 필요한가.  Change Management, ?Minimize release cost for the codes that have changes/new functionalities, ?EfficiencyLook fancier?Engineering egoism? Clean Architecture 에서도 말하듯, 단위 코드 추가에 대한 최소한의 비용 유지가 아마도 가장 걸맞는 대답일 듯 싶다. 그러나 이 답..

[Behavioral Pattern] - Visitor

https://refactoring.guru/design-patterns/visitor VisitorProblem Imagine that your team develops an app which works with geographic information structured as one colossal graph. Each node of the graph may represent a complex entity such as a city, but also more granular things like industries, sightseeing areas,refactoring.guru 데이터 기반의 객체가 존재하고 이를 최대한 수정하고 싶지 않다. 이때 이 객체들을 기반으로 여러가지 기능을 추가하고 싶을때,..

[Behavioral Pattern] - Template Method

https://refactoring.guru/design-patterns/template-method Template MethodProblem Imagine that you’re creating a data mining application that analyzes corporate documents. Users feed the app documents in various formats (PDF, DOC, CSV), and it tries to extract meaningful data from these docs in a uniform format. The first versrefactoring.guru 특정 객체와 그 객체의 메인 로직의 frame이 이미 정해져 있다. 이때 확장을 통해서 해당 구현의..

[Behavioral Pattern] - Strategy

https://refactoring.guru/design-patterns/strategy StrategyThe Strategy pattern lets you isolate the code, internal data, and dependencies of various algorithms from the rest of the code. Various clients get a simple interface to execute the algorithms and switch them at runtime. The Strategy pattern lets you do arefactoring.guru  특정 알고리즘 처리를 위해 각 단계, 또는 전체를 객체로 정의하고 이를 외부 설정으로 교체 가능하게 하는 것.  예시 ..

[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 ..