Professional Documents
Culture Documents
Software Design Methodologies: UML in Action: Dr. Mohamed Fayad, J.D. Edwards Professor
Software Design Methodologies: UML in Action: Dr. Mohamed Fayad, J.D. Edwards Professor
UML in Action
2
May-June 2001 ISISTAN Research Institute – Tandil, L5-S2 Object Identification- 2
Argentina -- M.E. Fayad
Lesson Objectives
+ Learn how to identify:
Associations and aggregations
Attributes
Objectives
Behaviors
Inheritance
+ Understand how to use the following approaches:
Use Case
CRC
Questioning Techniques
+ Understand how to refine objects and associations
+ Learn how to define responsibility & collaborations
+ Learn how to eliminate unnecessary classes,
associations, and attributes
3
May-June 2001 ISISTAN Research Institute – Tandil, L5-S3 Object Identification- 2
Argentina -- M.E. Fayad
Automated Teller Machine (ATM)
4
May-June 2001 ISISTAN Research Institute – Tandil, L5-S4 Object Identification- 2
Argentina -- M.E. Fayad
Actors
Customer Automated
Teller
Machine Bank System
ATM Operator
Cash Withdrawal
Bank System
Deposit Funds
Balance Inquiry
ATM Operator
System Start
6
May-June 2001 ISISTAN Research Institute – Tandil, L5-S6 Object Identification- 2
Argentina -- M.E. Fayad
A Use Case Description: Cash Withdrawal
Use Case: Cash Withdrawal
When a customer inserts a card in the ATM, the machine
reads the code from the card and checks if it is a valid card.
If the card is valid then the machine queries the customer
for a PIN number, else the card is ejected.
When the machine matches customer coded in the PIN
number, the machine checks the validity of the PIN number.
If the PIN number is correct and matches the card number
then the machine asks for the desired transaction the
customer wishes to perform.
When the customer selects cash withdrawal the machine
asks for the desired amount with a warning indicating only
multiple of $10 is allowed.
7
When ....
Define Responsibilities
– What are the goals of the system
– What must objects know to meet goals
– What steps must each object accomplish
Determine Collaborations
– Decompose responsibilities into interactions
among objects
– Define clients and servers
– Where should knowledge be held 9
May-June 2001 ISISTAN Research Institute – Tandil, L5-S9 Object Identification- 2
Argentina -- M.E. Fayad
CRC Cards
General
– Each class is described on a separate 3X5 or 4X6 card
The cards are known as CRC card. They have 3 sections:
– Class
– Responsibilities
– Collaborations
ATM (role)
Responsibility Collaboration
Server Clients
Access & modify account balance Account (role) Balance Inquiry
Deposit Transaction
Funds Transfer
Withdrawal Transaction 10
May-June 2001 ISISTAN Research Institute – Tandil, L5-S10 Object Identification- 2
Argentina -- M.E. Fayad
Other Techniques Help Refine Objects
Associate Objects
Ask Questions 11
May-June 2001 ISISTAN Research Institute – Tandil, L5-S11 Object Identification- 2
Argentina -- M.E. Fayad
Explore Generalizations and Specializations
14
May-June 2001 ISISTAN Research Institute – Tandil, L5-S14 Object Identification- 2
Argentina -- M.E. Fayad
Other Object Tests
Uniformity Test
– Each instance must have the same set of characteristics
and be subject to the same rules - Car license
More than a Name Test
– Every object has attributes, if not it is probably an
attribute of another object -- home address
Or Test
– If inclusion criteria should not use “OR” in any significant
way -- driver’s license number or learner’s permit number
More Than a List Test
– If inclusion criteria is only a list of instances -- decadent
foods includes croissant , cappuccino, chocolate pie, ice
cream.
15
May-June 2001 ISISTAN Research Institute – Tandil, L5-S15 Object Identification- 2
Argentina -- M.E. Fayad
Final Object Checklist
17
– How hot?
Irrelevant Associations
– outside problem domain
Implementation Associations
– Examples: concurrent process,
contains a list
Associations Between Eliminated
Classes
18
May-June 2001 ISISTAN Research Institute – Tandil, L5-S18 Object Identification- 2
Argentina -- M.E. Fayad
Eliminating Unnecessary Associations (cont’d)
Descriptive Attributes
Naming Attributes
Referential Attributes
22
May-June 2001 ISISTAN Research Institute – Tandil, L5-S22 Object Identification- 2
Argentina -- M.E. Fayad
Descriptive Attributes
25
May-June 2001 ISISTAN Research Institute – Tandil, L5-S25 Object Identification- 2
Argentina -- M.E. Fayad
Rules of Attributes
First Rule:
One instance of an object or a class has exactly one value
for each attribute at any given time.
G. Smee 23 3456
Not OK 7890
[Shlaer-Mellor 90]
26
May-June 2001 ISISTAN Research Institute – Tandil, L5-S26 Object Identification- 2
Argentina -- M.E. Fayad
Rules of Attributes (cont’d)
Second Rule:
An attribute must contain no internal
structure
Examples:
– Age, balance, size are all OK.
– A name consists of first name, middle initial, and
last name (Not OK)
– An address contains house number, street name,
city, state, zip code, and country name (Not OK)
27
May-June 2001 ISISTAN Research Institute – Tandil, L5-S27 Object Identification- 2
Argentina -- M.E. Fayad
Rules of Attributes (cont’d)
Third Rule:
When an object has a compound identifier -- that is, one
made up of two or more attributes -- every attribute that is
not part of the identifier represents a characteristic of the
entire object.
Batch
The Batch.cookingTime attribute must
batch ID represent the actual time the batch was
recipe ID cooked, and not the cooking time
gallons specified by the recipe
cookingTime
29
May-June 2001 ISISTAN Research Institute – Tandil, L5-S29 Object Identification- 2
Argentina -- M.E. Fayad
Eliminating Unnecessary Attributes
Just do it!
35
May-June 2001 ISISTAN Research Institute – Tandil, L5-S35 Object Identification- 2
Argentina -- M.E. Fayad
Discussion Questions
Define:
– Guidelines
– Heuristics