Abstraction
Six objects are used in this configuration: Brake, DesiredSpeed, Driver, Engine, Speed, and Throttle.
While some may argue the object decomposition [Aboud95], my focus was
creating an architectural representation of an object based system.
The objects Brake and Engine contain the methods which describe the behavior
of the automobile brake and engine. DesiredSpeed contains the method
which produces the current set speed. The Driver object embodies the
representations for three driver components: Cruise set, increase/decrease
desired speed, and Cruise resume. The Speed object contains
the methods to set and query the current speed of the vehicle. Finally,
the Throttle object contains the method to calculate a throttle setting
based upon current conditions. This design closely follows the
Chrysler system as described in [CKS95]. Two changes were made:
Implementation
The architecture of the object system is very similar to that of the
procedure call system except the shared data is replaced
by objects, which provide the encapsulation for the data definition
and the methods for data access and modification.
The implementation of the object system is similar to the Procedure Call system. Bridge
drives the system by polling for new input data, calling the appropriate update methods
for objects, and performing a local procedure call to GetThrottle. GetThrottle communicates with
the other objects via local procedure calls. The formula used to calculate the throttle setting is
the same as in the Procedure Call system.
Object Method Description Brake InitializeBrake Initializes of the Brake functionality. GetBrake Returns the current status of the Brake. ApplyBrake Updates the Brake object, indicating that the brake pedal was pressed. DesiredSpeed GetDesiredSpeed Returns the current value for requested Cruise Control speed in pulses per second. Driver InitializeDelta Initializes Cruise Control delta (accelerate/coast) functionality. GetDelta Returns the current value for requested speed changes. The Delta value is initialized as a result of this method invocation. IncreaseDelta Increases the requested speed change value. DecreaseDelta Decreases the requested speed change value. TurnCruiseOn Activates the Cruise Control System. TurnCruiseOff Terminates the Cruise Control System. GetCruise Returns the current status of the Cruise Control System. InitializeCruise Initializes Cruise System functionality. InitializeResume Initializes Resume functionality. SetResumeOn Turns on the Cruise resume functionality. GetResume Returns the current status of the Cruise Resume System. The Resume value is initialized as a result of this method invocation. Engine InitializeEngine Initializes Resume functionality. TurnEngineOff Activates the Cruise Control System. TurnEngineOn Terminates the Cruise Control System. GetEngine Returns the current status of the Engine. CurrentSpeed GetCurrentSpeed Returns the current vehicle speed in pulses per second. SetCurrentSpeed Sets the current vehicle speed in pulses per second. Throttle GetThrottleSetting Produces a throttle setting based on the current state of the other objects.
Last update: 22 February, 1996 by Gary Sekinger
Comments to maintainer