Applied Design Patterns with Java

Behavioral :: Command (233) {C ch 17}

Examples - UML : fullCommand and undoCmd


The first example Java program is called 'fullCommand'.

The UML diagram is above, and the list of Java files is below:



The second example Java program is called 'undoCmd'.


The UML diagram is above, and the list of Java files is below:


Example - Java :: Patterns\Behavioral\Command

Pattern Concept: to handle a request by forwarding it to a SPECIFIC object. Details on the specific actions needed and a specific interface are enclosed in the forwarded object. The key here is that the knowledge of the specific actions and interface do not need to be embedded in the requesting object. This allows easy changing of the actions without changing the program itself.

Issues of the Command pattern include:

Catalog Behavioral Prev Next