Design Patterns Series 16 - Command Pattern
Today we will discover another pattern from our design patterns list, The Command Pattern The Command Pattern : The Command Pattern lets you package complex commands into a single one. Rather than having to preform the multiple steps needed to execute each command every time, you can create a bunch of ready-to-use command objects, each of which can handle multiple steps internally. Each command is already configured with its target and the action it's supposed to perform, so a set of command objects can act as a ready-made toolkit, already configured and all set to operate on the target objects they're supposed to handle. The Command Pattern says you should encapsulate all the separate actions into objects configured for specific targets. This gives you a number of objects that act like a set of tools, ready to be used. In other words, the idea here is encapsulation. You are encapsulating a set of complex actions, targeted at a particular target, ...