Al Khawarizmi International College, Al Ain , U.A.E
description
Transcript of Al Khawarizmi International College, Al Ain , U.A.E
Al Khawarizmi International College,Al Ain , U.A.E
Software Development
Module Code: CST 240
Chapter 4: Software Design
Lecturer:Karamath Ateeq
Chapter 4: Software Design2
OutlineSoftware Design Approaches:• Function –Oriented design Methodology: SSADM Major Tools: DFD, ER Diagram• Object –Oriented Design Methodology: OOP-Object Modeling using UML
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design3
Features of function-Oriented Design:
1 .A system is viewed as something that performs a set of functions. Starting from high level, each function is successively
refined into more detailed functions. Eg: create-new-library consists of the following sub functions :
( 1 )assign-membership –number( 2 )create-member-record
( 3)Print-bill2 .The system state is centralized and shared among different
functions Eg: Data such as member-records is shared among
( 1)create-new-member( 2)delete-member
( 3 )update-member-record
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design4
Al Khawarizmi International College,Abu Dhabi, U.A.E
Object –Oriented Vs Function –Oriented Design:
•Unlike Function –Oriented Design methods ,in OOD, the basic abstractions are not real –world functions like sort, display etc but real- world entities such as employee ,picture ,machine ,radar system etc.
•In OOD, state information is not represented in a centralized shared memory but is distributed among the objects of the system.
•Function –Oriented techniques, such as SA/SD, group functions together as if they constitute a high level function . On the other hand Object –Oriented techniques group the functions together on the basis of the data they operate on
Chapter 4: Software Design5
SSADM- Structured System Analysis and Design Method.
SSADM uses a combination of three techniques:
(1) Logical Data Modeling- The processing of identifying, modeling and documenting the data. The data is separated into entities and relationships between the entities.
(2) Data Flow Modeling- The processing of identifying, modeling and documenting how the data moves around the system. It examines the processes, data stores, external entities and data flows.
(3) Entity Behavior Modeling-The processing of identifying, modeling and documenting the events that affect each entity and the sequence in which these events occur.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design6
SSADM application development projects are divided into five modules:
1. Feasibility study.
2. Requirements Analysis.
3. Requirements Specification.
4. Logical System Specification.
5. Physical Design.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design7
Advantages of using SSADM:
Unlike rapid application development , which conducts steps in parallel , SSADM builds each step on the work that was prescribed in the previous step ,with no deviation from
the model .
It has a control over the project and has the ability to develop better quality systems .
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design8
Context Analysis Diagram• The context diagram represents the entire
system under investigation.• The components of a context diagram are
– Process : Shows the main process of the system.
– External entities : External Entity is a source or destination of the data, e.g a person, supplier, department, or another system.
– Data flows : The data flow shows the flow of data from an external entity to the process and vice-versa.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design9
Data-flow Diagram• Data-flow diagrams illustrate how data
flows through a system and how the output is derived from the input through a sequence of functional transformations.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design10
DFD ComponentsThe components are
• any external entity that interact with the system,
• the system processes,
• the data stored by these process,
• and the data flows in the system.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design11
DFD Symbols
• Data flow diagrams use a number of symbols to represent systems components. Several different versions of symbols are used to construct DFD's. Two major versions are:– Yourdan /Demarco– Gane/Sarson
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design12
Yourdan /DemarcoGane/Sarson
Process
Data store
External Entity
Source/destination
dataflow
DFD Symbols
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design13
External entity• External entity is a source or destination of
a data flow which is outside the area of study.
• Represents organizations, agents, or people, outside the system under study.
• Duplicate external entity is shown as
Al Khawarizmi International College,Abu Dhabi, U.A.E
CustomerCustomer
CustomerCustomer
Chapter 4: Software Design14
Process• Processes represent the transformation of data
as it flows thorough the system.• Each process symbol has its unique identifying
number (such as 1.0,2.0, 2.1.2 and so on) • Process symbol should also be labeled with
purpose or type of process to occur. The label should be a unique and expressing a strong statement of action on an object such as update inventory, create order etc
Al Khawarizmi International College,Abu Dhabi U.A.E
Chapter 4: Software Design15
Process• The location specification at the bottom of
the symbol is optional. It is used strictly as documentation, to show either where the process occurs or who is responsible for it.
Al Khawarizmi International College,Abu Dhabi, U.A.E
4.0
VERIFY ORDER
Purchase dept
IdentificationDescription of
the function
Location (opt.)
Chapter 4: Software Design16
Data Store• Data Store is a repository where the data
is stored.
• It can be a data base or file on a tape or disk, or it can be a manual medium such as filing cabinet.
Al Khawarizmi International College,Abu Dhabi, U.A.E
DescriptionID
D1 Customer data
Chapter 4: Software Design17
Data Flow• Data flow show the flow of information
from an entity to a process or a process to a data store or vice-versa.
• Any one end of a data flow must be connected to a process.
CustomerCustomerCustomer - order Verify
order
1.0
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design18
Do’s and Don'tsDo’sDon’ts
Chapter 4: Software Design19
DFD Levels• Level 0 DFD : The level 0 DFD shows only
the main processes of the system. Ideally 7-9 processes can be shown in Level 0 DFD. Processes are numbered as 1.0,2.0,3.0 and so forth.
• Level 1DFD : The Level 1 DFD is created to explode any one process of the level 0 DFD. Level 1 DFD, for process 1 in level 0 DFD, will be numbered as 1.1,1.2,1.3 etc.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design20
DFD TypesThere are two types of DFDs:
• Logical DFD:
• Physical DFD:
Al Khawarizmi International College,Abu Dhabi U.A.E
Chapter 4: Software Design21
Logical vs Physical DFDDesign FeaturesLogical DFDPhysical DFDWhat the model depicts/shows
How the business operates
How the system will be implemented
What the process represents
Business activatesPrograms and manual procedures
What does the data store represent
Collection of data, regardless of how the data is stored.
Physical files and databases, manual files.
Types of data storesShows the permanent data collection
Master files, transaction files. Any processes that operate at two different times must be connected by a data store.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design22
Logical DFD guidelinesData flows:• Physical DFDs corresponds to things like
business forms, documents, reports, terminal displays, spoken communication such as phone calls etc. But logical data flows are implementation independent.
• A logical DFD represents the minimum, essential data necessary needed by the process that receives the data flow.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design23
Logical DFD GuidelinesData flows:
• Logical dataflow names should be descriptive adjectives and nouns.
• Data flow names should be singular and not plural.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design24
Logical Process:• Logical processes depicts what work or action
has been performed on incoming data flows to produce outgoing data flows and not who or what is doing that work or activity.
• Examples:– Credit customer account– Update inventory– Verify account.
Logical DFD Guidelines
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design25
Logical Data Store:• Logical data store are very different from
the physical data store.• Physical data store corresponds to
implementations such as databases, files, file cabinets, log sheets, books etc.
• In contrast , the logical data stores represent the businesspeople, objects and events about which we need to store data.
Logical DFD Guidelines
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design26
Practical• Draw CAD and DFD for the given case study.• The operation theater of Al Noor Hospital requires a computerized system to maintain the details of the
patient who undergo operations. A patient comes to the ward with an admission note from a doctor. The patient is admitted in a ward of the hospital for an operation. Before admitting the patient the personal details of the patient is obtained and an admission file is open and an operation note is given to the patient. The information of each operation conducted in the hospital has to be maintained separately. Al Noor hospital gives special discount to some patients according to their policy. The policy should include details of discount given. On a daily basis a report of patients undergoing an operation the next day should be generated by the system. This report is given to the management. Another report should be generated for the doctor that gives details of the number of operations he has the next day. After the operation, when a patient has to be discharged a patient-discharge note is given to the patient.
• Draw a Context diagram and Data Flow diagram or the given case study.
•
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design27
Data Dictionary• A data dictionary lists all data items
appearing in the DFD model of a system.
• The data items listed include all data flows and the contents of all data stores appearing on all DFD’s in the DFD model of a system.
• The data flows on the context diagram can be used as a start of the data dictionary
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design28
A data dictionary plays a very important role in any software development process because of the following reasons:
• It provides a standard terminology for all relevant data for use by all engineers working in the same project.
• It helps the analyst to know the component elements of a data structure.
• Data dictionary also serves as basis for creating systems database.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Benefits of Data Dictionary
Chapter 4: Software Design29
Components of Data Dictionary• Data Flow: Data flow is usually the first
component to be defined.• Data Store: Data’s are stored here.• Data element: The most basic piece of
data that can’t be broken into more detailed unit is called data element.
• Data structures: Combinations of data elements make up data structures i.e. a meaningful set of data elements.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design30
Data Dictionary Types• Logical data dictionary: It needs only
data elements name like the description of the item, its number, color, size, price, quantities etc.,
• Physical data dictionary: It might include data element names along with some characteristics of those elements e.g. field size, checks/controls/validation, data store/s using those elements etc.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design31
Data Dictionary Rules The terms used for data structures should be capital Name having multiple words are hyphenated(-) e.g
ITEM-DESC Assigned names should be straight forward and
user oriented There should be a name for each data flow, data
store, data structure, data element No two data flows should have the same name A data flow should not have more than one name
and aliases (nick names) must be discouraged
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design32
Data Flow Example
Al Khawarizmi International College,Abu Dhabi, U.A.E
Sl noData Flow Name
TypeData structureDescription
1customer information
formCustomerCustomers personal details are obtained from this form
Note: Data Flow types can be Form, Note, Paper list, Letter etc
Chapter 4: Software Design33
Data Store• When data flow elements are grouped to
form a structural record, a data store is created for each unique structured record.
• One data store may contain several data structures.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design34
Data Store Examples
Al Khawarizmi International College,Abu Dhabi, U.A.E
Data store No
Data Store NameData Element
D1CustomersCustomer_id, customer_name, address, phone
Chapter 4: Software Design35
Data StructureData Structure Symbols
• = means “equivalent”
• + means “and”
• {} means “repeating data element”
• [|] means “either one data element or another”
• ( ) means “optional data element”
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design36
• CUSTOMER = customer_id +CUSTOMER_NAME+ADDRESS+phone
CUSTOMER_NAME= first_name + (middle_name) + last_name
ADDRESS = (street) + p.o.box+ city
Data Structure example
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design37
• PAYMENT = payment_id + payment_date+customer_id + total_amount + payment_mode + [credit_card_no | check_number] +
{ item_id + item_name +qty + unit_price +amount}
Al Khawarizmi International College,Abu Dhabi, U.A.E
Data Structure example
Chapter 4: Software Design38
Data Element• Data element is the smallest unit which
cannot be divided further.• Each data element must be defined once
in data dictionary.• Input/output format symbols:
X - May enter or display any character9 - Enter or display only numbers, - insert comma into a numeric display
- - separator
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design39
Data Element Examples
Al Khawarizmi International College,Abu Dhabi, U.A.E
SlnoData elementTypeSizeFormatValidation
Default value
1Customer_idNumeric6999999Must be unique
Nil
2First_namecharacter25X(25)Cannot be left blank
nil
3Citycharacter20X(20)Cannot be left blank
Abu Dhabi
4Phonecharacter 1099-9999999Only numbers
nil
Chapter 4: Software Design40
E-R Diagram• Entity Relationship Diagram shows the
relationship between the tables in a database.
• The relationship can be– One- to – One– One- to many– Many -to -many
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design41
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design42
Introduction to UML• UML stands for Unified Modelling
Language
• UML is emerging as a standard modelling language Object Oriented Modelling.
• It is useful for graphically depicting object-oriented analysis and design models
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design43
UML• UML allows to represent multiple views of
a system using a variety of graphical diagrams:
• Use-Case Diagram
• Class Diagram
• State Diagram
• Sequence Diagram
• Collaboration Diagram
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design44
UML• Use Case
• A use-case model consists of actors and use cases.
• It helps us to get the functional requirement of the system.
• Use case gives a complete sequence of related actions initiated by an actor to accomplish a specific goal.
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design45
UML• Class Diagram: It shows the main
concepts and techniques in object modelling.
• State Diagram: A state diagram depicts the various state transitions or changes an object can experience during its lifetime.
• Interaction between use cases is shown using two diagrams called– Sequence Diagram – Collaboration Diagram
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design46
Use-case Diagram
User
Lending service
User administration
Supplier Catalogue services
Library
LibraryStaff
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design47
Class Diagram
Al Khawarizmi International College,Abu Dhabi, U.A.E
Chapter 4: Software Design48
State Diagram
Al Khawarizmi International College,Abu Dhabi , U.A.E