SlideServe
Menu
Préférences
© SlideServe · v2026

Object-oriented Analysis and Design

caesar avatar
16 diapositives · 336 Views · Sep 11, 2014

Object-oriented Analysis and Design. Phases of the Project. Requirements Document. Object Model Diagram. State Transition Diagrams. Component Construction. Requirements Document.

Object-oriented Analysis and Design - slide 1
01 / 16Object-oriented Analysis and Design
1 / 17

Télécharger la présentation

Object-oriented Analysis and Design
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Object-oriented Analysis and Design Phases of the Project Requirements Document Object Model Diagram State Transition Diagrams Component Construction

  2. Requirements Document The Corey sisters have a privately-owned alley with a closed spar or turning lane at one end. The sisters plan to use this alley as a parking lot. The lot will hold a maximum of five cars in single file. Cars arrive at one end of the alley, enter at the back, and leave from the front. The spar is used to temporarily hold cars from the front of the line when a car from the middle or end of the line is set to leave. The capacity of the spar is one car less than the capacity of the lot. When the departing car has left, cars from the spar are moved back to the lot and placed in their previous position. All cars that were behind the departed car are moved up one position to allow room for new entries. When the lot is full newly arriving cars will have to find parking elsewhere. A lot simulation will exhibit the working of this lot with cars writing messages showing the times in which they enter and leave the lot or when they arrive and find the lot full.

  3. Requirements Document The Corey sistershave a privately-owned alley with a closed spar or turninglane at one end. The sistersplan to use this alley as a parkinglot. The lotwill hold a maximum of five cars in single file. Carsarrive at one end of the alley, enterat the back, and leave from the front. The sparis usedto temporarily holdcars from the front of the line when a car from the middle or end of the line is set to leave. The capacityof thesparis one car less than the capacityof thelot. When the departing car has left, carsfrom thesparare moved back to the lot and placed in their previousposition. All cars that were behind the departed car are movedupone position to allow room for new entries. When the lotis full newly arriving carswill have to find parking elsewhere. A lotsimulationwillexhibit the working of this lot with carswritingmessages showing the times in which they enter and leave the lot or when they arrive and find the lot full.

  4. Nouns (or noun phrases Sisters (irrelevant) Lot (same as alley and parking lot) Car End, back, front, position (attributes of Lot) Spar Capacity (attribute of Lot and Spar) LotSimulation (to be called LotSim) Message (can be implemented as a string) Arrive/depart time (attributes of car)

  5. Object (Class) Interaction Subject Verb Phrase Object Lot will hold (max of 5) Cars Cars enter (back of) Lot Cars leave (front of) Lot Lot uses Spar Spar holdsCars LotSim exhibits (working of) Lot Cars write Messages

  6. Diagram of the Parking Lot Entry Road Lot Spar Exit Road

  7. Object Model Diagram generates LotSim shows uses holds Lot Spar Car enter leave holds

  8. Design Phase – Refine Object Model LotSim generates Car list enter(Car) leave(Car) Lot Car double arrTime double depTime String name Car list int capacity

  9. Design Phase – State Transition Diagrams enter enter enter enter enter enter start 5 0 1 3 4 2 leave leave leave leave leave isFull == TRUE * States of Lot objects – maxCars = 5 * IsFull tested on each state

  10. Class Lot Lot Car list int capacity enter (Car c) leave(Car c) boolean isFull( ) Lot ( ) Messages received from LotSim

  11. Design Phase – State Transition Diagrams parked leave park newCar String name double arrTime double depTime discarded Start balk State Diagram for Car Objects

  12. Class Car Car double arrTime double depTime String name car(String, double, double) park ( ) leave( ) balk( ) Methods park, leave, and balk invoked from Lot objects -- messages displayed on monitor

  13. Design Phase – State Transition Diagrams push push start 0 1 lot_size - 1 pop pop push isEmpty ==TRUE error State Transitions of Spar Objects

  14. Design Phase – Refine Object Model push(Car) pop( ) Spar push(Car) Lot Car List attributes pop( ) methods IsEmpty( )

  15. Design Phase – Refine Object Model Class Spar is_a Stack class Spar extends Stack { private static final int sparSize = 4; public void push (Car myCar) { if (size ( ) < sparSize) { super.push(); } }

  16. Object-oriented Analysis and Design Source code for Parking Lot simulation classes Car.javaclass Car, Lot.javaclass Lot Deck.java class Deck, LotSim.java Application class Source code for PriorityQ and EventDriver classes PriorityQ.java A data structure for holding event notices EventDriver.java An application that generates and processes events