Upload
noel-eaton
View
216
Download
0
Tags:
Embed Size (px)
Citation preview
2
The outline method for OOA
1.Identify object classes within the problem domain
2.Define the behaviour of those classes
3.Define the attributes and methods of those classes
4.Model the relationships between those classes
From the text book P79.
3
Develop use cases, activity
diagrams
Identify classes, relationships, and
methods
Develop interaction diagrams
Refine and iterate
5
Actors:•An actor is a user playing a role with respect to the system.
6
Actors:•An actor is a user playing a role with respect to the system.•An actor is the key to finding the correct use cases.
7
Actors:•An actor is a user playing a role with respect to the system.•An actor is the key to finding the correct use cases.•An actor can be an external system.
Use cases:
8
Actors:•An actor is a user playing a role with respect to the system.•An actor is the key to finding the correct use cases.•An actor can be an external system.
Use cases:A use case is a sequence of transactions in a system whose task is to yield results of measurable value to an individual actor of the system.
Transaction
9
Actors:•An actor is a user playing a role with respect to the system.•An actor is the key to finding the correct use cases.•An actor can be an external system.
Use cases:A use case is a sequence of transactions in a system whose task is to yield results of measurable value to an individual actor of the system.
Transaction is an atomic set of activities that are performed either fully or not at all.
10
Actors:•An actor is a user playing a role with respect to the system.•An actor is the key to finding the correct use cases.•An actor can be an external system.
Use cases:A use case is a sequence of transactions in a system whose task is to yield results of measurable value to an individual actor of the system.
Transaction is an atomic set of activities that are performed either fully or not at all.
Use case is a special flow of events through the system. However, many courses of events are possible, so we must group the courses of events and call each group a use case class.
11
Library
Borrow books
Return books
Interlibrary loan
Do research
Read books, newspaper
Purchase supplies
Member
Circulation clerk
Supplier
12
Dividing use cases into packages
For example, in a library system, the various scenarios involve a member borrowing books, a member do research, or a supplier providing books.
Irrelevant ClassesIrrelevant Classes
14
Classes identification –
Fuzzy ClassesFuzzy ClassesRelevant ClassesRelevant Classes
15
Classes identification –
1.The noun phrase approach
2.The use case driven (Sequence/collaboration modeling approach)
3.Classes, Responsibilities, and Collaborators (CRC) approach
16
The noun phrase approach
Look for nouns and noun phrases in the use cases.
Some classes are implicit or taken from general knowledge
All classes must make sense in the application domain.
17
Common mistake – use case refers to aprocess (not a class)
Use case can contain many classesThe same class can occur in many different use cases
Example: Using ATM machineStep 1: insert ATM cardStep 2: enter PIN numberStep 3: may/may not do somethingStep 4: Remove the ATM Card
18
A simple ATM system use cases –
Deactivate ATMWithdraw money
Deposit money
Check balance
Transfer money
Print audit log
Cardholder
Bank employee
Validate pin
<<include>>
<<include>>
<<include>>
<<include>>
19
The noun phrase approach
Initial list of noun phrases: Candidate Classes
AccountAccount BalanceAmountApproval ProcessATM CardATM MachineBankBank ClientCardCashCheckChecking Account
ClientClient’s AccountCurrencyDollarEnvelopeFour DigitsFundInvalid PinMoneyPasswordPINPIN Code
RecordSavings AccountSystemStepTeletubbieTransactionTransaction Historyetc.,
21
The noun phrase approach
Eliminate the irrelevant Classes
AccountAccount BalanceAmountApproval ProcessATM CardATM MachineBankBank ClientCardCashCheckChecking Account
22
The noun phrase approach
Reviewing the Redundant Classes and Building a Common Vocabulary
AccountAccount BalanceAmountApproval ProcessATM CardATM MachineBankBank ClientCardCashCheckChecking Account
23
The noun phrase approach
Reviewing the Redundant Classes and Building a Common Vocabulary
24
The noun phrase approach
Reviewing the Redundant Classes and Building a Common Vocabulary
Account, Client’s Account = Account
25
The noun phrase approach
Reviewing the Redundant Classes and Building a Common Vocabulary
Account, Client’s Account = Account
ATM Card, Card = ATM Card
26
The noun phrase approach
Reviewing the Redundant Classes and Building a Common Vocabulary
Account, Client’s Account = Account
ATM Card, Card = ATM Card
Client, Bank Client = Bank Client
27
The noun phrase approach
Reviewing the Redundant Classes and Building a Common Vocabulary
Account, Client’s Account = Account
ATM Card, Card = ATM Card
Client, Bank Client = Bank Client
Fund, Money = Fund
28
The noun phrase approach
Reviewing the Redundant Classes and Building a Common Vocabulary
Account, Client’s Account = Account
ATM Card, Card = ATM Card
Client, Bank Client = Bank Client
Fund, Money = Fund
PIN, PIN Code = PIN
29
The noun phrase approach
Revised list - Reviewing the Redundant Classes and Building a Common vocabulary
31
The noun phrase approach
Reviewing the Possible Attributes
Account Balance: An attribute of the Account class
32
The noun phrase approach
Reviewing the Possible Attributes
Account Balance: An attribute of the Account class
Amount: A value, not a class
33
The noun phrase approach
Reviewing the Possible Attributes
Account Balance: An attribute of the Account class
Amount: A value, not a class
Invalid PIN: It is only a value, not a class
34
The noun phrase approach
Reviewing the Possible Attributes
Account Balance: An attribute of the Account class
Amount: A value, not a class
Invalid PIN: It is only a value, not a class
Password: An attribute, possibly of the Bank Client class
35
The noun phrase approach
Reviewing the Possible Attributes
Account Balance: An attribute of the Account class
Amount: A value, not a class
Invalid PIN: It is only a value, not a class
Password: An attribute, possibly of the Bank Client class
PIN: An attribute, possibly of the Bank Client class.
36
The noun phrase approach
Reviewing the Possible Attributes
Account Balance: An attribute of the Account class
Amount: A value, not a class
Invalid PIN: It is only a value, not a class
Password: An attribute, possibly of the Bank Client class
PIN: An attribute, possibly of the Bank Client class.
Transaction History: An attribute, possibly of the Transaction class
37
The noun phrase approach
Revised list - Reviewing the Possible Attributes
38
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
39
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings Account
40
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings AccountATM Card class: Provides a client with a key to an account
41
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings AccountATM Card class: Provides a client with a key to an accountATM Machine class: Provides an interface to the ABC Bank
42
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings AccountATM Card class: Provides a client with a key to an accountATM Machine class: Provides an interface to the ABC BankBank class: Bank clients belongs to the Bank. It is a repository of accounts and processes the accounts’ transactions
43
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings AccountATM Card class: Provides a client with a key to an accountATM Machine class: Provides an interface to the ABC BankBank class: Bank clients belongs to the Bank. It is a repository of accounts and processes the accounts’ transactionsBank Client class: A client is an individual that has a checking account and/or a savings account
44
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings AccountATM Card class: Provides a client with a key to an accountATM Machine class: Provides an interface to the ABC BankBank class: Bank clients belongs to the Bank. It is a repository of accounts and processes the accounts’ transactionsBank Client class: A client is an individual that has a checking account and/or a savings accountChecking Account class: It models a client’s checking account and provides more specialized withdrawal service.
45
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings AccountATM Card class: Provides a client with a key to an accountATM Machine class: Provides an interface to the ABC BankBank class: Bank clients belongs to the Bank. It is a repository of accounts and processes the accounts’ transactionsBank Client class: A client is an individual that has a checking account and/or a savings accountChecking Account class: It models a client’s checking account and provides more specialized withdrawal service.Savings Account class: It models a client’s savings account.
46
The noun phrase approach
Reviewing the Class Purpose – each class must have a purpose. If we cannotformulate a statement of purpose for a class, simply eliminate it.
Account class: An Account class is a formal (abstract) class, it defines the common behaviors that can be inherited by more specific classes such as Checking Account and Savings AccountATM Card class: Provides a client with a key to an accountATM Machine class: Provides an interface to the ABC BankBank class: Bank clients belongs to the Bank. It is a repository of accounts and processes the accounts’ transactionsBank Client class: A client is an individual that has a checking account and/or a savings accountChecking Account class: It models a client’s checking account and provides more specialized withdrawal service.Savings Account class: It models a client’s savings account.Transaction class: Keeps track of transaction, time, date, type, amount, and balance
47
The noun phrase approach
Revised list - Reviewing the Possible Attributes – revised list