1、UML教材2Car Case DesignAPACHE RENT A CAR CASE DESIGNThis section contains the design models for the Apache Rent A Car case. The models appear in chapter sequence.Apache Rent A Car Chapter 7Introduction This chapter discusses the design of the overall system structure. The questions illustrate how to:1
2、. Allocate Essential Use Cases to Processors2. Allocate Stored Data to Storage DevicesNote that these steps are not part of the seven steps for program design.Apache Rent A Car Assignments Chapter 71. Define three alternative system structures for the Apache Rent A Car system. (See Figures 7.13, 7.1
3、4, and 7.15 for the university registration system.)Alternative “A” allocates the use cases to two processors. Alternative “B” allocates the use cases to a single processor, but adds a second processor for the data storage. Alternative “C” same as Alternative “A” but also allocates the data storage
4、to a separate processor. 2. Discuss qualitatively the advantages and disadvantages of each alternative.a. Alternative “A” allocates the use cases two processors Advantage: This keeps the car maintenance system used by employees separate from the reservation and rental system used by the customers. D
5、isadvantage: The two processors will have to communicate frequently with each other. b. Alternative “B” allocates the use cases to same processor, but adds a second processor for the data storage. Advantage: This will ensure that the data is secure. It will be easier to back up and maintain as well.
6、 Disadvantage: The two processors will have to communicate frequently with each other.c. Alternative “C” same as Alternative “A” but allocates all data storage to a separate storage processor. Advantage: This allows the processors to be single function and thus can be optimized. It also makes it eas
7、y to back up the data storage, as it is separate. Disadvantage: The three processors will have to communicate frequently with each other.Apache Rent A Car Chapter 8 Introduction This chapter discusses the first step of the seven-step process for object-oriented program design. This step is:Step 1. P
8、roduce an interaction diagram for each system operation identified during analysisApache Rent A Car Assignments Chapter 8 Apache Rent A Car Interaction DiagramThe textbook shows all the intermediate steps necessary to obtain a collaboration diagram. At the end of the chapter, they are converted to a
9、 sequence diagram. Once the individual events have been converted to a collaboration diagram, it is common to convert them to a sequence diagram. Many people feel it is easier to read sequence diagrams because of their sequential nature. The answers to these questions are presented in this format. A
10、lso all system operations for each use case are grouped together in a single sequence diagram in the system.Develop a separate set of interaction diagrams (either collaboration or sequence diagrams) for each of the use cases in the Rent A Car system. Be sure that the interaction diagram for each use
11、 case demonstrates how you verify the preconditions and satisfy the postconditions for each of the system operation contracts prepared for the Chapter 5 assignments. Show an explicit create operation for each new object. Also show an explicit associate operation for each newly established link. Also
12、 be sure that each object knows all the arguments for any message that it sends.Suggestion: Sketch the interaction diagrams following the method described in Chapter 8 before you use any software tool to prepare the diagrams.Apache Rent A Car Chapter 9Introduction This chapter discusses steps 2 and
13、3 of the seven-step process for object-oriented program design. These steps are:Step 2. Produce a design class diagram showing the operations from the interaction diagrams.Step 3. Specify the signature and the algorithm for each operation.Apache Rent A Car Assignments Chapter 9Apache Rent A Car Clas
14、s DiagramChapter 9 shows the development of the class diagram with a special emphasis on qualified associations.1. Develop a design class diagram for the Apache Rent A Car system.Pay particular attention to appropriate use of the aggregation and composition symbols, which are used when an associatio
15、n between classes relates parts to wholes, members to groups, or contents to containers. Show class hierarchies. Also be sure to indicate on the diagram navigability from one class to another.2. Revise and refine the interaction diagrams developed for the Chapter 8 assignment. Correct any violations
16、 of the Law of Demeter, reduce the coupling, and increase the cohesion. Modify the design class diagram to be consistent with these improvements. We took great care to be sure none of these violations were presented earlier. Most students understand coupling and cohesion. The Law of Demeter is proba
17、bly the most difficult one to avoid. Note that operations like makeReturn, makeDriver, makeExtraCharge, and makePayment occur in Car and Rental. This is preferable to having the faade object invoke a get operation in each of the above classes to obtain the rental object and then send a message to it
18、. This habit is common among beginners, especially in programming classes.Apache Rent A Car SignaturesAlthough not asked for, signatures for all operations will be provided. This makes it possible for the instructor to easily add an assignment to develop them.3. Develop signatures for all operations
19、. You may omit the “creates” because they are of a standard format. (optional question)This answer is provided with signatures in a UML format as in Figure 9.22. The data types are compatible with Java.Complete Specification of Attributes and Operations Apache Rent A CarCarAttributes- color : String
20、- licenseNumber : String- make : String- model : String- modelYear : intOperations+ associateExtraChargeSpecification (extraChargeSpecification, ExtraChargeSpecification)+ associateRental (rental : Rental)+ associateInspection (inspection: Inspection)+ associateThirdPartyPayer (thirdPartyPayer, Thir
21、dPartyPayer)+ authorize (amount : double, merchantNumber : int) : boolean+ makeCreditCard (creditCardNumber : String, expirationMonth : int, expirationYear : int)+ makeDriver (name : String, birthDate : Date, driversLicenseNumber : String, stateOfIssue : String)+ makeExtraCharge (amountCharged : dou
22、ble)+ makeInspection (damage : double, gasLevel : double, mileageIn : int, time : Date)+ makePayment (amount : double)+ makeRental (timeOut : Date, mileageOut : int)+ makeReturn (timeIn : Date)Credit CardAttributes- creditCardNumber: String- expirationMonth : int- expirationYear : intOperations+ aut
23、horize (amount : double, merchantNumber : int) : intCustomerAttributes- address: String- name: String - phoneNumber : StringOperationsNoneComplete Specification of Attributes and Operations Apache Rent A Car (Continued)DriverAttributes- birthDate : Date- driversLicense Number: String- name: String -
24、 stateOfIssue : StringOperationsNoneExtra ChargeAttributes- amountCharged : doubleOperations+ associateExtraChargeSpecification (extraChargeSpecification, ExtraChargeSpecification)Extra Charge SpecificationAttributes- extraChargeCode : String - description : String- price : doubleOperationsNoneInspe
25、ctionAttributes- damage : double - gasLevel : double- mileageIn : int- time : DateOperationsNonePaymentAttributes- amount : double- authorizationNumber : int- date : DateOperations+ associateCreditCard (creditCard : CreditCard)+ authorize (amount : double, merchantNumber : int) : boolean+ makeCredit
26、Card (creditCardNumber : String, expirationMonth : int, expirationYear : int)Rental SystemAttributesNoneOperations+ assignCar ( )+ enterCarRequest (carType : String, pickUpDate : Date, returnDate : Date)+ enterConfirmation (confirmationNumber : int, timeOut : Date)+ enterCreditCard (creditCardNumber
27、 : String, expirationMonth : int, expirationYear : int)+ enterCustomer (phoneNumber : String, name : String, address : String)+ enterDriver (name : String, birthDate : Date, driversLicenseNumber : String, stateOfIssue : String)+ enterExtraCharge (extraChargeCode : String, amountCharged : double)+ en
28、terInspection (licenseNumber: String, damage : double, gasLevel : double, mileageIn : int)+ enterMileageOut (mileageOut : int)+ enterReturn (licenseNumber : String, timeIn : Date)+ enterThirdPartyCustomer (accountNumber : int)+ enterPayment (licenseNumber: String, amount : double)+ verifyCarLicense
29、(licenseNumber: String) : boolean+ verifyConfirmationNumber (confirmationNumber: int) : boolean+ verifyExtraChargeCode (extraChargeCode : String) : boolean + verifyRateCode (carType : String) : boolean+ verifyThirdPartyCustomer (accountNumber : int) : booleanComplete Specification of Attributes and
30、Operations Apache Rent A Car (Continued)Rate ClassAttributes- carType : String- dailyRate : double- mileageRate : double- numberOfFreeMiles : int- weekEndRate: double- weeklyRate : doubleOperationsNoneRentalAttributes- agreementNumber : int- mileageOut : int- timeOut : DateOperations+ associateDrive
31、r (checkOut : CheckOut)+ associateExtraCharge (extraCharge, ExtraCharge)+ associateExtraChargeSpecification (extraChargeSpecification, ExtraChargeSpecification)+ associateInspection (inspection, Inspection)+ associatePayment (payment, Payment)+ associateReservation (reservation, Reservation)+ associateReturn (return, Return)+ associateThirdPartyPayer (thirdPartyCustomer, ThirdPartyCustomer)+ authorize (amount : double, merchantNumber : int) : boolean+ makeCreditCard (creditCardNumber: String, expirationMonth: int, expiration
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1