본문 바로가기

OCP3

[디자인패턴] Decorator pattern (데코레이터 패턴) Purpose of Decorator Pattern (데코레이터 패턴의 목적) - Allows for the dynamic wrapping of objects in order to modify their existing responsibilities and behaviors. - 객체를 동적으로 래핑하여 기존 책임과 동작을 수정할 수 있습니다. Design Principle (디자인원칙) - OCP (Open-Closed Principle) : easily extended to incorporate new behavior without modifying existing code Decorator pattern (데코레이터 패턴) - decoration은 '장식(포장)'이란 뜻 - The Decorator.. 2022. 8. 28.
[디자인패턴] State pattern (상태 패턴) Purpose of State Pattern (상태 패턴의 목적) - Ties object circumstances to its behavior, allowing the object to behave in different ways based upon its internal state. - 내부 상태에 따라 다르게 동작할 수 있도록! Design Principle (디자인원칙) - OCP : Open-Closed Principle State pattern (상태 패턴) - Define a State interface that contains a method for every action. - Get rid of all of our conditional code and instead delegate to .. 2022. 8. 28.
SOLID PRINCIPLES Hierarchy of Pattern Knowledge 패턴 지식의 계층화 - Design Pattern은 OO Principle (설계 원칙을 따른 것)이고, 그 OO Basic(기본) 개념이 아래에 있다. 예시) Design smells - various signs and symptoms of bad design (디자인 불량 징후 및 증상) - Rigidity(경직성), Fragility(취약성), Immobility(부동성), Viscosity(점착성), Needless Complexity (불필요한 복잡성), Needless Repetition (불필요한 반복), Opacity(불투명성) - Design smells are resulted from mismanaged dependencies (s.. 2022. 8. 23.