일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- SSH
- null
- expect
- with
- Shader
- c++11
- ubuntu
- 배열
- conda
- postgresql
- Eclipse
- awk
- dataframe
- sql
- ngui
- C++
- if
- boost
- pandas
- DROP
- mysql
- List
- Unity
- sqlite
- SVN
- 쉘
- python
- pi
- FIND
- autovacuum
Archives
- Today
- Total
その先にあるもの…
State 패턴 본문
UML class diagram
Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.
Context객체가 상태에 따라 기능을 달리 할 때 사용하는 패턴이다.
Context객체는 State 객체를 가지고 있으며 상태가 변할때 마다 각 상태에 따라 ConcreteState를 교체해 사용한다.
사용후기
Context 객체내부는 각 상태에 따른 분기문(IF, SWITCH)이 없어져 코드가 깨끗하다.
도움
Comments