UML教材2Car Case DesignWord文件下载.docx
- 文档编号:5132206
- 上传时间:2023-05-04
- 格式:DOCX
- 页数:30
- 大小:1.23MB
UML教材2Car Case DesignWord文件下载.docx
《UML教材2Car Case DesignWord文件下载.docx》由会员分享,可在线阅读,更多相关《UML教材2Car Case DesignWord文件下载.docx(30页珍藏版)》请在冰点文库上搜索。
∙Disadvantage:
Thetwoprocessorswillhavetocommunicatefrequentlywitheachother.
b.Alternative“B”allocatestheusecasestosameprocessor,butaddsasecondprocessorforthedatastorage.
Thiswillensurethatthedataissecure.Itwillbeeasiertobackupandmaintainaswell.
Thetwoprocessorswillhavetocommunicatefrequentlywitheachother.
c.Alternative“C”sameasAlternative“A”butallocatesalldatastoragetoaseparatestorageprocessor.
Thisallowstheprocessorstobesinglefunctionandthuscanbeoptimized.Italsomakesiteasytobackupthedatastorage,asitisseparate.
Thethreeprocessorswillhavetocommunicatefrequentlywitheachother.
ApacheRentACar–Chapter8
Thischapterdiscussesthefirststepoftheseven-stepprocessforobject-orientedprogramdesign.Thisstepis:
Step1.Produceaninteractiondiagramforeachsystemoperationidentifiedduringanalysis
ApacheRentACarAssignments–Chapter8
ApacheRentACarInteractionDiagram
Thetextbookshowsalltheintermediatestepsnecessarytoobtainacollaborationdiagram.Attheendofthechapter,theyareconvertedtoasequencediagram.Oncetheindividualeventshavebeenconvertedtoacollaborationdiagram,itiscommontoconvertthemtoasequencediagram.Manypeoplefeelitiseasiertoreadsequencediagramsbecauseoftheirsequentialnature.Theanswerstothesequestionsarepresentedinthisformat.Alsoallsystemoperationsforeachusecasearegroupedtogetherinasinglesequencediagraminthesystem.
Developaseparatesetofinteractiondiagrams(eithercollaborationorsequencediagrams)foreachoftheusecasesintheRentACarsystem.
BesurethattheinteractiondiagramforeachusecasedemonstrateshowyouverifythepreconditionsandsatisfythepostconditionsforeachofthesystemoperationcontractspreparedfortheChapter5assignments.Showanexplicitcreateoperationforeachnewobject.Alsoshowanexplicitassociateoperationforeachnewlyestablishedlink.Alsobesurethateachobjectknowsalltheargumentsforanymessagethatitsends.
Suggestion:
SketchtheinteractiondiagramsfollowingthemethoddescribedinChapter8beforeyouuseanysoftwaretooltopreparethediagrams.
ApacheRentACar–Chapter9
Thischapterdiscussessteps2and3oftheseven-stepprocessforobject-orientedprogramdesign.Thesestepsare:
Step2.Produceadesignclassdiagramshowingtheoperationsfromtheinteractiondiagrams.
Step3.Specifythesignatureandthealgorithmforeachoperation.
ApacheRentACarAssignments–Chapter9
ApacheRentACarClassDiagram
Chapter9showsthedevelopmentoftheclassdiagramwithaspecialemphasisonqualifiedassociations.
1.DevelopadesignclassdiagramfortheApacheRentACarsystem.
Payparticularattentiontoappropriateuseoftheaggregationandcompositionsymbols,whichareusedwhenanassociationbetweenclassesrelatespartstowholes,memberstogroups,orcontentstocontainers.Showclasshierarchies.Alsobesuretoindicateonthediagramnavigabilityfromoneclasstoanother.
2.ReviseandrefinetheinteractiondiagramsdevelopedfortheChapter8assignment.CorrectanyviolationsoftheLawofDemeter,reducethecoupling,andincreasethecohesion.Modifythedesignclassdiagramtobeconsistentwiththeseimprovements.
Wetookgreatcaretobesurenoneoftheseviolationswerepresentedearlier.Moststudentsunderstandcouplingandcohesion.TheLawofDemeterisprobablythemostdifficultonetoavoid.NotethatoperationslikemakeReturn,makeDriver,makeExtraCharge,andmakePaymentoccurinCarandRental.Thisispreferabletohavingthefaç
adeobjectinvokeagetoperationineachoftheaboveclassestoobtaintherentalobjectandthensendamessagetoit.Thishabitiscommonamongbeginners,especiallyinprogrammingclasses.
ApacheRentACarSignatures
Althoughnotaskedfor,signaturesforalloperationswillbeprovided.Thismakesitpossiblefortheinstructortoeasilyaddanassignmenttodevelopthem.
3.Developsignaturesforalloperations.Youmayomitthe“creates”becausetheyareofastandardformat.(optionalquestion)
ThisanswerisprovidedwithsignaturesinaUMLformatasinFigure9.22.ThedatatypesarecompatiblewithJava.
CompleteSpecificationofAttributesandOperations–ApacheRentACar
Car
Attributes
-color:
String
-licenseNumber:
-make:
-model:
-modelYear:
int
Operations
+associateExtraChargeSpecification
(extraChargeSpecification,ExtraChargeSpecification)
+associateRental(rental:
Rental)
+associateInspection(inspection:
Inspection)
+associateThirdPartyPayer(thirdPartyPayer,ThirdPartyPayer)
+authorize(amount:
double,merchantNumber:
int):
boolean
+makeCreditCard(creditCardNumber:
String,
expirationMonth:
int,expirationYear:
int)
+makeDriver(name:
String,birthDate:
Date,
driversLicenseNumber:
String,stateOfIssue:
String)
+makeExtraCharge(amountCharged:
double)
+makeInspection(damage:
double,gasLevel:
double,mileageIn:
int,
time:
Date)
+makePayment(amount:
+makeRental(timeOut:
Date,mileageOut:
+makeReturn(timeIn:
CreditCard
-creditCardNumber:
-expirationMonth:
-expirationYear:
Customer
-address:
-name:
String
-phoneNumber:
None
CompleteSpecificationofAttributesandOperations–ApacheRentACar(Continued)
Driver
-birthDate:
Date
-driversLicenseNumber:
-stateOfIssue:
ExtraCharge
-amountCharged:
double
ExtraChargeSpecification
-extraChargeCode:
-description:
-price:
Inspection
-damage:
double
-gasLevel:
-mileageIn:
-time:
Payment
-amount:
-authorizationNumber:
-date:
+associateCreditCard(creditCard:
CreditCard)
double,
merchantNumber:
RentalSystem
+assignCar()
+enterCarRequest(carType:
String,pickUpDate:
returnDate:
+enterConfirmation(confirmationNumber:
int,timeOut:
+enterCreditCard(creditCardNumber:
+enterCustomer(phoneNumber:
String,name:
String,address:
+enterDriver(name:
+enterExtraCharge(extraChargeCode:
String,amountCharged:
+enterInspection(licenseNumber:
String,damage:
gasLevel:
+enterMileageOut(mileageOut:
+enterReturn(licenseNumber:
String,timeIn:
+enterThirdPartyCustomer(accountNumber:
+enterPayment(licenseNumber:
String,amount:
+verifyCarLicense(licenseNumber:
String):
+verifyConfirmationNumber(confirmationNumber:
+verifyExtraChargeCode(extraChargeCode:
boolean
+verifyRateCode(carType:
+verifyThirdPartyCustomer(accountNumber:
RateClass
-carType:
-dailyRate:
-mileageRate:
-numberOfFreeMiles:
-weekEndRate:
-weeklyRate:
Rental
-agreementNumber:
-mileageOut:
-timeOut:
+associateDriver(checkOut:
CheckOut)
+associateExtraCharge(extraCharge,ExtraCharge)
+associateInspection(inspection,Inspection)
+associatePayment(payment,Payment)
+associateReservation(reservation,Reservation)
+associateReturn(return,Return)
+associateThirdPartyPayer
(thirdPartyCustomer,ThirdPartyCustomer)
+makeCreditCard(creditCardNumber:
expirationMonth:
int,expiration
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- UML教材2Car Case Design UML 教材 Car