Homework #4 Sample Solution
Note: As with the Homework #1 sample, this sample was created with System Architect, a rather expensive and cruddy (but UML compliant) CASE tool available on some CCS-maintained Andrew machines. If you can't get Softera (also pretty cruddy) to work on your machine at home, you might want to give this a try. I know for a fact that it's available on the first three rows of the cluster in Cyert Hall.
Problem 8.1a: Eliminating spurious classes

Elimination key:
1 "Software" is the final product you are being asked to deliver.  It would be circular to try to model the system as part of the system.
2 This probably makes more sense as an attribute than as a class with object identity
3 Since this is data which can be derived from other data in the system, it is probably a method
4 This is a value of a particular attribute, and while it may be implemented using the inheretance mechanism to create values, this is not a flexible approach for real development.  (Each time a new value needs to be added, the system would have to be recompiled.)

software: 1
payroll  system: possibly a controller class
employee name: 2
employee number: 2
date: 2
paycheck: probably the central data storage class
deduction type: 2
amount: 2
explanation: 2
income type: 2
net pay: 3
method of payment: 2
cash: 4
direct deposit: 4
check: 4
total income: 3
total deductions: 3
total net pay: 3
year: 2

Problem 8.1b: A preliminary design

preliminary design

Problem 8.1c: A Data dictionary

Employee The class representing people who are paid by the client company.  Each object of type Employee represents a unique person and is identified by a number.  Several unique employees may have the same name, provided that they have different employee numbers.  Periodically, Paychecks are cut to employees.
employee name The common first and last name of the Employee.  Need not be unique.
employee number A unique number identifying the Employee at the company.  No two distinct, active employees may have the same number.
employee netPay The sum of the Paycheck netPay for all of the Paychecks that the Employee has received for a given year.  This will be equal to the totalIncomes minus the totalDeductions for that year.
employee totalIncomes The sum of the Paycheck totalIncome for all of the Paychecks that the employee has received for a given year.
employee totalDeductions The sum of the Paycheck totalDeduction for all of the Paychecks that the employee has received for a given year.
Paycheck The class representing checks that have been cut to a particular Employee.  Each check written is represented by a distinct Paycheck object, and is uniquely identified by its date and the Employee that it is linked to.  Each paycheck includes several Incomes, which represent amounts that the Employee is owed by the company; also, several Deductions, which represent amounts that the company withholds from the Employee to pay things like taxes, benefits, expenses, etc.  The actual amount that the physical check is written for is equal to the Paycheck netPay for this Paycheck.
paycheck date The date that appears on the physical check that was written to the Employee.  This date, together with the Employee's identity, uniquely identify each Paycheck object.
paycheck paymentMethod A code that represents how the Employee was paid; such values may include direct deposit (the Employee's bank account was directly credited for the netPay amount); cash, or a physical check.
paycheck totalIncomes The sum of all of the PaycheckItem amounts of all of this Paycheck's linked Income objects.
paycheck totalDeductions The sum of all of the PaycheckItem amounts of all of this Paycheck's linked Deduction objects.
paycheck netPay The actual  amount that the Employee was paid.  This amount is equal to totalIncomes minus totalDeductions for this Paycheck.
PaycheckItem The class representing individual amounts that contribute to the Paycheck netPay for the Paycheck that the PaycheckItem is linked to.  Each PaycheckItem is uniquely identified together by all of its attributes and the single Paycheck object that it is linked to.
paycheckItem date The date upon which the item was incurred.  This is usually the same as the Paycheck date, but may be different in some cases to signify such information as the date of a particular business trip upon which expense reimbursement took place.
paycheckItem amount The amount for which the item counts toward the Paycheck netPay.  If the iem is an Income, this amount should be considered positive with respect to the netPay; if the item is a Deduction, the amount should be considered negative.
paycheckItem explanation A human-readable description of the item, and why it is linked to its owning Paycheck.
paycheckItem isStandard A boolean which is true to indicate that the item is standard or commonly included in a Paycheck, or false to indicate that the item is exceptional or unusual in some way.
Income A type of PaycheckItem, representing a credit to the Employee from the company, usually for services rendered or expenses reimbursed.
Deduction A type of PaycheckItem, representing a withholding from the Employee by the company, usually for taxes or benefits.