© Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank...

15
© Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Transcript of © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank...

Page 1: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x1

Bank Accounts Management System - p. 480This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 2: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x2

Marking nouns: potentially good classes, definitely bad classes, and classes we are unsure about

This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 3: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x3

OOBank has many branches has (address and branch number)

A client opens accounts at a branch.

account (account number; balance, credit or overdraft limit)

Types of accounts:

• mortgage account (property as collateral),

• chequing account,

• credit card account (expiry date, cards)

Each type of account has (interest rate, monthly fee and a specific set of privileges (cheques, insurance for purchases etc).

The branches are considered subdivisions of the Consumer Division.

Each division has a manager and a set of other employees.

Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 4: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x4

Draft Class Diagram Client and Account, and their association

accountHolder

Client

Account

accountNumbertype

*

1..2

Page 5: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x5

Draft Class Diagram with Account attributes and subclasses

accountHolder

Client

MortgageAccountChequingAccount

Account

accountNumberopenedDateclosedDateinterestRatemonthlyFeebalancecreditOrOverdraftLimit

CreditCardAccount

*

*

1..2

Page 6: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x6

Draft Class Diagram with CreditCard and attributes of Account subclasses

Client

MortgageAccount

collateralProperty

ChequingAccount

Account

accountNumberopenedDateclosedDateinterestRatemonthlyFeebalancecreditOrOverdraftLimit

CreditCardAccount

expiryDatebrand

CreditCard

name

*

1..*

*

1..2accountHolder

Page 7: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x7

Problem statement - checking off what we have done (Classes, associations, attributes, generalizations)

This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 8: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x8

Looking at what we know about Employees(Classes, associations, attributes, generalizations)

This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 9: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x9

Draft Class Diagram with Branch and Employee

accountHolder

Client

MortgageAccount

collateralProperty

ChequingAccount

BranchAccount

accountNumberopenedDateclosedDateinterestRatemonthlyFeebalancecreditOrOverdraftLimit

CreditCardAccount

expiryDatebrand

CreditCard

name

Employee

*

personalBanker*

1..*

*

1..2

Page 10: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x10

Looking at what we know about Branches(Classes, associations, attributes, generalizations)

This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 11: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x11

Draft Class Diagram with OrganizationalUnit

*

accountHolder

Client

MortgageAccount

collateralProperty

ChequingAccount

Branch

OrganizationalUnit

Account

accountNumberopenedDateclosedDateinterestRatemonthlyFeebalancecreditOrOverdraftLimit

CreditCardAccount

expiryDatebrand

CreditCard

name

subdivision

Employee

*

manager

0..10..1 *

worksFor

personalBanker*

1..*

0..1

*

1..2

Page 12: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x12

Problem statement after adding OrganizationalUnit(Classes, associations, attributes, generalizations)

This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 13: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x13

Thinking about how to deal with privileges(Classes, associations, attributes, generalizations)

This system provides the basic services to manage bank accounts at a bank called OOBank. OOBank has many branches, each of which has an address and branch number. A client opens accounts at a branch. Each account is uniquely identified by an account number; it has a balance and a credit or overdraft limit. There are many types of accounts, including: A mortgage account (which has a property as collateral), a chequing account, and a credit card account (which has an expiry date and can have secondary cards attached to it). It is possible to have a joint account (e.g. for a husband and wife). Each type of account has a particular interest rate, a monthly fee and a specific set of privileges (e.g. ability to write cheques, insurance for purchases etc. OOBank is divided into divisions and subdivisions (such as Planning, Investments and Consumer), the branches are considered subdivisions of the Consumer Division. Each division has a manager and a set of other employees. Each customer is assigned a particular employee as his or her ‘personal banker’.

Page 14: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x14

Draft Class Diagramwith AccountType

*

accountHolder

Client

MortgageAccount

collateralProperty

AccountType

interestRatemonthlyFeechecksAllowedinsuranceAvailable

ChequingAccount

Branch

OrganizationalUnit

Account

accountNumberopenedDateclosedDateinterestRatemonthlyFeebalancecreditOrOverdraftLimit

CreditCardAccount

expiryDatebrand

CreditCard

name

subdivision

Employee

*

manager

0..10..1 *

worksFor

personalBanker*

1..*

*

0..1

*

1..2

Page 15: © Lethbridge/Laganière 2002 Chapter 5: Modelling with classes - Bank Account Problem x1 Bank Accounts Management System - p. 480 This system provides the.

© Lethbridge/Laganière 2002

Chapter 5: Modelling with classes - Bank Account Problem

x15

Bank Account System Class diagram with final touches

*

accountHolder

Client

name

MortgageAccount

collateralProperty

AccountType

interestRatemonthlyFeechecksAllowedinsuranceAvailableperiodicFeeperiod

ChequingAccount

Branch

addressnumber

OrganizationalUnit

Person

Account

accountNumberopenedDateclosedDateinterestRatemonthlyFeebalancecreditOrOverdraftLimit

CreditCardAccount

expiryDatebrand

CreditCard

name

subdivision

Employee

*

manager

0..10..1 *

worksFor

personalBanker*

1..*

*

0..1

*

1..2