Dissecting the Problem Document n Identify potential sw
Dissecting the Problem Document n Identify potential s/w classes from a description document--a written description of the system to implement ¨ Identify the nouns n 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 n n 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)
Example Problem n 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.
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.
Noun List (All Potential Classes) n n n address BMW cars customer estimated labor charges estimated parts charges foreign cars Joe’s Automotive Shop make manager n n n n n Mercedes model name Porsche sales tax service quote shop telephone number total estimated charges year
Refine Noun List n n n address BMW cars customer estimated labor charges estimated parts charges foreign cars Joe’s Automotive Shop make manager n n n n n Mercedes model name Porsche sales tax service quote shop telephone number total estimated charges year
Identifying a Class’s Responsibilities n Classes ¨ Cars ¨ Customer ¨ Service. Quote n Class responsibilities are: ¨ the things that the class is responsible n class’s attributes, data members ¨ the actions that the n class’s methods for knowing class is responsible for doing
Identifying a Class’s Responsibilities n Customer class ¨ What should the Customer class n customer’s name n customer’s address n customer’s telephone number know? ¨ What should the Customer class do? n create an object of the Customer class n set and get customer’s name, address, and telephone number ¨ What does the UML diagram look like?
Your turn Determine the attributes and methods for both the Car and Service. Quote classes. n Draw the UML diagram for both classes. n Submit as quiz on Monday. n
- Slides: 8