UML教材1Hotel Case文档.docx
《UML教材1Hotel Case文档.docx》由会员分享,可在线阅读,更多相关《UML教材1Hotel Case文档.docx(19页珍藏版)》请在冰豆网上搜索。
![UML教材1Hotel Case文档.docx](https://file1.bdocx.com/fileroot1/2022-12/1/526061ba-eaf5-4041-85ff-aef3317d5c15/526061ba-eaf5-4041-85ff-aef3317d5c151.gif)
UML教材1HotelCase文档
GiantForestInnSystem
StepsinObject-OrientedSystemsAnalysis:
1.Identifythebusinesseventsandmakeaneventtable(Chapter3)
2.Identifytheusecasesandproduceausecasediagramforthesystem(Chapter4)
3.Writeausecasenarrativedescribingthesystem’sresponsetoeachbusinessevent(Chapter4)
4.Drawasystemsequencediagramforeachusecasescenario(Chapter4)
5.Produceadomainmodelshowingtheconcepts,attributes,andassociationsintheproblemdomainofthesystem(Chapter5)
6.Writeacontractforeachsystemoperation(Chapter5)
1.Identifythebusinesseventsandmakeaneventtable(Chapter3)
A.Listofbusinessevents:
∙Guestreservesroom–externalevent
∙Guestregisters–externalevent
∙Guestincurschargeforservice–externalevent
∙Guestaddstiptobillforservicecharge–externalevent
∙Hotelproducesfinalbill–temporalevent
∙Guestpaysbill–externalevent
∙Guestchecksout–externalevent
B.EventTable:
EventTablefortheGiantForestInnGuestSystem
Event
Number
EventDescription
SystemInput
ActorProvidingInput
SystemOutput
Actor
Receiving
Output
1.
Guestreservesroom
Reservation
Request
Guest
Confirmation
Authorization
Request
Guest
CreditAuthorization
System
2.
Guestregisters
Registration
Request
Guest
Room
Assignment
Guest
3.
Guestincurschargeforservice
Service
Request
Employee
Service
Charge
Receipt
Guest
4.
Guestaddstiptobillforservicecharge
Tip
Guest
5.
Timetoproducefinalbill
Bill
Guest
6.
Guestpaysbill
Payment
Guest
Authorization
Request
Receipt
CreditAuthorization
System
Guest
7.
Guestchecksout
CheckOut
Request
Guest
2.Identifytheusecasesandproduceausecasediagramforthehotelsystem
(Chapter4)
A.Listofusecases:
∙ReserveRoom
∙RegisterGuest
∙ChargeService
∙AddTiptoServiceCharge
∙ProduceFinalBill
∙PaysBill
∙CheckOutGuest
B.ListofActors:
(i)Guest–initiatingandparticipating
(ii)Employee–initiating
(iii)CreditAuthorizationSystem–participating
C.UseCaseDiagram:
3.Writeausecasenarrativedescribingthehotelsystem'sresponsetoeachbusinessevent(Chapter4)
Usecase:
ReserveRoom
Actors:
Guest
Purpose:
Tomakearoomreservation.
Overview:
Guestsubmitsareservationrequest.Astheguestmayselectaspecificroom,thisisincludedintherequest.Iftheguesthasnopreference,thesystemselectsaroombasedonthetypeandpriceofaccommodationrequired.Ifaroomisavailable,guestisthenaskedforacreditcardtoreservetheroom.Thesystemthensendsanauthorizationrequesttothecreditcardauthorizationsystem.Whenapproved,aconfirmationissenttotheguestandtheroomisreserved.
Type:
Essential
Preconditions:
Roomavailabilitymustbeknowntothesystem.
Guestmusthaveavalidcreditcard.
Postconditions:
Reservationwasrecordedinthesystem.
SpecialRequirements:
Guestmustgetasystemresponsewithinfiveseconds.
FlowofEvents
ActorAction
SystemResponse
1.Thisusecasebeginswhenaguestsubmitsareservation.
2.Guestentersaphonenumber.
3.Looksuptheguestrecord.
4.[newguest]Guestentersnameandaddress.
5.Savestheguest.
6.[roompreferenceknown]Guestentersroomidentifierfollowedbyarrivaldate,numberofnights,andnumberofoccupants.
7.Informstheguesttheroomisavailable.
8.[roompreferencenotknown]Guestenterstypeofroomandviewdesiredfollowedbyarrivaldate,numberofnights,andnumberofoccupants.
9.Informstheguestaroomisavailable.
10.Guestenterscreditcardnumber,expirationmonth,andexpirationyear.
11.Sendsthecreditcardnumber,informationandmerchantnumbertothecreditauthorizationsystem.Whenanauthorizationnumberisreceived,itproducesaconfirmationandreservestheroom.
12.Guestreceivestheirconfirmation.
AlternativeFlowofEvents
Line3:
Ifguestalreadyinthesystem,gotostep6.
Line7.Ifroomnotavailable,systeminformsguestandgoestostep8.
Line9.Ifroomnotavailable,systeminformsguestandreturnstostep8.
Line11:
Ifcreditcardisnotauthorized,systeminformsguestandterminates.
Usecase:
RegisterGuest
Actors:
Guest
Purpose:
Tocheckintoinn.
Overview:
Guestsubmitsaconfirmationnumber.Iftheguesthasnoconfirmationnumber,theguestreservesaroomfirst.Theguestisthengivenaroomassignment.
Type:
Essential
Preconditions:
Reservationconfirmationmustbeknowntothesystem.
Postconditions:
Registrationwasrecordedinthesystem.
SpecialRequirements:
Guestmustgetasystemresponsewithin15seconds.
FlowofEvents
ActorAction
SystemResponse
1.Thisusecasebeginswhenguestarrivesatfrontdesk.
2.Guestentersconfirmationnumber.
3.Looksuptheguestreservationandrecordsthearrivaltime.Theguestisgivenaroomassignment.
4.Guestreceivesaroomassignment.
AlternativeFlowofEvents
Line2:
Ifguestdoesnothaveareservation,executetheReserveRoomusecasefirst.
Usecase:
ChargeService
Actors:
Employee
Purpose:
Torecordchargesincurredbyguests.
Overview:
Whenaguesthasreceivedaservicefromtheinn,theemployeesubmitsarecordoftheserviceforlaterbilling.
Type:
Essential
Preconditions:
Guestmustbecheckedintoinn.
Postconditions:
Servicechargewasrecordedinthesystem.
SpecialRequirements:
None
FlowofEvents
ActorAction
SystemResponse
1.Thisusecasebeginswhenaguestincursaservicecharge.
2.Employeeentersroomidentifier,servicetime,servicedescription,andserviceprice.
3.Recordstheservicechargeandproducesaservicechargereceipt.
4.Theguestreceivesaservicechargereceipt.
AlternativeFlowofEvents
None
Usecase:
AddTiptoServiceCharge
Actors:
Guest
Purpose:
Toallowguesttotipemployeesforgoodservice.
Overview:
Aftertheguestincursaservicecharge,theyarepresentedwithaservicechargereceipt.Whenconvenienttheguestwritesinatipamount.Thistipamountisaddedtotheservicecharge.
Type:
Essential
Preconditions:
Guestmusthaveaservicechargereceipt.
Postconditions:
Updatedservicechargewasrecordedinthesystem.
SpecialRequirements:
None
FlowofEvents
ActorAction
SystemResponse
1.Thisusecasebeginswhenaguestwishestoaddatiptoaservicecharge.
2.Guestentersroomidentifier,servicetime,servicenumber,andtipamount.
3.Addsthetiptotheservicecharge.
AlternativeFlowofEvents
None.
Usecase:
PayBill
Actors:
Guest
Purpose:
Toacceptthreedifferentkindsofpayment.
Overview:
Guestmaypaybycash,check,orcreditcard.Ifpaymentiscashorcheck,areceiptissenttotheguest.Ifpaymentisacreditcard,thesystemthensendsanauthorizationrequesttothecreditcardauthorizationsystem.Whenapproved,areceiptissenttotheguest.
Type:
Essential
Preconditions:
Finalbillmusthavedeliveredtotheguest.
Postconditions:
Paymentwasrecordedinthesystem.
SpecialRequirements:
None
FlowofEvents
ActorAction
SystemResponse
1.Thisusecasebeginswhenaguestisreadytopaybill.
Chooseone:
2.[cashpayment]Roomidentifierandamountisentered.
3.Recordsthepaymentandproducesareceipt.
4.[checkpayment]Roomidentifier,amount,andchecknumberisentered.
5.Recordsthepaymentandproducesareceipt.
6.[creditcardpayment]Roomidentifier,amount,creditcardnumber,expirationmonth,andexpirationyearisentered.
7.Sendsthecreditcardnumber,expirationmonth,expirationyear,amount,andmerchantnumbertothecreditcardauthorizationsystem.Whenanauthorizationnumberisreceived,recordsthepaymentandproducesareceipt.
8.Guestreceivestheirreceipt.
AlternativeFlowofEvents
Line7:
Ifcreditcardisnotauthorized,systeminformsguestandanothermethodofpaymentisused.
Usecase:
CheckOutGuest
Actors:
Guest
Purpose:
Tocheckoutfrominn.
Overview:
Afterguesthaspaidtheirbill,theyinformtheinnwhentheyactuallycheckout.Thealsoreturntheirroomkeyatthistime.
Type:
Essential
Preconditions:
Billmusthavebeenpaid.
Postconditions:
Timeofcheckoutwassavedinthesystem.
SpecialRequirements:
None
FlowofEvents
ActorAction
SystemResponse
1.Thisusecasebeginswhenguestarrivesatfrontdesktocheckout.
2.Guestentersroomidentifier.
3.Looksuptheguestrecordsandrecordsthedeparturetime.
6.Guestdeparts.
AlternativeFlowofEvents
Line3:
Ifguesthasnotpaidtheirbill,executethePayBillusecasefirst.
4.Drawasystemsequencediagramforeachoftheusecasesinthehotelsystem.(Chapter4)
Step5.Produceadomainmodelshowingtheconcepts,attributes,andassociationsintheproblemdomainofthesystem.
Therearemanywaystomodelthereservationofaroomforaparticulardate.WehavechosentocreateaconceptcalledanAccommodation.Thisisanassociationconceptbetweenreservationandroom.Tocheckifaroomisavailable,oneneedsonlytolookforinstancesofAccommodationsforthedatesrequested.Iftheinstancesdonotexist,theroomsareavailable.
Thisdomainmodelcontainsageneralization-specializationhierarchyofPaymentconcepts,whichwillbefamiliartomostallstudents.WehavealsoincludedspecificationconceptsforServiceChargeandRoom.
Theidentificationofattributesisusuallynotdifficult.Aproblemistheuseofdatesandtimes.Sincemostprogramminglanguagesdonotdistinguishbetweenthem,itisnotacriticalissue.
Theassociati