Sei sulla pagina 1di 4

Suggested solutions to E-Car Rental System

May 7, 2009
See the website for a description of the problem. Note that these diagrams are suggested solutions. There are may valid ways to model most problems. Marks will be given for a reasonable model provided that the UML diagrams are correct. Fig1 shows a use case model for the e-car rental system. Note the use of the << extends >> and << includes >> relationships in the use case diagram. There is a general use case called Return a Vehicle. When the vehicle is returned by the user the functionality provided by the billing use case is included is also executed. Note that a customer may return a vehicle earlier or later than agreed. The use case diagram shows that in the event of an Early Return or a Late Return, the basic Return a Vehicle use case is invoked. However its functionality is extended to allow a ne to be charged or perhaps a discount to be applied on early return. A sequence diagram is shown in Fig.2. This sequence diagram matches the reserve a Vehicle Use Case specied in the LabWork handout(available on the course website). A class diagram for the E-Car Rental system is shown in Fig.3. Note the reserves association between the Customer and Vehicle classes, i.e a Customer reserves a Vehicle. This is an important or interesting relationship and we can model this relationship using an association class. This association class is the Reservation class which, as shown in Fig.3 contains zero or more insurance or protection plan products. Note the dashed line between the Reservation class and the reserves association connecting the Customer and Vehicle classes. the dashed line indicates that the Reservation class provides the functionality required when a customer makes a vehicle reservation.

Reserve a vehicle

Cancel a reservation

Billing

Pick up a vehicle customer <<include>> View car catalogue Add new car

Administrator

Remove car Return a vehicle

<<extend>> <<extend>> View rental schedule

Early return

Late Return

Mechanic

Figure 1: Use Case Diagram for Car Rental System

Customer:

Interface to Online System:

Depot:

Customer Profiles:

Vehicle Inventory:

Vehicle:

Protection Products:

Reservation:

make a reservation

prompt for ID

enter profile ID obtain customer profile

prompt for location provide location details retrieve vehicles for date/ time retrieve vehicles match criteria

show matching vehicles

select a vehicle get protection product details

prompt for complete information

customer indicates choices

populate reservation information

create reservation record

inform customer of reservation id

Figure 2: Sequence Diagram for the Reserve a Vehicle Use Case

Vehicle Inventory

Vehicle 1..* status : vehicleCategory : reserve() updateStatus()

1..*

reserves

1..*

Customer name : mailingAddress : telephoneNumber : emailAddress : populate() assign() getProfile()

populate() add() mark()

Reservation startDate startTime : endDate endTime : estimatedCost

Depot streetAddress : geographicState : location : populate() 0..* Protection Product dailyCost : liabilityLimits : newOperation()

Customer Profile vehicleCategoryPreference : smokingPreference :

Figure 3: Class Diagram for the Car Rental

Potrebbero piacerti anche