Sad ch4 Part 2
Sad ch4 Part 2
************
The DFD is an excellent communication tool for analysts to model processes and
functional requirements. One of the primary tools of the structured analysis efforts
of the 1970's it was developed and enhanced by the likes of Yourdon,
McMenamin, Palmer, Gane and Sarson. It is still considered one of the best
modeling techniques for eliciting and representing the processing requirements of
a system
DFD’s are versatile programming tools. With only four symbols, it can represent
both physical and logical information systems.
Data flow
The directional movement of data to and from external entities, the process and
data stores. If it flows into a data store, means a write, update, delete, etc. Flows
out of data stores, mean read, query, display, select types of transaction.
Symbol: Solid line with arrow. Each data flow is identified with a descriptive
name that represents the information on the data flow.
Example:
Registration data
Process
Data Store
External Entity
Developing DFD’s
After drawing the context diagram, the next step is to analyze the processes are
represented by the single process. There are four main processes are identified,
the processes represent the major functions of the system, the major functions are
o Capturing data from different sources (process 1)
o Maintaining data stores (process 2 and 3)
o Producing and distributing data to different sinks (process 4)
o High level descriptions of data transformation operations (process 1)
The flow from first process 1. are 1) the food order is transmitted to the kitchen,
2) the customer order is transformed into a list of goods sold, 3) the customer
order is transformed into inventory data, and 4) the process generates a receipt for
the customer.
Two of the data flows generated by the process, receive and transform customer
food order, go to external entities, not to concern about what happens outside of
our system..
The data labeled Goods Sold go to process 2, update Goods Sold file. The output
for this process is labeled Formatted Goods Sold Data. The output updates a data
store labeled Goods Sold File. Daily Goods Sold amounts are then used as input
to process 4, Produce Management reports. Similarly the data flow generated by
process 1 called Inventory Data, serves as input for process 3, Update Inventory
File. The Daily Inventory Depletion amounts are then used as input to process 4.
The DFD hides the physical characteristics of the system it describes. Process 1
and 3 are coupled to each other, since the data flow from process 1 must be
readily accepted by process 3.
Process 2 and 4 are decoupled by placing a buffer, a data store.
Process
A. No process can have only outputs. It is making data from nothing. If an object
has only outputs, then it must be a source.
Incorrect Diagram Correct Diagram
B. No process can have only inputs. If an object has only inputs, then it must be a
sink
Data Store
D. Data cannot move directly from one data source to another data source. Data
must be moved by a process
E. Data cannot move directly from an outside source to a data store. Data must
be moved by a process that receives data from the source and places the data
into the data store.
F. Data cannot move directly to an outside sink from a data store. Data must be
moved by a process.
H. Data cannot move directly from a source to a sink. They must be moved by a
process if the data are of any concern to our system. Otherwise, the data flow
is not shown on the DFD.
Data Flow
J. A data flow has only one direction of flow between symbols. It may flow in
both directions between a process and a data store to show a read before an
update. The latter is usually indicated, however by two separate arrows
because these happen at different times.
K. A fork in a data flow means that exactly the same data go from a common
location to two or more different processes, data stores, or sources/sinks.
A A
B A
L. A join in a data flow means that exactly the same data come from any of two
or more different processes , data stores, or sources/sinks to a common
location
A A
B A
M. A data flow cannot go directly back to same process it leaves. There must be
at least one other process that handles the data flow, produces some other data
flow, and returns the original data flow to the beginning process.
A
A B
Decomposition of DFD’s
The act of going from a single system to more component processes is called
decomposition
The functional decomposition is a repetitive process of breaking the system into
finer and finer detail.
Each of the processes (or subsystem) is also candidate for decomposition. Each
process may consist of several sub processes. Each sub process may also be
broken down into smaller units.
Decomposition continues until no sub process can logically be broken down any
further. The lowest level of DFD is called primitive DFD.
The first process in the figure-2 can be decomposed into four different outputs. 1)
Receive a customer order, 2) transform the entered order into a printed receipt for
the customer, 3) transform the order into a form meaningful to the kitchens
system 4) transform the order into goods sold data, and 5) transform the order into
inventory data.
The decomposition of Process 1 is given below
The context and level-0 diagram will show the sources and sinks. No sources or
sinks are represented in figure-3. We can decompose processes 2, 3, or 4 in a
similar manner. In general, a level-n diagram is a DFD that is generated is form n
nested decompositions from a level-0 diagram.
As a rule of thumb, no DFD should have more than about seven processes in it.
The labels for the processes and numbering rules for clear communication,
process names should be clear and concise, it may begin with an action verb, such
as receive, calculate, transform, generate or produce.
Process 4 can be further decomposed into level-1, level-2 as given below.
Balancing DFDs
The conservation of inputs and outputs to a data flow diagram process when that
process is decomposed to a lower level.
For Ex. Process 1, which appears in a level-0 diagram, must have the same inputs
and outputs when decomposed into a level-1 diagram is called balancing.
The principle of balancing and goal of keeping a DFD as simple as possible lead
to four additional, advanced rules for drawing DFDs.
o A composite data flow on one level can be split into component data
flows at the next level, but no new data can be added and all data in the
composite must be accounted for in one or more sub flows.
o The input to a process must be sufficient to produce the outputs from the
process. Thus all outputs can be produced, and all data in inputs move
somewhere, either to another process or to a data store outside the process
or on a more detailed DFD showing a decomposition of that process.
o At the lowest level of DFDs, new data flows may be added to represent
data that are transmitted under exceptional conditions; these data flows
typically represent error messages or confirmation notices.
o To avoid having data flow lines cross each other, you may repeat data
store or entities on a DFD. Use an additional symbol, like a double line on
the middle vertical line of a data store symbol, or a diagonal line in a
corner of a entity square, to indicate a repeated symbol.
£ Entity Relationship Diagrams are a major data modeling tool and will help
organize the data in your project into entities and define the relationships between
the entities.
£ This process has proved to enable the analyst to produce a good database structure
so that the data can be stored and retrieved in a most efficient manner.
INFORMATION
Entity
£ A data entity is anything real or abstract about which we want to store data.
£ Entity types fall into five classes: roles, events, locations, tangible things or
concepts. E.g. employee, payment, campus, book. Specific examples of an entity
are called instances. E.g. the employee John Jones, Mary Smith's payment, etc.
Relationship
£ A data relationship is a natural association that exists between one or more
entities. E.g. Employees process payments.
£ Cardinality defines the number of occurrences of one entity for a single
occurrence of the related entity. E.g. an employee may process many payments
but might not process any payments depending on the nature of her job.
Attribute
A SIMPLE EXAMPLE
A company has several departments. Each department has a supervisor and at least one
employee. Employees must be assigned to at least one, but possibly more departments. At
least one employee is assigned to a project, but an employee may be on vacation and not
assigned to any projects. The important data fields are the names of the departments,
projects, supervisors and employees, as well as the supervisor and employee number and
a unique project number.
1. Identify Entities
The entities in this system are Department, Employee, Supervisor and Project. One is
tempted to make Company an entity, but it is a false entity because it has only one
instance in this problem. True entities must have more than one instance.
2. Find Relationships
We construct the following Entity Relationship Matrix:
4. Fill in Cardinality
From the description of the problem we see that:
£ Each department has exactly one supervisor.
£ A supervisor is in charge of one and only one department.
£ Each department is assigned at least one employee.
£ Each employee works for at least one department.
£ Each project has at least one employee working on it.
£ An employee is assigned to 0 or more projects.
7. Identify Attributes
The only attributes indicated are the names of the departments, projects, supervisors and
employees, as well as the supervisor and employee NUMBER and a unique project
number.
8. Map Attributes
FURTHER DISCUSSION:
active verb at the intersection of two entities which are related. Each row and column
should have at least one relationship listed or else the entity associated with that row or
column does not interact with the rest of the system. In this case, you should question
whether it makes sense to include that entity in the system.
. A student is enrolled in one or more courses
Subject verb objects
The second symbol gives the maximum number of instances of the entity joining the
connector for each instance of the entity on the other side of the relationship. If there is
only one such instance, this symbol is 1. If more than 1, the symbol is a crows foot
opening towards the rectangle.
If you read it like a sentence, the first entity is the subject, the relationship is the verb, the
cardinality after the relationship tells how many direct objects (second entity) there are.
Fortunately, by introducing an extra entity, called an associative entity for each many-to-
many relationship, we can solve this problem. The new associative entity's name will be
the hyphenation of the names of the two originating entities. It will have a concatenated
key consisting of the keys of these two entities. It will have a 1-1 relationship with each
of its parent entities and each parent will have the same relationship with the associative
entity that they had with each other before we introduced the associative entity. The
original relationship between the parents will be deleted from the diagram.
The key-based ERD has no many-to-many relationships and each entity has its primary
and foreign keys listed below the entity name in its rectangle.