Document 7669934
Download
Report
Transcript Document 7669934
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)
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.
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)
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
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
Identifying a Class’s
Responsibilities
Classes
Cars
Customer
ServiceQuote
Class responsibilities are:
the things that the class is responsible
class’s attributes, data members
the actions that the
class’s methods
for knowing
class is responsible for doing
Identifying a Class’s
Responsibilities
Customer class
What should the Customer class
customer’s name
customer’s address
customer’s telephone number
know?
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?
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.