Systems Analysis and Design Allen Dennis and Barbara Haley Text

ANALYSIS PHASE
Requirements Determination
Use Case Analysis
Process Modeling
Data Modeling
7-1
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ANALYSIS PHASE
Data Modeling
7-2
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Key Definitions
Data model
A formal way of representing the data
that are used and created by a business
system
Shows the people, places and things about
which data is captured and the relationships
among them.
7-3
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Key Definitions
Logical data model
shows the organization of data without indicating
how it is stored, created, or manipulated.
Physical data model
shows how the data will actually be stored in
databases or files.
Normalization is the process analysts use to
validate data models.
Data models should balance with process
models (data model  process model)
7-4
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
THE ENTITYRELATIONSHIP
DIAGRAM (ERD)
7-5
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
What Is an ERD?
A picture showing the information created, stored, and
used by a business system.
Entities generally represent similar kinds of information
Lines drawn between entities show relationships among
the data
High level business rules are also shown, e.g:
“a patient can schedule many appointments”
“a person must make at least one appointment before
he/she is considered a patient”
Business rules are constraints that are followed when the
system is in operation.
7-6
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Using the ERD to Show Business
Rules
ERD symbols can show when one instance of an
entity must exist for an instance of another to exist
A doctor must exist before appointments the doctor can be
made
ERD symbols can show when one instance of an
entity can be related to only one or many instances of
another entity
One doctor can have many patients; each patient may have
only one primary doctor
ERD symbols show when the existence of an entity
instance is optional for a related entity instance
A patient may or may not have insurance coverage
7-7
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ERD Elements
7-8
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
CREATING AN ENTITYRELATIONSHIP
DIAGRAM (ERD)
7-9
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ERD Basics
Drawing the ERD is an iterative process
of trial and revision
ERDs can become quite complex
Steps in building ERD:
Identify the entities
Add appropriate attributes for each entity
Draw the relationships that connect
associated entities
7 - 10
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Step 1: Identify the Entities
Identify major categories of information
If available, check the process models for data
stores, external entities, and data flows
Check the major inputs and outputs from the use
cases
Verify that there is more than one instance of
the entity that occurs in the system
7 - 11
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Step 2: Add Appropriate Attributes
Identify attributes of the entity that are relevant to the
system under development
Check the process model repository entries for details on
data flows and data stores
Check the data requirements of the requirements definition
Interview knowledgeable users
Perform document analysis on existing forms and reports
Select the entity’s identifier
7 - 12
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Step 3: Draw the Relationships
Start with an entity and identify all entities with
which it shares relationships
Describe the relationship with the appropriate
verb phrase
Determine the cardinality and modality by
discussing the business rules with
knowledgeable users
7 - 13
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
An ERD Example
entity
relationship
identifier
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Reading ERD
DOCTOR is scheduled for
APPOINTMENT, APPOINTMENT
includes DOCTOR
PATIENT schedules APPOINTMENT,
APPOINTMENT is scheduled by
PATIENT
APPOINTMENT generates BILL, BILL is
generated by APPOINTMENT
PATIENT makes PAYMENT, PAYMENT
is made by PATIENT
INSURANCE COMPANY insures
PATIENT, PATIENT is insured by
INSURANCE COMPANY
INSURANCE COMPANY makes
PAYMENT, PAYMENT is made by
INSURANCE COMPANY
BILL is paid by PAYMENT, PAYMENT
pays BILL
7 - 15
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Entity
A person, place, event, or thing
about which data is collected
Must be multiple occurrences to
be an entity
Example: If a firm has only
one warehouse, the
warehouse is not an entity.
However, if the firm has
several warehouses, the
warehouse could be an entity
if the firm wants to store
data about each warehouse
instance.
7 - 16
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Attributes
Information captured about an
entity
Only those used by the
organization should be included in
the model
Attribute names are nouns
Sometimes entity name is added at
the beginning of the attribute
name for clarity, example:
Entity name
attribute
Entity : Patient
Attribute: Patient_name
Patient_ID
7 - 17
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Identifiers
One or more attributes can serve as
the entity identifier, uniquely
identifier
identifying each entity instance
Concatenated identifier consists of
several attributes
An identifier may be ‘artificial,’
such as creating an ID number
Identifiers may not be developed
until the Design Phase – to be
added later
7 - 18
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Relationships
Associations between entities
The first entity in the relationship is the parent entity;
the second entity in the relationship is the child entity
Relationships should have active verb names
Relationships go in both directions
parent
7 - 19
child
parent
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Entity
Entity type – A collection of entities that share common
properties or characteristics
Type Entity
7 - 20
Example
People
STAF, PELAJAR, PENSYARAH, PATIENT
Place
DAERAH, BANDAR, NEGERI, STORE
Object/Thing
BANGUNAN, PERALATAN, PRODUCT
Event
PENDAFTARAN, PERMOHONAN, ORDER
Concept
KURSUS, AKAUN, APPOINTMENT, BILL
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ERD Notation: Entity & Attribute
EMPLOYEE
EMP_name
EMP_phone
EMP_id
EMP_name
EMP_phone
EMP_address
7 - 21
OR
EMP_address
EMP_id
EMPLOYEE
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ERD Notation: Relationship
EMPLOYEE
EMP_id
EMP_name
EMP_phone
EMP_address
PROJECT
Is assigned to/
assigned
PROJ_id
PROJ_name
PROJ_desc
or
EMP_phone
EMP_name
PROJ_name
EMP_address
PROJ_desc
PROJ_id
EMP_id
EMPLOYEE
7 - 22
Is assigned to
PROJECT
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Cardinality
Cardinality - refers to the number of times instances in one
entity can be related to instances in another entity
One instance in an entity refers to one and only one instance in the related
entity (1:1)  “one-to-one”
One instance in an entity refers to one or more instances in the related entity
(1:N)  “one-to-many”
One or more instances in an entity refer to one or more instances in the related
entity (M:N)  “many-to-many”
Modality - Refers to whether or not an instance of a child entity
can exist without a related instance in the parent entity
Not Null means that an instance in the related entity must exist for an instance
in another entity to be valid
Null means that instance in the related entity is not necessary for an instance in
another entity to be valid
7 - 23
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Relationship Cardinality …an example
• 1 : 1 one-to-one
• satu orang staf ( contoh ketua jabatan) akan
menguruskan satu jabatan dan satu jabatan akan hanya
mempunyai satu ketua jabatan sahaja
1 : N one-to-many
• satu orang pelanggan boleh membuat banyak tempahan
tetapi bagi satu tempahan adalah untuk satu pelanggan
sahaja
M : N many-to-many
• satu orang pelajar boleh mendaftar banyak kursus dan
satu kursus
boleh
ambil
ramai
pelajar
PowerPoint
Presentation
for Dennis
& Haley Wixom,
Systems Analysis and Design, 2 Edition
nd
7 - 24
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Relationship Cardinality
Mandatory 1 cardinality
(1,1)
or
Mandatory many (M) cardinality (1, 2,…,many), n is a number
for an upper limit)
(1,n)
or
Optional 0 or 1 cardinality
(0,1)
or
Optional zero-many cardinality (0,1,2,…many)
(0,n)
7 - 25
or
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ERD : Contoh
Entity-Relationship Diagram: MISville Library
This is the entity-relationship diagram for the MISville Library:
Attributes
B #1: ISBN Number
B #2: Title
B #3: Subject(s)
B #4: Author(s)
B #5: Date of Publication
B #6: Acquisition Number
LC #1: Name
LC #2: Address
LC #3: Phone
LC #4: DOB
LC #5: SSN
LC #6: Card Number
AJ #1: ISBN Number
AJ #2: Title
AJ #3: Subject(s)
AJ #4: Author(s)
AJ #5: Date of Publication
AJ #6: Acquisition Number
CC #1: Book Title
CC #2: Author(s)
CC #3: Subject(s)
Data Modeling - ERDPowerPoint
7 - 26
Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd
Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Whenever new patients are seen for the first time, they complete a patient information
form that asks their name, address, phone number, and insurance agent, all of which is
stored in the patient information file. Patients can be signed up with only one agent. Each
time a patient visits its doctor, an insurance claim is sent to the agent for payment. The
claim must contain information about the visit, such as the date, purpose, and cost. It
would be possible for a patient to submit two claims on the same day. Draw an ERD for
the situation.
address
name
# phone
Insurance
name
Patient
submit
date
cost
purpose
7 - 27
Doctor
visit
sign
(0, 2)
Insurance
Claim
send
(0, 2)
(0, 1)
Insurance
Agent
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Practice: Food Order System
Read the situation given below,
Food Order System is used by Yummy Restaurant to manage every order from their
customers. The Food Order System has few functions and very user friendly. It
begins when the system receives order from the customer. The system will
produce receipt by referring to the order. The order is also sent to the kitchen
department. The system also used the information from the order to update their
inventory as well as their sales. The system also has function to generate reports
for the top management, i.e. sales report and inventory report.
Food Order System digunakan oleh Yummy Restaurant untuk mengurus setiap
tempahan dari pelanggan. Food Order System ini mempunyai beberapa fungsi
dan ramah pengguna. Ia bermula apabila sistem menerima tempahan dari
pelanggan. Sistem akan mengeluarkan resit dengan merujuk kepada tempahan.
Tempahan juga dihantar kepada bahagian dapur. Sistem juga menggunakan
maklumat dari tempahan untuk mengemaskini inventori serta jualan. Sistem juga
mempunyai fungsi untuk menghasilkan laporan-laporan bagi pihak pengurusan,
iaitu laporan jualan dan laporan inventori
Draw ERD for the situation given.
7 - 28
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
DFD
Level 0
CUSTOMER
Order
information
1.0
Receive
order
Order
information
KITCHEN
DEPARTMENT
receipt
Order
information
2.0
Produce
receipt
Order
information
D2
Inventory file
Updated
information
3.0
Update
inventory
and sales
D1
Order file
D3
Sales file
Order
information
Order
information
Updated
information
4.0
Generate
reports
MANAGEMENT
Inventory &
sales Reports
7 - 29
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ERD
CUSTOMER
make
receive
ORDER
KITCHEN
DEPARTMENT
update
update
RECEIPT
Send to
INVENTORY
SALES
generate
INVENTORY
REPORT
generate
submit
submit
SALES
REPORT
MANAGEMENT
7 - 30
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
ERD Building Tips
Data stores of the DFD should
correspond to entities
Only include entities with more than one
instance of information
Don’t include entities associated with
implementation of the system (they will
be added later) – physical model of ERD
7 - 31
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Exercise
For each pair of sentences, identify
entities and the relationship
representing the sentences.
"Each Student must take one or more
Modules"
"Each Module must be taken by one or
more Students"
"Each Customer must receive at least
one Delivery"
"Each Delivery must be for only one
Customer"
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
"A Client my have
an Account
nd
7 - 32
Whenever new patients are seen for the first time, they complete a patient information
form that asks their name, address, phone number, and insurance carrier, all of which is
stored in the patient information file. Patients can be signed up with only one carrier.
Each time a patient visits its doctor, an insurance claim is sent to the carrier for payment.
The claim must contain information about the visit, such as the date, purpose, and cost. It
would be possible for a patient to submit two claims on the same day. Draw an ERD for
the situation.
address
name
# phone
Insurance
name
Patient
visit
Doctor
submit
date
cost
Insurance
Claim
(0, 2)
send
Insurance
Carrier
(0, 1)
purpose
7 - 33
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Associative Entity
An entity type that associates the instances of one or more
entity types and contains attributes that are peculiar to the
relationship between those entity instances
Example: Date_completed is not a property of entity
EMPLOYEE or COURSE, it is a property of the relationship
between EMPLOYEE and COURSE.
Employee_id
7 - 34
Course_Name
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
SHIPMENT Entity Type (an Associative Entity)
7 - 35
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Type of Attribute
Derived Attribute
Composite Attribute
Alamat
Negeri
No_rumah
Umur
STAF
No_Staf
Jalan
Poskod
Tarikh_lahir
Nama
Bandar
Multivalued Attribute
STAF
No_Staf
Nama
Nama_tanggungan
Create weak entity to separate the
repeating data
STAF
No_Staf
7 - 36
1
mempunyai
M TANGGUNGAN
Nama
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Degree of a Relationship
7 - 37
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Sample of ERD
SUPPLIER
SUP_ID
SUP_name
SUP_contact
SUP_address
sends/sent by
supplies/supplied by
SHIPMENT
ITEM
SHIP_ID
SHIP_date
PRODUCTION PLAN
ITEM_NO
includes/
included on
ITEM_name
produces/
produced on
goes into/
composed of
PRODUCT
PRO_name
PRO_cost
PRO_xxx
generated on/
generates
MASTER SCHEDULE
PROD_code
PROD_name
7 - 38
builds/
built on
SCH_name
SCH_desc
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Final E-R Diagram for Hoosier Burger’s Inventory Control System
7 - 39
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
7 - 40
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd Edition
Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.