Java Reference
In-Depth Information
Figure 28.3 shows the structure of the specific process flow that Oozinoz uses for making
aerial shells. The code that creates the process object model creates
ProcessComponent
objects in static methods:
Figure 28.3. The process flow for making aerial shells is a cyclic composite. Each leaf
node in this diagram is an instance of
ProcessStep
. The remaining nodes are instances
of
ProcessComposite
.
package com.oozinoz.process;
public class ShellProcess
{
protected static ProcessSequence make;
public static ProcessSequence make()
{
if (make == null)
{
make = new ProcessSequence(
"Make an aerial shell");
make.add(buildInnerShell());
make.add(inspect());
make.add(reworkOrFinish());
}
return make;
}
protected static ProcessStep buildInnerShell()
{
return new ProcessStep("Build inner shell");
}