Class10
Transcript of Class10
Asper School of Business University of Manitoba
Systems Analysis & Design
Instructor: Bob Travica
Analyzing system data: Class diagram
Updated: October 2009
3510 Systems Analysis & Design * Bob Travica 2 of 16
Outline Problem domain classes Identifying things to be
represented in system Associations among things Multiplicity Attributes Generalization/Specialization
association Part-Whole association Associations between class objects
3510 Systems Analysis & Design * Bob Travica 3 of 16
Problem domain classes Problem domain
Area of business a system supports Classes & objects are the way to
represent things that make business (products, orders, invoices, customers, employees…)
Identifying and analyzing things in problem domain = essential to defining systems requirements
3510 Systems Analysis & Design * Bob Travica 4 of 16
Identifying things to be represented in system
Physical reality -Person who is a customer
customerNumbercustomerNamecustomerAddress…
Customer
addNew()change() …
System -a class Customer
3510 Systems Analysis & Design * Bob Travica 5 of 16
Identifying things to be represented in system (cont.)
PEOPLE,
OPERATIONS,CONCEPTS,
3510 Systems Analysis & Design * Bob Travica 6 of 16
Identifying things to be represented in system (cont.) List nouns users mention when
discussing system
Event table/use cases as source of potential things:
- Use cases (Create new sale) - Actors (salesperson, customer) - Triggers, data input (customer’s order)
Responses (invoice returned)
3510 Systems Analysis & Design * Bob Travica 7 of 16
Identifying things to be represented in system – Master and Transaction Data
Useful way of thinking:
“Static, permanent things” that make business foundations (employee, department, task, job, inventory, supplier, customer…) master data
versus
“Dynamic, changing things” that make business operations (sales transactions, purchasing transactions, employees’ pay & education, execution of tasks, inventory) transaction data
3510 Systems Analysis & Design * Bob Travica 8 of 16
Associations among things
Association = relationship between things Example: Customer places Order
Associations apply in both directions Order is placed by Customer
3510 Systems Analysis & Design * Bob Travica 9 of 16
Associations among things (cont.)
“PLACES”
“WORKS IN”
CUSTOMER
EMPLOYEE
• Arrowheads are used only if reading violates usual direction of reading, which is left-to-right and top-down.
• Arrange symbols to support usual direction of reading.
3510 Systems Analysis & Design * Bob Travica 10 of 16
Associations betweenMaster and Transaction Data
A rule of thumb in modeling class diagrams: Master data usually do not connect directly to each other but through transaction data
3510 Systems Analysis & Design * Bob Travica 10 of 16
Customer Order
Order
ProductX
Master Data
Transaction Data
orders
places contains
3510 Systems Analysis & Design * Bob Travica 11 of 16
Multiplicity (basic idea)
• Multiplicity: the number of classes or objects allowed on each side of a relationship (one to many, many to many, one to one)
CUSTOMER
EMPLOYEE
“WORKS IN”
Places 1 order, and can place more. But each order is placed by just one person.
Contains 2items or more
Works in 1 dept., while this dept. has other workers as well.
3510 Systems Analysis & Design * Bob Travica 12 of 16
Understanding things -attributes
Think of a database record Specific details of things (pieces of
data) are called attributes Understanding attributes is part of
system analysis Key attribute: uniquely identifies a
thing: Social insurance number, product ID,
vehicle identification number
3510 Systems Analysis & Design * Bob Travica 13 of 16
Attributes
Attributes
• By providing values to attributes, class is instantiated in objects (objects “carved” out of classes)
• Classes have attribute names (“skeleton”), objects have attributes specified – values
Values
3510 Systems Analysis & Design * Bob Travica 14 of 16
Class elements
Class name
Class attributes Class behaviors
(methods, processes/functions working with data)
courseNumbercourseTitlecreditHours
Course
addCourse()
Class
3510 Systems Analysis & Design * Bob Travica 15 of 16
Associations between classes:
Generalization/SpecializationClass (Superclass)
Subclasses of MotorVehicle
Subclasses of Car
3510 Systems Analysis & Design * Bob Travica 16 of 16
Associations between classes:
Part-Whole
Part classes
Whole class
3510 Systems Analysis & Design * Bob Travica 17 of 16
Associations between class objects
courseNumbercourseTitlecreditHours
Course
addCourse()
sectionNumberstartTimeroomNumber
Section
openSection()closeSection()
1 *has
• Typical relationship involving objects from two classes.
• Read: A course has sections, and a section belongs to a course.