Chapter 5 ¶
Behavioral Patterns ¶
Chain of Responsibility(225) Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects, and pass the request along the chain until an object handles it.
Command(245) Encapsulate a request or operation as an object, thereby letting you parameterize clients with different operations, queue or log requests, and support undoable operations.
Interpreter(261)
Chain of Responsibility(225)
Command(245) ๋ ์์ฒญ(request)์ด๋ ๋ช
๋ น(operation)์ object๋ก์ ์บก์ํ์ํจ๋ค. ๊ทธ๋ฌํจ์ผ๋ก์จ ๊ฐ๊ฐ ๋ค๋ฅธ ๋ช
๋ น์ ๊ฐ์ง ํด๋ผ์ด์ธํธ๋ค์ ํ๋ผ๋ฏธํฐํ ์ํค๊ณ , ์์ฒญ๋ค์ queue์ ์๊ฑฐ๋ ์ ๋ ฌํ๋ฉฐ, ์ทจ์๊ฐ๋ฅํํํ์ ๋ช
๋ น๋ค์ ์ง์ํ๋ค.