Java Reference
In-Depth Information
Figure 16.2. The Machine hierarchy contains logic for controlling physical machines and
for planning.
To make a shell, we mix chemicals in a mixer and pass them to a star press, which extrudes
individual stars. We pack stars into a shell around a core of black powder and place this over a
lifting charge, using a shell assembler. We use a fuser to insert the fusing that will ignite both
the lifting charge and the shell core.
Suppose that you need the getAvailable() method to forecast when a machine will
complete its current processing and be available for more work. This method may require
several supporting private methods, adding up to quite a bit of logic to add to each of our
machine classes. Rather than adding the planning logic to the Machine hierarchy, you might
prefer to have a separate MachinePlanner hierarchy. You need a separate planner class for
most machine types, but mixers and fusers are always available for additional work. For these
classes, you can use a BasicPlanner class.
Search WWH ::




Custom Search