Lecture2010-5
Lecture2010-5
Lecture2010-5
LECTURE 5:
Modeling System
Requirements
1
Lecture Outline
2
The Activities of the Analysis Phase
3
Define System Requirements
4
Definitions
6
CRUD Technique
8
Event Decomposition Technique
10
Types of Events
External
Outside system
Initiated by external agent or actor (e.g.,
“Customer places an Order”)
Temporal
Occur as result of reaching a point in time
Based on system deadlines (e.g., “Produce a
biweekly payroll”)
State
Something inside system triggers processing
need (e.g., “Reorder point reached”) 11
Events and Use Cases in Account
Processing System
12
External Event Checklist
13
Temporal Event Checklist
14
Identifying Events
16
Identifying Events
17
Sequence of “Transactions”
for One Specific Customer
Resulting in Many Events
18
Identifying Events
19
The Perfect Technology
Assumption
The perfect technology assumption states that:
During analysis we should focus on events that the system
would be required to respond under “perfect” conditions, i.e.
with equipment never breaking down, capacity for
processing and storage being unlimited and people
operating the system being completely honest and never
making mistakes. Assuming the perfect technology (e.g., the
disk will never crash), the analysts can eliminate events like
“Time to back up the database”.
During design phase we deal with these issues and events
from a “non-perfect world” point of view, e.g. events like
“Time to back up the database” and add these controls
(Figure, next slide lists some of events that can be deferred
until the design phase).
20
Events Deferred Until the Design
Phase
21
External Events for RMO:
Customers and Departments
22
Temporal Events for RMO
23
Documenting the Events
An event table represents events and their details: each
row contains information about one event, each column
represents a key piece of information about the event (see
next slide showing event table about an event “Customer
wants to check item available”)
Each event is characterized by:
• The trigger: an occurrence that tells the system that an
event has occurred (either the arrival of data needing
processing or of a point in time) E.g., a customer places an
order, the new order detail are provided as input
• The source: an external agent or actor that supplies data to
the system
• The activity: behavior that the system performs when an
event occurs (the system’s reaction)
• The response: an output, produced by the system that goes
to a destination
• The destination: an external agent or actor that receives
data from the system 24
Information about Each Event
in an Event Table
25
RMO Event Table
26
Use Case Descriptions
29
Intermediate Description
30
Fully
Developed
Description
31
Things and System Requirements
32
Types of Things
33
Just for Fun!
http://www.getfunnypictures.com/crt054.html
35
Things in Domain
36
Procedure for Developing an
Initial List of Things
Step 1: Using the event table and information about each
use case, identify all nouns (e.g., customer, product item,
order, transaction, back order, shipping, etc)
39
Partial List of Things for RMO
40
Characteristics of Things
Relationship
Naturally occurring association among specific
things
Occur in two directions
- A customer places an order (one direction)
- An order is placed by a customer (other
direction)
Number of associations is cardinality or
42
Cardinality/Multiplicity of
Relationships
43
Cardinality/Multiplicity of
Relationships
44
Cardinality/Multiplicity of
Relationships
Kinds of Relationships
• Binary relationship is a relationship between two different
types of things (e.g., between a customer and an order)
45
Attributes of Things
47
Data Entities
• Data entities are the things the system needs to store information
about in the traditional approach to information systems (entities
are things like customers and order)
• The data entities, the relationship between data entities and the
attributes of data entities are modeled using an entity-relationship
diagram (ERD)
• Computer processes interact with these data entities, creating them,
updating attribute values and associating one with another
• We can think about things as objects that interact in the system
• Objects in the work environment of the user (called also problem
domain) in the object-oriented approach are often similar to data
entities in the traditional approach
• The main difference: the objects do the work in the system, but do
not just store information (i.e. they have behavior as well as
attributes)
49
The Entity-Relationship Diagram
(ERD)
• Data storage requirements include the data entities,
their attributes and the relationships among the data
entities.
• The model used to define the data storage
requirements is called the entity-relationship diagram
(ERD)
ERD Notation
51
Cardinality Symbols of
Relationships for ERD
52
Expanded ERD with Attributes
53
Transactions for Expanded ERD
54
ERD with Many-to-Many
Relationship
55
Many-to-Many Relationship
Converted to Associative Entity to
Store Grade Attribute
56
ERD: The RMO Case
58
The Domain Model Class Diagram
60
UML Class Symbol
61
Class Diagram
Classes, associations among classes and
attributes of classes are modeled using a class
diagram
The class diagram shows some of the behaviors
of objects of the class, called method
Methods of a class are the behaviors all objects
in the class are capable to do.
A behavior is an action that the object processes
itself, when asked to do so by sending it a
message from another object
Since each object contains values for attributes
and methods for operating on those attributes
(plus other behaviors), an object is said to be
encapsulated (i.e., a self-contained and
protected unit) 62
Simple Domain Model Class
Diagram
63
Simple Domain Model Class
Diagram (continued)
No methods shown in domain model
Domain classes are not software
classes
Very similar to ERD
UML and domain model can be used in
place of ERD in traditional approach
64
Multiplicity of Associations
65
University Course Enrollment
Domain Model Class Diagram
66
Refined Model with Association
Class and Grade Attribute
67
More Complex Class Concepts
Generalization/specialization
hierarchies
Inheritance
Aggregation
68
Generalization/Specialization
Generalization means grouping similar types of
things (e.g., motor vehicles group cars, trucks and
tanks. They share certain general features (e.g.,
wheels, engine, etc.), so motor vehicle is a more
general class)
Specializations are judgments that categorize
different types of things (e.g., sports car is a
special type of car)
A generalization/specialization hierarchy is
used to structure (or rank) things from the more
general down to the more special
Each class has a more general class above it – a
superclass
A class may have a more specialized class below –
a subclass
69
A Generalization/Specialization
Class Hierarchy for Motor Vehicles
70
A Generalization/Specialization
Class Hierarchy for RMO Orders
71
Inheritance
Inheritance is a concept that allows subclasses
to share characteristics of their superclasses
• E.g. a sports car has everything a car has (e.g., 4
wheels and an engine, which it inherits from the
class car which is above it)
• The sports car then specializes
–E.g., has a sports option, racing wheels, etc.
• In the object-oriented approach, inheritance is a
key concept that is possible because of
generalization/specialization hierarchies (these
hierarchies are often called inheritance
hierarchies)
72
Whole-Part Hierarchies
74
Class Diagram Example: Bank
Account
• Bank account system includes a generalization/specialization
hierarchy:
– Account is the superclass
– SavingsAccount and CheckingAccount are subclasses of
Account
– A triangle on the line connecting classes indicates
inheritance (the subclasses inherit attributes and behaviors from
the superclass Account like having an account number)
• But Savings and Checking accounts are also specialized
• A SavingsAccount “knows” how to calculate interest but a
checking account doesn’t (so they have different methods and
attributes, although they share things they inherit from class
Account)
75
Class Diagram Example: Bank
Account
• The Customer class and the Account class are associated
– Each customer can have zero or more accounts (the
diagram shows the minimum and maximum cardinality on the
line connecting the classes, and the asterisk means “many”
– Each account is owned by one and only one customer
• The SavingsAccount and CheckingAccount classes inherit
the association with the Customer class
• The Account class is an abstract class (i.e., the class that
cannot be instantiated, existing only to allow subclasses to
inherit its attributes, methods and associations) – shown in italics
• SavingsAccount, CheckingAccount and Customer are
examples of class are concrete classes that can be
instantiated (i.e., objects can be created)
76
A bank account system class
diagram
77
Association Class
79
The RMO Domain Class Diagram
• A generalization/specialization hierarchy
is included to show three types of orders –
web order, telephone order and mail
order, which share the attributer listed for
Order class, but each special type of order
has some additional attributes
• This diagrams shows no methods
• The initial class diagram developed during
the systems analysis phase includes no
methods. As behaviors of objects are
further developed (during analysis and
design) methods are added
80
RMO
Domain
Model
Class
Diagram
81
TA vs. OOA: Requirements modeling
• The requirements models are quite different depending
on approach used by the team: traditional or object-
oriented (the two key concepts – events and things)
• Traditional approach: based on the event table creates
a set of data flow diagrams (DFDs); the entity-relationship
diagram (ERD) defines the data storage requirements that
are included in the DFDs, views a system as a collection of
processes. When the process executes it interacts with
data. So, emphasizes processes, data, input/outputs
• Object Oriented approach: based on the event table
creates class diagrams, views a system as a collection of
interacting objects with their own behaviour (methods).
There are NO conventional processes and data files, just
interacting objects
82
Requirements Models in TA and OOA
83
Readings
!!!
o u
For next lecture: Chapter 6y– “The Traditional
n k
Approach to Requirements”
a
Th
84