Unable to start debugging on the web server - Chapter 13 Graphical User Interface Components: Part 2
Chapter 13 Graphical User Interface Components: Part 2 785 We showed in Fig. 9.38 that class ElevatorModel is an aggregation of several classes. To save space, we do not repeat this aggregation in Fig. 13.19. Class Elevator- Viewis also an aggregation of several classes we expand the class diagram of ElevatorView in Thinking About Objects Section 22.9 to show these additional classes. Class ElevatorController, as described in Section 12.16, represents the simulation controller. Note that class ElevatorView implements interface ElevatorModel- Listener, which implements all interfaces used in our simulation, so the Elevator- View can receive all events from the model. Software Engineering Observation 13.7 When appropriate, partition the system class diagram into several smaller class diagrams, so each diagram represents a unique subsystem. Class ElevatorSimulation contains no attributes other than its references to an ElevatorModel object, an ElevatorView object and an ElevatorController object. The only behavior for class ElevatorSimulation is to start the program therefore, in Java, class ElevatorSimulation contains a staticmain method that calls the constructor, which instantiates the ElevatorModel, ElevatorView and ElevatorController objects. We implement class ElevatorSimulation in Java later in this section. Component Diagrams Figure 13.19 helps us construct another diagram of the UML that we use to design our system the component diagram. The component diagram models the pieces called components that the system needs to perform its tasks. These pieces include binary executables, compiled .class files, .java files, images, packages, resources, etc. We present the component diagram for our simulation in Fig. 13.20. In Fig. 13.20, each box that contains the two small white boxes overlapping its left side is a component. A component in the UML is drawn similar to a plug (the two overlapping boxes represent the plug s prongs) a component may be plugged-in to other systems without having to change the component. Our system contains five components: ElevatorSimulation.class, ElevatorSimulation.java, Elevator- Model.java, ElevatorView.java and ElevatorController.java. In Fig. 13.20, the graphics that resemble folders (boxes with tabs in their upper-left corners) represent packages in the UML. We can group classes, objects, components, use cases, etc., in a package. In this diagram (and in the remainder of our case study), the UML packages refer to Java packages (introduced in Section 8.5). In our discussion, we use lower-case bold-face Courier type for package names. The packages in our system are model, view and controller. Component ElevatorSimulation.java contains one instance each of all components in these packages. Currently, each package contains only one component a .java file. The model package contains ElevatorModel.java, the view package contains ElevatorView.java and the controller package contains ElevatorController.java. We add components to each package in the appendices, when we implement each class from our class diagrams into a component (.java file). The dotted arrows in Fig. 13.20 indicate a dependency between two components the direction of the arrow indicates the depends on relationship. A dependency describes the
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.