Chapter 3 Introduction to Java Applets 139 Requests (Hosting your own web site)
Chapter 3 Introduction to Java Applets 139 Requests FloorButton ElevatorShaft Elevator 1 1 1 2 2 1 Resets Signals arrival Fig. 3.2121 Class diagram showing associations among classes. Fig. Symbol Meaning 0 None. 1 One. m An integer value. 0..1 Zero or one. m, n m or n m..n At least m, but not more than n. * Zero or more. 0..* Zero or more 1..* One or more Fig. 3.2222 Multiplicity types. Fig. Figure 3.23 shows the complete class diagram for the elevator model. We model all classes that we created, as well as the associations between these classes. [Note: In Chapter 9, we expand our class diagram by using the object-oriented concept of inheritance.] Class ElevatorModelis represented near the top of the diagram and aggregates one object of class ElevatorShaft and two objects of class Floor. The Elevator- Shaftclass is an aggregation of one object of class Elevatorand two objects each of classes Light, FloorDoor and FloorButton. (Notice the two-to-one relationships between each of these classes and ElevatorShaft.) Class Elevatoris an aggregation of classes ElevatorDoor, ElevatorButtonand Bell. Class Personhas associations with both FloorButton and ElevatorButton (and other classes, as we will soon see). The association name Presses and the name-direction arrowheads indicate that the object of class Person presses these buttons. The object of class Person also rides the object of class Elevatorand walks across the object of class Floor. The name Requests indicates that an object of class FloorButton requests the object of class Elevator. The name Signalstomoveindicates that the object of class Elevator- Button signals the object of class Elevator to move to the other floor. The diagram indicates many other associations, as well. Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/2/01