Rules for Data Flow Diagrams (DFDs)
A Data Flow Diagram (DFD) is a powerful analytical and documentation tool used in system analysis to represent how data moves through a system. To ensure clarity, consistency, and standardization, DFDs must follow a well-defined set of rules. Adhering to these rules helps analysts, designers, and stakeholders clearly understand system requirements and avoid misinterpretation.
Core Rules for Drawing DFDs
- There should be no black holes, gray holes, or miracles in a DFD.
- All processes, data flows, data stores, and external entities must be clearly labeled.
- Every data flow must be associated with a process; data cannot move independently.
- Direct data flows between two external entities, two data stores, or an entity and a data store are not allowed without a process in between.
These rules ensure that the DFD accurately reflects logical data movement and system functionality. Violations of these principles result in incomplete or misleading diagrams.
Common DFD Errors Explained
Miracle
A miracle occurs when a process produces outputs without receiving any inputs. Such a process is logically impossible because data cannot be generated from nothing.
Black Hole
A black hole exists when a process has inputs but no outputs. This indicates that data enters a process and disappears without explanation, which violates logical data processing principles.
Gray Hole
A gray hole appears when a process has inputs and outputs, but the inputs are insufficient to logically produce the outputs. This usually indicates missing data flows or incomplete process definition.
Illustrative Payroll Processing Example
To better understand correct and incorrect DFD practices, consider a payroll processing system with the following workflow:
- Employee work hours are recorded and stored in an employee time file.
- Salary details are retrieved from the employee master file.
- Gross pay is calculated using time and salary data.
- Deductions are applied to compute net pay.
- Payroll slips are printed for record-keeping and payment processing.
- Paychecks and payslip copies are distributed to employees.
In an incorrect DFD, data may flow directly between entities and data stores or processes may appear without proper inputs or outputs. A corrected DFD resolves these issues by introducing appropriate processes, correcting flow directions, and improving logical representation of payroll printing and record maintenance.
Best Practices for Clear DFD Documentation
When documenting DFDs, analysts often convert process names, data labels, and documentation into consistent formats for better readability. Tools such as a text case converter can help quickly standardize naming conventions when preparing technical documentation or system reports.
Entity Relationship Diagram (ERD)
An Entity Relationship Diagram (ERD) is a high-level conceptual data model used to represent the logical structure of a database. It provides a graphical notation to depict entities, their attributes, and the relationships between them. ERDs are essential in database design and play a critical role in translating real-world business requirements into structured data models.
By defining an enterprise schema, ERDs help designers understand data interactions, reduce redundancy, and ensure data integrity across systems.
Understanding ERD with a Business Example
Consider an organization that includes companies, departments, employees, heads of departments (HODs), and projects. The relationships may be defined as follows:
- A company hires one or more employees.
- An employee is assigned to only one department.
- A department may have multiple employees.
- An employee may work on multiple projects or none at a given time.
- Each project is headed by one HOD.
- A HOD may manage multiple projects or none.
These variations demonstrate that ERDs can be drawn from multiple perspectives depending on business rules and organizational structure.
ERD Example: Hotel Booking System
In a hotel booking system, multiple entities such as Room, User, Reservation, Session, and Log are defined. Each entity contains specific attributes and shares relationships for operational and reporting purposes.
For example, a Room ID connects room details with reservations, while a User ID links users to reservations, sessions, and activity logs. This relational structure ensures efficient access, security, and traceability within the system.
25.2 Entity
An entity is a real-world object or concept that exists independently and is distinguishable from other objects. Entities are described using attributes that define their properties.
Examples of entities include a person, department, company, event, project, or cost center.
Entity Set and Attributes
An entity set is a collection of similar entities that share the same attributes. All entities within an entity set have common characteristics.
- Each entity set has a unique identifying attribute (e.g., Employee ID).
- Attributes describe the properties of the entity.
Example: A bird is an entity, the class of birds is an entity set, and color is an attribute.
25.3 Value Sets (Domains)
Each attribute has a value set, also known as a domain, which defines the allowable range of values. Value sets help enforce data integrity and business rules.
For example, the age attribute of an employee may be restricted to values between 18 and 60.
Types of Attributes
- Single: Holds one value (e.g., age).
- Composite: Composed of multiple sub-values (e.g., address).
- Multi-valued: Can have multiple values (e.g., qualifications).
- Null: No applicable value (e.g., degree field for non-graduates).
- Derived: Obtained from another attribute (e.g., age derived from date of birth).
25.4 Relationships
A relationship represents an association between two or more entities. Relationships define how data objects interact within a system.
Types of Relationships
- One-to-One: One entity relates to one other entity.
- One-to-Many: One entity relates to multiple entities.
- Many-to-Many: Multiple entities relate to multiple entities.
Total and Partial Participation
Total participation occurs when all entities in an entity set must participate in a relationship. For example, every employee must belong to a department.
Partial participation occurs when only some entities participate in a relationship. For example, not all employees are required to work on a project at a given time.
Understanding DFD rules and ERD concepts together enables analysts and designers to build accurate, efficient, and scalable information systems that align closely with real-world business requirements.