Object oriented Programming with States Demonstration Program

The 'DemoWin.exe' program in intented to illustrate the basics
principles of the use of states in order to achive quality programs.
The main window of this application presents two classes:
- the class DOOR
- the clas SECURITY_DOOR
The user can manipulate an instance of the SECURITY_DOOR class by
pressing on each on the four buttons:
- open   : to open the SecurityDoor,
- close  : to close the SecurityDoor,
- lock   : to lock the SecurityDoor,
- unlock : to unlock the SecurityDoor.
No action is allowed as long as no object has been created. To create
an instance of the class SecurityDoor, choose the "new" option of the
"Security Door" menu. As a SecurityDoor has a code (which is the number
of the key that makes it possible to lock or unlock the SecurityDoor),
at creation time, the user is asked to provide a key code number (by
default the value is 125).

Each of the actions requested by the user triggers the executions of
a method defined either in the class Door ('open', 'close') or in the
class SecurityDoor ('lock', 'unlock').
Each executed method induces a change in the current state of the
manipulated object. Each method is checked before execution in order
to ensure that it is allowed in the current state of the object (it
is allowed to close the door when it is in the open state whereas it
is forbidden to open it when it is in the locked state). Some methods
are also checked against pre-conditions (for example the methods 'lock'
and 'unlock' need as parameter the number of the key corresponding to
the SecurityDoor, if the provided code number does not equal the key
code of the SecurityDoor, a pre-condition violation error is mentioned).
Each time an method execution fails, an exception is raised and a
message box explaining the reason of the refusal is displayed).
All the states of the Door and SecurityDoor classes are described in
their interfaces as well as the pre and post conditions of their methods
(see the files DOOR.EHP and SECURDOR.EHP).
Further details concerning this example may also be found in the on-line
help provided with the example (file DEMOWIN.HLP).

