UML教材1Car Case文档Word下载.docx
《UML教材1Car Case文档Word下载.docx》由会员分享,可在线阅读,更多相关《UML教材1Car Case文档Word下载.docx(18页珍藏版)》请在冰豆网上搜索。
NotethatthisanswerisattheendofChapter4exceptthattheevent“CompanyCreatesbill”isomittedhere.Thesolutionpresentedinthisinstructor’sguideassumesthatthebilliscreatedasanoutputtotheevent“CompanyInspectsCar.”
B.EventTable:
EventTablefortheApacheRentACarRentalSystem
Event
Number
EventDescription
System
Input
ActorProviding
Output
Actor
Receiving
1.
Customerreservesacar
Reservation
Request
Customer
Confirmation
Authorization
Payment
authorizationsystem
2.
Customerrentsacar
RentalRequest
MileageOut
Employee
RentalAgreement
3.
Customerreturnsacar
ReturnRequest
4.
Companyinspectscar
Inspection
Bill
ThirdParty
5.
Customerpaysbill
Receipt
2.Identifytheusecasesandproduceausecasediagramforthesystem
(Chapter4)
A.Listofusecases:
∙ReserveCar
∙RentCar
∙ReturnCar
∙InspectCar
∙PayBill
B.ListofActors:
(i)Customer–initiatingandparticipating
(ii)Employee–initiating
(iii)CreditAuthorizationSystem–participating
(iv)ThirdPartyCustomer–participating
C.UseCaseDiagram:
3.Writeausecasenarrativedescribingthesystem'
sresponsetoeachbusinessevent(Chapter4)
Usecase:
ReserveCar
Actors:
Purpose:
Tomakeacarrentalreservation.
Overview:
Customersubmitsareservationrequest.Ifacartypeisavailable,customeristhenaskedforacreditcardtoreservethecar.Thesystemthensendsanauthorizationrequesttothecreditcardauthorizationsystem.Whenapproved,aconfirmationissenttothecustomer.
Type:
Essential
Preconditions:
Carspecificationsmustbeknowntothesystem.
Customermusthaveavalidcreditcard.
Postconditions:
Reservationwassavedinthesystem.
SpecialRequirements:
Customermustgetasystemresponsewithin5seconds.
FlowofEvents
ActorAction
SystemResponse
1.Thisusecasebeginswhenacustomersubmitsareservation.
2.Customerenterscartype,pickupdate,andreturndate.
3.Savesthereservation.
4.Customerentershisorherphonenumber,name,andaddress.
5.Savesthecustomerrecord.
6.Customerenterscreditcardnumber,expirationmonth,andexpirationyear.
7.Sendsthecreditcardnumber,expirationmonth,expirationyear,amount,andmerchantnumbertothecreditcardauthorizationsystem.Whenanauthorizationnumberisreceived,thecustomerisinformedandtheinformationissaved.
8.Customerreceivesaconfirmation.
AlternativeFlowofEvents
Line3.Ifcartypeisnotavailable,systeminformscustomerandreturnstoStep2.
Line7:
Ifcreditcardisnotauthorized,systeminformscustomerandterminatesthereservationrequest.
RentCar
Customer,Employee
Torecordarentalagreement.
Customersubmitsarentalrequest.Theemployeeentersthemileageout.Thesystemthenrecordsalltheauthorizeddriversandextrachargesthecustomerhasagreedto.Lastlythesystemproducesarentalagreement.
Areservationmusthavebeencompleted.
Rentalagreementwassavedinthesystem.Producesarentalagreement.
Customermustgetasystemresponsewithin15seconds.
1.Thisusecasebeginswhenacustomerarrivestopickuprentalcar.
2.[customerdoesnothaveareservation]ExecutetheReservesCarusecase.
3.Customerentersconfirmationnumberandtimeout.
4.Requeststhemileageoutfromanemployee.Whenamileageoutisreceived,therentalcontractissaved.
5.Customerentersname,birthdate,driver’slicensenumber,andstateofissueforeachdriver.
6.Addsdriverstotherentalagreement.
7.[customerisusingathird-partypayer]Customerentersaccountnumberofthirdpartythatwillpaytherentalcharges.
8.Addsaccountnumbertotherentalagreement.
9.Customerentersextrachargestobepaid(collisiondamagewaiver,liabilityinsurance,personalaccidentinsurance).
10.Addstheextrachargestotherentalagreement.Producesarentalagreement.
11.Customerreceivesarentalagreement.
Line7.Ifaccountnumberisinvalidinformthecustomer,andreturntoStep9.
ReturnCar
Torecordthetimethecarwasreturned.
Afterthecustomerreturnstherentalcar,thetimeisrecordedsothecustomerincursnomorecharges.
Customermusthaverentedacar.
Thesystemrecordsthetimereturned.
None
1.Thisusecasebeginswhenacustomerreturnsarentalcar.
2.Customerenterslicensenumberandtimein.
3.Recordsthetimethecarwasreturned.
InspectCar
Torecordthemileageinandverifythatcarwasreturnedwithafulltankofgaswithoutdamage.
Afterthecustomerreturnstherentalcar,anemployeeinspectsthecarforgasanddamage.Theyalsorecordthemileageinforuseincreatingabill.Thebillisthenpresentedtothecustomer.
Customermusthavereturnedcar.
Thecustomerbillisproduced.
1.Thisusecasebeginsafteracustomerhasreturnedarentalcar.
2.Employeeenterslicensenumber,damage,gaslevel,andmileagein.
3.Recordsthedamage,gaslevel,andmileagein.Computestheextrachargesforgas,excessmileage,damage,andproducesabill.
4.Customerreceivesabill.
.
None.
PayBill
Tomakeapaymentforcarrental.
Customermaypayonlybycreditcard.Thesystemthensendsanauthorizationrequesttothecreditcardauthorizationsystem.Whenapproved,areceiptissenttothecustomer.
Finalbillmusthavebeenpresentedtothecustomer.
Paymentwassavedinthesystem.
1.Thisusecasebeginswhenacustomerisreadytopaybill.
2.Thecustomerenterslicensenumber,amountpaid,creditcardnumber,expirationmonth,andexpirationyear.
3.Sendsthecreditcardnumber,expirationmonth,expirationyear,amount,andmerchantnumbertothecreditcardauthorizationsystem.Whenanauthorizationnumberisreceived,thepaymentisrecorded.Arentalreceiptisproduced.
4.Customerreceivestherentalreceipt.
Line3:
Ifcreditcardisnotauthorized,systeminformscustomerandreturntoStep2.
4.Drawasystemsequencediagramforeachoftheusecasesinthecarrentalsystem.(Chapter4)
Step5.Produceadomainmodelshowingtheconcepts,attributes,andassociationsintheproblemdomainofthesystem.
ApacheRentACarDomainModel
NotethatReservationisnotassociatedwithcarasitdoesnotspecifyaparticularcar.Itonlyguaranteesaprice,thusitisassociatedwithaRateClassconcept.Thecarisassignedduringtherental.TheRentalisthecenterofattentioninthisdomainmodel.Almosteveryconceptassociateswithit.AswellastheThirdPartyCustomer,therentalhasextracharges,drivers,inspection,return,andpayment.
Twospecificationconceptsareused.TheyaretheRateClass,whichdescribestheCar,andtheExtraChargeSpecificationthatdescribestheExtraCharge.
Thereisoneinheritance,whichissimpletocomprehend.Boththerentalcustomerandthethirdpartycustomerhaveaphonenumber,name,andaddress.Thustheseattributesareobviouscandidatesforinheritance.
Thecreditcardisusedduringthereservationforguaranteepurposesandlastlyforthepaymentwhenthecarhasbeenreturnedandinspected.Wehaveassumedduringrentalthecreditcardisthesameoneusedforthereservationsoitisnotrecordedthen.Thisisacriticalassumptionthatshouldbemadeclearduringtheassignment.
Recallitisbesttonotallowcashorcheckpayments.
Theidentificationofattributesisusuallynotdifficult.Aproblemisdistinguishingtheuseofdatesandtimes.Asmostprogramminglanguagesdonotdistinguishbetweenthem,itisnotacriticalissue.
Theassociationnamesareneverusedindesign;
buttheyareusedtomaketherequirementseasiertounderstand,especiallythecontracts.
Themultiplicitiesarealsonotcriticalatthistimebutalsomake