Analyzing system data: Class Diagram

advertisement
Asper School of Business
University of Manitoba
Systems Analysis & Design
Instructor: Bob Travica
Class diagram II
Updated: October 2014
Outline

More on associations & multiplicity

Association class

Fully developed classes

Completing procedure for creation of
class diagrams
3510 Systems Analysis & Design * Bob Travica
2 of 9
Associations

Association types determined by maximum multiplicity
(if 2 symbols for multiplicity provided, read that on the
right)

One-to-one (1:1) - occasional;
e.g., Customer—CustomerBillingAddress

One-to-many (1:M) - most frequent; for example:
Customer—Order (or Customer--SaleTransaction)

Many-to-many (M:M) - moderately frequent; examples:

Order—Product (or Item), Employee—Project
3510 Systems Analysis & Design * Bob Travica
3 of 9
Multiplicity (more)

Multiplicity question:
Each (one) object on the left side of a relationship can be
associated with how many objects on the right side?
Then, write the number on right side.
- Rule: Usually, the same movie plays in several theatres.
Movie
(1, assumed)
*
Theatre
Each (one) object on the right side can be associated with how
many objects on the left side?

Then, right the number on left side.
- Rule: Most theaters play several movies in a day.
Movie
*
(1, assumed)
Theatre
3510 Systems Analysis & Design * Bob Travica
4 of 9
Association class*

Two ways to think about it:
1) A class that stores some extra attributes that
characterize (belong to) the association between classes.
term
2) Extra storage for data that do not fit into either of
associated classes.
3510 Systems Analysis & Design * Bob Travica
5 of 9
RMO CRM system class diagram (simplified)
Figure 8-9
modified
Catalog
CatalogItem
productPrice
CatalogID
*
has
* *
Item
delivered by
1 has *
ItemID
ItemItemNumber
ItemOrder
quantity
discount
ItemShipment
quantity
appears
on
ShipmentNum
delivered *
by
1
Shipper
ShipperID
*
Customer
*
Shipment
InventoryItem
*
CustomerID
Customary simplification, showing:
- Just maximum multiplicity
- Just attributes of Association
Classes
1 places *
Order
OrderNum
Optional naming of association
classes: CatalogDetail,
OrderDetail… (Note word
“Detail”).
• Association class contains transaction data.
• In reading multiplicity neglect association classes!
3510 Systems Analysis & Design * Bob Travica
6 of 9
Fully developed classes
(design level)
Figure 8-7
Attributes
- = private
+ = public
() = attribute affected by,
input data
: string, number = data type
3510 Systems Analysis & Design * Bob Travica
Methods
7 of 9
Sources for class diagramming

Sources:
Description (narrative)
 Use case diagrams & descriptions
 Analysis of master data and
transactional data

3510 Systems Analysis & Design * Bob Travica
8 of 9
Completing a class diagram

1.
2.
3.
4.
5.
6.
7.
Standard procedure:
List classes
List attributes
Draw simplified class rectangles (name and attribute
segments only)
Insert attributes in class rectangles
Determine keys
Draw associations and name them
(New) Draw Association Class for each relationship that has
attribute(s) on its own.
Note: For now it is important to recognize M:M relationship, not
entire multiplicity.
3510 Systems Analysis & Design * Bob Travica
Download