704 Graphical User Interface Components: Part 1 (Web hosting solutions) Chapter

704 Graphical User Interface Components: Part 1 Chapter 12 draw and transfer funds). A person is an external entity that can play the part of a Bank- Customer. In the same manner as an object is an instance of a class, a person playing the part of a BankCustomer performing one of its roles (such as making a deposit) is an instance of actor BankCustomer. For example, when a person named Mary plays the part of a BankCustomermaking a deposit, Mary in the role of the depositor becomes an instance of actor BankCustomer. Later in that day, another person named Jon can be another instance of actor BankCustomer. In the course of a day, several hundred people might use the ATM machine some are depositors , some are withdrawers and some are transferrers, but all of these people are instances of actor BankCustomer. The problem statement in our elevator simulation supplies the actors The user requires the ability to create a person in the simulation and situate that person on a given floor. Therefore, the actor of our system is the user who controls the simulation (i.e., the user who clicks the buttons to create new Persons in the simulation). An external entity a real person plays the part of the user to control the simulation. In our system, the use case is Create Person, which encompasses creating a Person object, then placing that Personon either the first or second Floor. Figure 12.28 models one actor called User. The actor s name appears underneath the actor. The system box (i.e., the enclosing rectangle in the figure) contains the use cases for the system. Notice that the box is labeled Elevator Simulation. This title shows that this use-case model focuses on the one use case that our simulation provides to users (i.e., Create Person ). The UML models each use case as an oval. The system box for a system with multiple use cases would have one oval per use case. There is a reasonable alternate view of the use case of our elevator simulation. The problem statement from Section 2.9 mentioned that the company requested the elevator simulation to determine whether the elevator will meet the company s needs. We are designing a simulation of a real-world scenario the Personobject in the simulation represents an actual human being using an actual elevator. Thus, we may view the user of the elevator simulation as the user of the elevator. Therefore, specifying a use case from the Person object s perspective helps model how a real person uses a real elevator system. We offer the use case of Fig. 12.29, titled Relocate Person. This use case describes the Person moving (relocating) to the other Floor. (The Person travels to the second Floor if starting on the first Floor and to the first Floor if starting on the second Floor.) This use case encompasses all actions that the Personperforms along his or her journey, such as walking across a Floorto the Elevator, pressing Buttons and riding the Elevatorto the other Floor. Create Person Elevator Simulation User Fig. 12.28Use-case diagram for elevator simulation from user s perspective. 12.28 Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/7/01

Leave a Reply