Object and Class Specification

Class: Lamp

1.0 Precise and Concise Description

  1. A lamp is the abstraction of a simple lamp that can either be turned on (illuminated) or turned off (extinguished).

  2. Instances of this class require two operations, i.e., one which will allow a given lamp to communicate to the "outside world" that it has been "turned on," and one which will allow a given lamp to communicate to the "outside world" that it has been "turned off."

  3. The suffered operations for a lamp are: turn the lamp on, turn the lamp off, Assign (the state of one lamp to another), and Is_On (is a given instance of this class in the "on" state). Since a lamp stays either on or off until instructed to change its state, the states of a lamp are persistent.

  4. The lamp class will export no constants or exceptions.

2.0 Graphical Representations

2.1 Static Representations

2.1.1 Semantic Networks

2.1.2 Notes On the Semantic Networks

  1. Two different instances of this class are equal if they are both in (or, are both not in) the "on" state.

2.2 Dynamic Representations

2.2.1 State Transition Diagrams

2.2.1.1 State Transition Diagrams for Non-Spontaneous State Changes

2.2.1.1.1 Notes on State Transition Diagrams for Non-Spontaneous State Changes

  1. Note that the operation Turn_On has no effect if the lamp is already on and Turn_Off has no effect if a lamp is already off.
  2. The Is_On selector operation can be used to determine the state of a given instance of this class.

3.0 Operations

3.1 Required Operations

Operation Method
Turn_On Connects the lamp abstraction with the means of turning the physical lamp on.
Turn_Off Connects the lamp abstraction with the means of turning the physical lamp off.

3.2 Suffered Operations

Operation Method
Turn_On Turn the lamp on.
Turn_Off Turn the lamp off.
Assign Assign the state of one instance of this class to another instance of the same class
Is_On Returns true if a given instance of this class is in the "on" state.

4.0 State Information

  1. The states that the lamp may be in are "on" when the operation Turn_On has been invoked and "off" when the operation Turn_Off has been invoked.

5.0 Constants and Exceptions

5.1 Constants

  1. This class will provide no constants.

5.2 Exceptions

  1. This class will provide no exceptions.

[TOA Home Page] [HTML Documents] [Contact TOA]