composition with delegation1 [디자인패턴] 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. 이전 1 다음