UML Car Rental System v1.1

download UML Car Rental System v1.1

of 16

Transcript of UML Car Rental System v1.1

  • 8/16/2019 UML Car Rental System v1.1

    1/16

     

    UML Training

    Car Rental Software System

  • 8/16/2019 UML Car Rental System v1.1

    2/16

    UML

    UML is a notation for visually describing and

    interpreting the pieces, relationships, and actions that comprise

    a software application.

    With UML modeling features, users can createsophisticated diagrams to specify their application architecture

    and business requirements, and can communicate these

    across their teams.

  • 8/16/2019 UML Car Rental System v1.1

    3/16

    Application Scenario: Car Rental Software

    System

    This scenario discusses how the eight UMLdiagram types might be used to model a car rental

    agency's software system. 

  • 8/16/2019 UML Car Rental System v1.1

    4/16

    Use-Case Diagram

      use case specifies an interaction between a user and the system in

    which the user is able to achieve a goal. typical software system might include

    hundreds of simple use cases. !ome use cases applicable to the rental agency's

    system are"

    • Customer reserves car #efore obtaining a car, a customer must ma$e a reservation. The customer

    contacts the rental agency and ma$es a request. The agency accepts ordeclines the request based on a number of criteria, such as the availability ofcars or the customer's rental history. %f the reservation is accepted, the agencycompletes a form containing customer details. &ayment of a deposit completesthe reservation.• Customer picks up car 

    When the customer arrives at the agency, the rental agency allocates the modelof car requested by the customer, depending on current stoc$ levels. fterpaying the full fee, the customer receives the car.• Customer returns car The customer returns the car to the agency on the day specified in the rentalagreement.

  • 8/16/2019 UML Car Rental System v1.1

    5/16

    Figure ! Use-case "iagram

  • 8/16/2019 UML Car Rental System v1.1

    6/16

    Static Structure #Class$ Diagram

    The net tas$ is to classify the ob(ects involved and their relationships.

    %&amining use cases 'elps i"entify classes. )lasses of ob(ects are modeledusing static structure, or class, diagrams that show the overall structure of the

    system, as well as relational and behavioral properties.

    • %n a class diagram, the ob(ects involved in the car rental system aregrouped into classes. *ach class contains a name section and an

    attribute section. !ome classes also include an operations section, whichspecifies how ob(ects within that class may behave.

    • %n the )ustomer class, attributes include name, telephone number,driver's license number, and address. The date of birth is required todetermine that the customer meets the minimum age requirement to renta vehicle. The )ustomer class also stores operations, such asreservations.

    • )lass diagrams support inheritance. %n the following figure, foreample, the Mechanic and +ental gent classes inherit attributes, suchas name and address, from the *mployee class.

  • 8/16/2019 UML Car Rental System v1.1

    7/16

    Figure 2. Static structure, or Class diagram

  • 8/16/2019 UML Car Rental System v1.1

    8/16

  • 8/16/2019 UML Car Rental System v1.1

    9/16

    Figure 3. Sequence diagram

  • 8/16/2019 UML Car Rental System v1.1

    10/16

    Colla)oration Diagram

      collaboration diagram is another type of interaction

    diagram. Li$e a sequence diagram, it shows how a group of ob(ectsin a use case wor$ with one another. *ach message is numbered todocument the order in which it occurs.

    Figure *! Colla)oration "iagram

  • 8/16/2019 UML Car Rental System v1.1

    11/16

     

     n ob(ect's state is defined as its attributes at a particularmoment. -b(ects move through various states as they areinfluenced by outside stimuli. The statechart diagram mapsthese states, as well as the triggering events that cause theob(ect to be in a particular state.or eample, in our rental system, the ob(ect is a car. s a

    car moves through the rental system, its many statesproduce a comple but illuminating diagram.or eample, it is first added to the fleet. %t remains in thestate %n!toc$ until it is rented. fter renting, the car isreturned to the fleet and to the %n!toc$ state. t various timesin its commercial life, the car may require repairs %n!ervice/.When the car reaches the end of its usefulness, it is eithersold or scrapped to ma$e way for a new vehicle. 

    Statec'art Diagram

  • 8/16/2019 UML Car Rental System v1.1

    12/16

  • 8/16/2019 UML Car Rental System v1.1

    13/16

      n activity diagram displays the logic that occurs in

    response to internally generated actions. n activity diagram relatesto a specific class or use case, and shows the steps involved incarrying out a particular operation.

     

    Figure +! An activity "iagram

    Activity Diagram

  • 8/16/2019 UML Car Rental System v1.1

    14/16

      component diagram shows how various softwaresubsystems ma$e up the overall structure of the system, which is

    built on a centrali0ed database that contains past rental records, cardetails, service records, and customer and employee details. %t iscritical that this data be centrali0ed in one database, because stoc$levels vary by the hour and all parties must have up1to1the minuteinformation. 2eeping the data current requires real1time informationupdates by all parties. The software subsystems for this eample

    include )ar +ecords, !ervice +ecords, !ales +ecords, )ustomer+ecords, and *mployee +ecords.

     

    Figure ,! Component "iagram

    Component Diagram

  • 8/16/2019 UML Car Rental System v1.1

    15/16

        deployment diagram shows how the hardware and

    software in the system are configured. The rental agency needs aclient3server system with a central database of records that the staffcan access. +ental agents need access to the data on vehicleavailability. Meanwhile, mechanics need to be able to flag aparticular car as being in the %n!ervice state.

     

    Figure ! Deployment "iagram

    Deployment Diagram

  • 8/16/2019 UML Car Rental System v1.1

    16/16

    .'ank /ou