You are on page 1of 14

Rational Software

Payroll System Subsystem Design Solution

Version 2003
Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

Revision History
Date Issue Description Author
09/01/2000 V2000 Generated for beta Shawn Siemers
10/03/2000 V2000 Final release Shawn Siemers
01/14/2003 V2003 Final Release Alex Kutsick

Confidential Rational Software, 2003 Page 2 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

Table of Contents
1. Exercise: Subsystem Design 5
1.1 BankSystem 5
1.1.1 Interface Realizations 5
1.1.2 Subsystem Dependencies Class Diagram 7
1.2 PrintService 7
1.2.1 Interface Realizations 7
1.2.2 Subsystem Dependencies Class Diagram 10
1.3 ProjectManagementDatabase 10
1.3.1 Interface Realizations 10
1.3.2 Subsystem Dependencies Class Diagram 14

Confidential Rational Software, 2003 Page 3 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

Payroll System Subsystem Design Solution


1. Exercise: Subsystem Design
1.1 BankSystem

1.1.1 Interface Realizations


IBankSystem::deposit

1. deposit(Paycheck, BankInformation)
1.1. / / getAmount( )
BankSyste : :
mClient BankSystem Paycheck

1.3. submit(BankTransaction)
1.2. create(Deposit, paycheckAmount, BankInformation.routingNumber)

: BankSystemInterface
: BankTransact ion

1.3.1. // submit(BankTransaction)

: Bank System

Confidential Rational Software, 2003 Page 5 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

IBankSystem::deposit

BankSystemCli : BankSystem : Paycheck : : : Bank System


ent BankTransaction BankSystemInterface

1. deposit(Paycheck, BankInformation)

1.1. / / getAmount ( )

1.2. create(Deposit, paycheckAmount, BankInformation.routingNumber)

1.3. submit(BankTransaction)

1.3.1. // submit(BankTransaction)

The formal interfaces


with the external Bank
System would need to
be defined early in the
process and
represented here.
Such definition is
considered out of scope
for this course.

IBankSystem
<<Interface>>
IBankSystem
(from External System Interfaces)
<<entity>>
+ deposit(aPaycheck : Paycheck, intoBank : BankInformation) Paycheck
(from Payroll Artifacts)
BankInformation
- amount
0..1 (from Payroll Artifacts)
+ name : String
+ // create with amount(forAmount : float) : Paycheck
+ routingNumber : String
+ // getAmount()
+ // getEmployee() : Employee

<<subsystem proxy>>
BankSystem

+ deposit(aPaycheck : Paycheck, intoBank : BankInformation)

0..*
BankSystemInterface

0..1 + submit(theTransaction : BankTransaction)

BankTransaction
- amount : float
- transactionOperation : BankOperation
- routingNumber : String

+ create(op : BankOperation, amount : float, routingNum : String)

Confidential Rational Software, 2003 Page 6 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

1.1.2 Subsystem Dependencies Class Diagram


Bank System Dependencies

<<subsystem>>
BankSys tem
(from Business Services)
To acces s t he
subsystem interface

External System
Interfac es
(from Business Services)

Payroll Artifacts
(from Business Services)

1.2 PrintService

1.2.1 Interface Realizations


IPrintService::print

Confidential Rational Software, 2003 Page 7 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

1. print(Paycheck, String)
1.2. / / print(theImage)
PrintService : : 1.2.1. // print( )
Client PrintService PrinterInterface

1.1. 5. // buildPrintImage( ) : Printer


1.1. // create(Paycheck)

: PaycheckPrinterImage

1.1.1. // getEmployee( )
1.1.4. // getAmount( )
1.1.2. // getEmployeeName( )
1.1.3. // get Employee ID( )

:
: Employee Paycheck

IPrintService::print

PrintS ervice : PrintService : : Paycheck : Employee :


: Printer
Client PaycheckP rint erImage PrinterInterface

1. print(Paycheck, String)

1.1. // create(Paychec k)
1.1.1. // getEmployee( )
Create an image of Include similar
the Paycheck from 1.1.2. // getEmployeeName( ) operat ions for all
the given Paycheck Employee
for the specified informat ion that is
Printer 1.1.3. // get Employee ID( ) to appear on the
printed Paycheck

1.1.4. // getAmount( )
Build an image of the
Paycheck from the Include similar
retrieved data for a operations for all
1.1.5. // buildPrintImage( ) Paycheck
specific Print er
information that is
to appear on the
printed Paycheck
Print the
generated
1.2. // print(theImage)
image 1.2.1. // print( )

The formal interfaces with


external printers would need
to be defined early in the
process and represented
here.
Such definition is
considered out of scope for
this course.

Confidential Rational Software, 2003 Page 8 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

IPrintService
<<Interface>>
IPrintService
(from External System Interfaces)

+ print(aPaycheck : Paycheck, onPrinter : String)

<<subsystem proxy>>
PrinterInterface
PrintService

1 0..* + // print(theImage)
+ print(aPaycheck : Paycheck, onPrinter : String)

1
{ one-to-one }

PrinterImage

0..* Anything that can be


printed must have a
specific PrinterImage For every printer the
PaycheckPrinterImage class defined, and that system must
class must inherit from communicate with, a
the base PrinterImage
+ // create(fromPaycheck : Paycheck) PrinterInterface,
class PrinterImage, and a
+ // buildPrintImage()
PaycheckPrinterImage
1 class must be defined

0..1 <<entity>>
<<entity>>
Employee
Paycheck
(from Payroll Artifacts)
(from Payroll Artifacts)
- name
- amount
- employee id : int
- social security number
+ // create with amount(forAmount : float) : Paycheck
- address
+ // getAmount()
+ // getEmployee() : Employee
+ // get Employee ID() : int

Confidential Rational Software, 2003 Page 9 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

1.2.2 Subsystem Dependencies Class Diagram


PrintService Dependencies

<<subsystem>>
PrintService
To access the subsystem
interface (from Business Services)

External System
Interfaces
(from Business Services)
Payroll Artifacts
(from Business Services)

1.3 ProjectManagementDatabase

1.3.1 Interface Realizations


IProjectManagementDatabase::getChargeNumbers

Confidential Rational Software, 2003 Page 10 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

ProjectManagement
DatabaseClient

1. getChargeNumbers(S tring)
1.1.3. new( )
1.1. getChargeNums(string)
1.1.7. add(ChargeNum)
: :
: ChargeNumList
ProjectManagementDatabase DBChargeNumbers

1.1.6. new(projectName, value)

1.1.4. getString( ) 1.1.1. createStatement( )


1.1.5. getString( )
: ChargeNum
: ResultSet 1.1.2. exec uteQuery(S tring)

:
Statement : Connection

1.1.2.1. // execute query( )

: Project
Management

Confidential Rational Software, 2003 Page 11 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

IProjectManagementDatabase::getChargeNumbers

ProjectManagemen : : : Connection : Statement : : ResultSet : ChargeNum


: Project
tDatabaseClient ProjectManagementDatabase DBChargeNumbers ChargeNumList
Management

1. getChargeNumbers(String) The formal interfaces with


returns a
the external Project
Statement
1.1. getChargeNums(string) Management System would
Request the
need to be defined early in
currently available
1.1.1. createStatement( ) the process and
charge numbers
represented here.
from the database
Such definition is
1.1. 2. execut eQuery (S tring) considered out of scope for
this course.
DBChargeNumbers builds t he sql 1.1.2.1. // execute query( )
s tat ement to ret rieve the charge
numbers and passes it t o St atement
Create a list to hold all
t o be executed. A Result Set is
retrieved data
ret urned.
1.1.3. new( )
Repeat these operat ions for Retrieve the project name
each element returned from the for the charge number
1.1. 4. getSt ring( )
execut eQuery() command.
Retrieve the value for the
The ChargeNumList is loaded charge number
1.1. 5. getSt ring( )
with t he data ret rieved from the
database.
Build the class from the
retrieved data.
1.1.6. new(projectName, value)

Add the retrieved course offering


to the list to be returned
1.1.7. add(ChargeNum)

To read a class, the ProjectManagementDatabase proxy class asks the DBChargeNumbers class for the list of available charge numbers
from the database. The DBChargeNumbers creates a new statement using the Connection class createStatement() operation. The
statement is executed and the data is returned in a ResultSet object. The DBChargeNumbers then creates a new instance of the
ChargeNum persistent class and populates it with the retrieved data. The data is returned in a collection object, the ChargeNumList class.

IProjectManagementDatabase::initialize

ProjectManagement : : :
: Project
Database Client ProjectManagementDatabase DBChargeNumbers DriverManager
Management

1. initialize( )
1.1. initialize( )

1.1. 1. getConnection(url, user, pass)

1.1.1.1. // get connection( )


The formal interfaces with
the external Project
Management System would
need to be defined early in
the process and
represented here.
Such definition is
considered out of scope for
this course.

Confidential Rational Software, 2003 Page 12 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

IProjectManagementDatabase::initialize

1. initialize( )
ProjectManagementD :
atabase Client ProjectManagementDatabase

1.1. initialize( )

:
DBChargeNumbers

1.1.1. getConnection(url, user, pass)

: DriverManager 1.1.1.1. // get connection( )

: Project
Management

IProjectManagementDatabase
<<Interface>> A "plural" DBClass was defined
IProjectManagementDatabase because the charge numbers
(from External System Interfaces) always are retrieved as a set (a
list of the available charge
+ getChargeNumbers(criteria : String) : chargeNumList numbers).

<<subsystem proxy>>
ProjectManagementDatabase
DBChargeNumbers
+ getChargeNumbers(criteria : String) : chargeNumList
+ initialize() 1 1 + getChargeNums(criteria : string) : ChargeNumList
+ initialize()
1
1
1

Statement
ChargeNumList 0..1
(from java.sql)
(from Payroll Artifacts)

+ new() + executeQuery()
+ executeUpdate()
+ add(theChargeNum : ChargeNum)
1 ResultSet
(from java.sql)

0..* + getString()
ChargeNum 0..*
(from Payroll Artifacts)
- projectName
- value

+ // getProjectName() DriverManager
+ // getValue() (from java.sql)
+ new(projectName, value)
1
+ getConnection()
Connection
(from java.sql)

+ createStatement()

Confidential Rational Software, 2003 Page 13 of 14


Mastering OOAD with UML Issue: v2003
Payroll System Subsystem Design Solution Issue Date: February 2003
11ss_design_solutionk_rpt.doc

1.3.2 Subsystem Dependencies Class Diagram


ProjectManagementDatabase Dependencies

<<subsystem>>
To access the ProjectManagementDatabase
subsystem interface
(from Business Services)

External System
Interfaces
(from Business Services)
java.sql
(from Middleware)

Confidential Rational Software, 2003 Page 14 of 14

You might also like