April 2019
Intermediate to advanced
360 pages
9h 17m
English
The RoasterDirector class creates a Builder instance and then uses a sequence of steps to build the roaster. The RoasterDirector class is unaware of whether the roaster being created is for personal or commercial use:
public class RoasterDirector { Builder currentBuilder; // roaster building steps public void buildRoaster(Builder builder) { currentBuilder = builder; currentBuilder.buildCoolingTray(); currentBuilder.buildExhaustSystem(); currentBuilder.buildGasBurner(); currentBuilder.buildInnerDrum(); currentBuilder.buildMainBody(); currentBuilder.buildMotor(); currentBuilder.buildPlatform(); currentBuilder.buildThermocouples(); }}
The order of the steps in the build process is not important.
Read now
Unlock full access