HNDIT1212 Lecture 9 System Design-I
HNDIT1212 Lecture 9 System Design-I
com
IT2005
System Analysis
& Design
1
www.hndit.com
Model
• Model is a presentation of reality.
Just a picture is worth a thousand of words,
most system models are pictorial
representations of reality.
2
3
www.hndit.com
Modelling Methods
A set of techniques used to implement a Methodology
5
Process Modeling…
• Systems Analyst may first draw
– Data Flow Diagram OR
– Documents Flow Diagram
Depends on the Methodology
6
www.hndit.com
• Physical DFDs-
– DFDs that show how things happen, or the
physical components are called physical DFDs
7
www.hndit.com
8
Document Flow Diagrams
Used to examine the flow of documents within the
existing system.
Example: Purchasing System
Order Purch.
Dept.
Supplier
Invoice
De
te
no
liv
er
ry
yn
e
iv
ot
el
D
e
Stores
9
www.hndit.com
10
www.hndit.com
11
www.hndit.com
12
www.hndit.com
13
www.hndit.com
14
www.hndit.com
ATI System
15
www.hndit.com
16
www.hndit.com
4. Data Flows
• Data flow model the passage of data in the
system and are represented by lines joining
system components.
• Flows of data in the system can take place:
– Between two processes
– From a data store to a process
– From a process to a data store
– From entities to a process
– From process to a entities
17
www.hndit.com
18
www.hndit.com
19
www.hndit.com
Context diagram
• A common way to begin is to model, the
whole system by one process.
• It shows all the external entities that interact
with the system and the data flow between
these external entities and the system.
20
www.hndit.com
Context Diagram
• defines the scope of the system by
identifying the system boundary
• contains:
– one process (which represents the
entire system)
– all sources/sinks (external entities)
– data flows linking the process to
the sources and sinks (external
entities)
21
www.hndit.com
Constructing a Context Diagram
22
www.hndit.com
23
www.hndit.com
24
www.hndit.com
25
www.hndit.com
26
www.hndit.com
27
www.hndit.com
28
www.hndit.com
29
www.hndit.com
30
www.hndit.com
31
www.hndit.com
32
www.hndit.com
33
www.hndit.com
34
www.hndit.com
35
Library System
36
www.hndit.com
37
www.hndit.com
38
www.hndit.com
39
Level-0 Diagram www.hndit.com
40
www.hndit.com
Drawing a Level-0 Diagram
41
www.hndit.com
42
www.hndit.com
43
www.hndit.com
44
www.hndit.com
Other Questions about Lower level diagrams
46
Budget monitoring system
www.hndit.com
47
www.hndit.com
Top-level DFD diagram
48
www.hndit.com
49
DFD Example: Bus Garage Repairs
www.hndit.com
Mechanical Fixed
problem mechanical
to be repaired problems
Repair Supervisor
Helper Labor Bus summary
Repair
Process List of
System parts used Inventory
Labor Management
Labor, System
parts cost
details
Mechanic
Accounting
www.hndit.com
• Physical DFDs-
– DFDs that show how things happen, or the
physical components are called physical DFDs
54
www.hndit.com
55
www.hndit.com
Differences between flowcharts and data
flow diagrams
• DFDs are not program flow chats and should
not include control elements. A good DFD
should;
1. Have no data flows that split up into a number of
other data flows.
2. Have no crossing lines
56
www.hndit.com
57
www.hndit.com
58
www.hndit.com
59
SUMMARY OF ER-DIAGRAM www.hndit.com
NOTATION FOR ER
Symbol SCHEMAS
Meaning
ENTITY TYPE
RELATIONSHIP TYPE
ATTRIBUTE
KEY ATTRIBUTE
MULTIVALUED ATTRIBUTE
COMPOSITE ATTRIBUTE
DERIVED ATTRIBUTE
TOTAL PARTICIPATION OF E2 IN R
N
E1 R E2 STRUCTURAL CONSTRAINT (min, max) ON PARTICIPATION OF E IN R
(min,max)
R E
Chapter 3-60
www.hndit.com
Questions
1. What is the different between super key and
candidate key
answer
• A super key is a set of columns that uniquely
identifies a row. A Candidate key would be a
MINIMAL set of columns that uniquely
identifies a row.
• So essentially a Super key is a Candidate key
with extra unnecessary columns in it.
www.hndit.com
Entity
Relationship
Attribute
65
www.hndit.com
Conceptual Design
Attribute
Key Attribute
Multivalued attributes
Derived Attribute
Weak Entity
Identifying Relationship
66
www.hndit.com
Explain the term ‘Degree’
Number of participating entity types.
• Unary Relationship
– A relationship between the instances of a single entity
type
e.g. Person is married to a Person manages
Employee manages Employees
Employee
• Binary Relationship
– A relationship between the instances of two entity types
e.g. An employee works for a department
Part
Supplier Supplies
Project 68
www.hndit.com
Explain term ‘Cardinality’
Employee
Weak Entity
– An entity types whose existence depends on
some other entity
Dependent
71
www.hndit.com
Entity Types
Identifying Owner
– The entity type on which the weak entity type
depends
e.g. Employee is the Owner of Dependent
Identifying Relationship
– A relationship between a weak entity type and
its owner
has
72
www.hndit.com
Attributes
• Multi-valued Attribute
– An attribute that may take on more than one
value for a given entity instance
e.g. Employee Skills, Qualifications
• Composite Attribute
– An attribute that can be broken down into
component parts
e.g. Address (Street, City, State, Postal Code)
Name (First Name, Middle Initials, Last Name)
73
www.hndit.com
Key Attribute
(Identifier)
• Identifier
– An attribute (or combination of attributes) that uniquely
identifiers individual instances of an entity type
e.g. Emp No
• Composite Identifier
– An identifier that consists of a composite attribute
e.g. Flight Id (Flight No, Date)
74
www.hndit.com
75
www.hndit.com
Attributes on relationships
Date Completed
Emp id Emp Name Course id Course Title
76
www.hndit.com
1 m
0..*
www.hndit.com
• Hospital tables:
• patients (patient-id, name, insurance, date-
admitted, date-checked-out)
• doctors (doctor-id, name, specialization)
• test (testid, testname, date, time, result)
• doctor-patient (patient-id, doctor-id)
• test-log (testid, patient-id) performed-by
(testid, doctor-id)
www.hndit.com
89
ER DIAGRAM – Entity Types are: www.hndit.com
EMPLOYEE, DEPARTMENT, PROJECT, DEPENDENT
Designing an ER Diagram
www.hndit.com
Consider the following set of requirements for a University database. Design an ER diagram
for this application:
• The university keeps track of each student's name, student number, social security
number, current address and phone number, permanent address and phone number,
birthdate, sex, class (freshman, graduate), major department, minor department (if
any), degree program (B.A., B.S., ... Ph.D.). Some user applications need to refer to the
city, state, and zip code of the student's permanent address and to the student's last
name. Both social security number and student number are unique for each student.
All students will have at least a major department.
• Each department is described by a name, department code, office number, office
phone, and college. Both the name and code have unique values for each department.
• Each course has a course name, description, course number, number of credits, level
and offering department. The course number is unique for each course.
• Each section has an instructor, semester, year, course, and section number. The section
number distinguishes sections of the same course that are taught during the same
semester/year; its value is an integer (1, 2, 3, ... up to the number of sections taught
during each semester).
• A grade report must be generated for each student that lists the section, letter grade,
and numeric grade (0,1,2,3, or 4) for each student and calculates his or her average
GPA.
University ER Diagram www.hndit.com
Degree DName DCode OfficeNumber
Name StudentID SSN
Major In
Birth date
OfficePhone
Department
Sex Student
College
Class Minor In
Address
CName
Grade_Report
CourseDesc
Letter Grade Instructor Year Course
CNumber
GPA
Credits
Numeric Grade Section Belong_To
SectionNumber Semester
www.hndit.com
Structured English
IF credit limit exceeded
THEN
IF customer has bad payment history
THEN refuse credit
ELSE
IF purchase above Rs. 1000/=
THEN refuse credit
ELSE refer to manager
ELSE allow credit
93
www.hndit.com
94
www.hndit.com
95