SE450: Looking Back: Structuring Behavior [7/24] Previous pageContentsNext page

Command: Encapsulate a function as an object. The command can then be accessed from many places. It may also support undo/redo.

Strategy: Encapsulate variation into a separate object. A method accesses the variation (strategy) by delegating to a field or parameter.

State: Create the illusion that an object changes its actual type (using delegation to a field). A nice way to eliminate case statments.

Previous pageContentsNext page