Class10

17
Asper School of Business University of Manitoba Systems Analysis & Design Instructor: Bob Travica Analyzing system data: Class diagram Updated: October 2009

Transcript of Class10

Page 1: Class10

Asper School of Business University of Manitoba

Systems Analysis & Design

Instructor: Bob Travica

Analyzing system data: Class diagram

Updated: October 2009

Page 2: Class10

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

Page 3: Class10

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

Page 4: Class10

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

Page 5: Class10

3510 Systems Analysis & Design * Bob Travica 5 of 16

Identifying things to be represented in system (cont.)

PEOPLE,

OPERATIONS,CONCEPTS,

Page 6: Class10

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)

Page 7: Class10

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

Page 8: Class10

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

Page 9: Class10

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.

Page 10: Class10

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

Page 11: Class10

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.

Page 12: Class10

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

Page 13: Class10

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

Page 14: Class10

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

Page 15: Class10

3510 Systems Analysis & Design * Bob Travica 15 of 16

Associations between classes:

Generalization/SpecializationClass (Superclass)

Subclasses of MotorVehicle

Subclasses of Car

Page 16: Class10

3510 Systems Analysis & Design * Bob Travica 16 of 16

Associations between classes:

Part-Whole

Part classes

Whole class

Page 17: Class10

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.