Java Design Pattern: Command

Command design pattern takes an operation and its arguments and wraps them up in an object to be executed, logged, etc. In the example below, Command is an operation, its argument is a Computer, and they are wrapped in Switch. In another perspective, Command pattern has 4 parts: command, receiver, invoker and client. In this … Read more