March 2002
Intermediate to advanced
496 pages
8h 51m
English
The COMMAND pattern has interesting relationships to many other patterns. For example, COMMAND provides an alternative to TEMPLATE METHOD. Recall the Aster star press code that let you override the method that marks a mold as incomplete if it is in process when you shut down the press. The AsterStarPress class is abstract, requiring you to subclass it with a class that has a markMoldIncomplete() method. The shutdown() method of AsterStarPress relies on this method to ensure that your domain object knows that the mold is incomplete:
public void shutDown()
{
if (inProcess())
{
stopProcessing();
markMoldIncomplete(currentMoldID);
}
usherInputMolds();
dischargePaste();
flush();
}
You might find it inconvenient ...
Read now
Unlock full access