Download presentation
Presentation is loading. Please wait.
Published byMeredith Foster Modified over 8 years ago
1
Dissecting the Problem Document Identify potential s/w classes from a description document--a written description of the system to implement Identify the nouns The problem domain description should include any of the following: Physical objects, e.g. vehicles, machines, or products Any role played by a person, e.g. manager, employee, customer, etc. Results of a business event, e.g. customer order, service quote Recordkeeping items, e.g. customer histories and payroll records. Refine noun list Remove replicate nouns Remove nouns that are outside of the system parameters (context of system) Remove nouns representing objects, not classes Remove nouns that represent values (can be stored in primitives, not class)
2
Example Problem Develop system to print a service quote for an automotive shop. Joe's Automotive Shop services foreign cars, and specializes in servicing cars made by Mercedes, Porsche, and BMW. When a customer brings a car to the shop, the manager gets the customer's name, address, and telephone number. The manager then determines the make, model, and year of the car, and give the customer a service quote. The service quote shows the estimated parts charges, estimated labor chargers, sales tax, and total estimated charges.
3
Example Problem Joe's Automotive Shop services foreign cars, and specializes in servicing cars made by Mercedes, Porsche, and BMW. When a customer brings a car to the shop, the manager gets the customer's name, address, and telephone number. The manager then determines the make, model, and year of the car, and give the customer a service quote. The service quote shows the estimated parts charges, estimated labor chargers, sales tax, and total estimated charges.
4
Noun List (All Potential Classes) address BMW car cars customer estimated labor charges estimated parts charges foreign cars Joe’s Automotive Shop make manager Mercedes model name Porsche sales tax service quote shop telephone number total estimated charges year
5
Refine Noun List address BMW car cars customer estimated labor charges estimated parts charges foreign cars Joe’s Automotive Shop make manager Mercedes model name Porsche sales tax service quote shop telephone number total estimated charges year
6
Identifying a Class’s Responsibilities Classes Cars Customer ServiceQuote Class responsibilities are: the things that the class is responsible for knowing class’s attributes, data members the actions that the class is responsible for doing class’s methods
7
Identifying a Class’s Responsibilities Customer class What should the Customer class know? customer’s name customer’s address customer’s telephone number What should the Customer class do? create an object of the Customer class set and get customer’s name, address, and telephone number What does the UML diagram look like?
8
Your turn Determine the attributes and methods for both the Car and ServiceQuote classes. Draw the UML diagram for both classes. Submit as quiz on Monday.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.