April 2019
Intermediate to advanced
360 pages
9h 17m
English
Our example WidgetProductionSystem class manages mediation between the other classes. The source code is presented in six sequential parts. The first part of the class defines the class variables and contains the constructor method:
public class WidgetProductionSystem { // class variables private Starter starter; private AssemblySystem assemblySystem; private SystemAccelerator systemAccelerator; private EmergencyBreak emergencyBreak; private Hopper hopper; private int currentSpeed; // constructor public WidgetProductionSystem() { currentSpeed = 0; }
The second part of the WidgetProductionSystem class contains five mediation methods:
// mediation methodspublic void mediateStarter(Starter starter) { this.starter = starter; ...
Read now
Unlock full access