Upload
gillian-thornton
View
212
Download
0
Embed Size (px)
Citation preview
Class diagram II
Asper School of Business University of Manitoba
Systems Analysis & Design
Instructor: Bob Travica
Updated: October 2014
3510 Systems Analysis & Design * Bob Travica
2 of 9
Outline
More on associations & multiplicity
Association class
Fully developed classes
Completing procedure for creation of class diagrams
3510 Systems Analysis & Design * Bob Travica
3 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
4 of 9
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.
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 Theatre*
Movie Theatre*
Multiplicity (more)
(1, assumed)
(1, assumed)
3510 Systems Analysis & Design * Bob Travica
5 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.
2) Extra storage for data that do not fit into either of associated classes.
term
3510 Systems Analysis & Design * Bob Travica
6 of 9
RMO CRM system class diagram (simplified)
Customary simplification, showing:- Just maximum multiplicity- Just attributes of Association Classes
Customary simplification, showing:- Just maximum multiplicity- Just attributes of Association Classes
Figure 8-9modified
Catalog
Item
Order
ItemOrder
Customer
CatalogItemproductPrice
InventoryItem
Shipper
*
*
1 has *
1 *
delivered by
*
1
*
*has
places
delivered by
appears on
*
Shipment*
ItemShipment
quantity
quantitydiscount
• Association class contains transaction data.• In reading multiplicity neglect association classes!
CatalogID
ItemID ItemItemNumber ShipmentNum
ShipperID
OrderNumCustomerID
Optional naming of association classes: CatalogDetail, OrderDetail… (Note word “Detail”).
Optional naming of association classes: CatalogDetail, OrderDetail… (Note word “Detail”).
3510 Systems Analysis & Design * Bob Travica
7 of 9
Fully developed classes (design level)
Methods
Attributes
- = private+ = public() = attribute affected by, input data: string, number = data type
Figure 8-7
3510 Systems Analysis & Design * Bob Travica
8 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
Completing a class diagram Standard procedure:1. List classes2. List attributes3. Draw simplified class rectangles (name and attribute
segments only)4. Insert attributes in class rectangles 5. Determine keys 6. Draw associations and name them7. (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.