Command DP |
---|
(Adopted from DP: Gang of 4)
Example: User Interface Toolkit (UIT) has widgets that perform actions in response to user input.
Who can provide implementation:
- UIT
- applications using UIT
Thus, we need to issue requests to objects without knowing anything about:
- the operation being requested
- the receiver of the request.
Solution:
turn the request itself into an object:
Avoid hard-coding: