One of the most common mistakes people make when they begin data modeling is confusing data models with data flows.
A data flow shows how data are handled within an organization, including
who handles the data,
where the data are stored, and
what is done to the data.
In contrast, a data model depicts the internal, logical relationships between the data, without regard to who is handling the data or what is being done with it.
Data flows are often documented in data flow diagrams (DFDs). For example, Figure 4-7 shows a top-level data flow diagram for Distributed Networks. The squares with drop shadows represent the people who are handling the data. Simple rectangles with numbers in them represent processes, or things that are done with the data. A place where data are stored (a data store) appears as two parallel lines, in this example containing the words "Main database." The arrows on the lines show the direction in which data pass from one place to another.
Data flow diagrams are often exploded to show more detail.
For example, Figure 4-8 contains an explosion of the "Take order" process from Figure 4-7. You can now see that the process of taking an order involves two major steps: getting customer information and getting item information.
Expand Process for further Detail
Each of the processes in Figure 4-8 can be expanded even further to show additional detail.
At this point, the diagrams are almost detailed enough so that an application designer can plan an application program. Question: Where do the database and the ER diagram fit into all of this?
The entire ER diagram is buried inside the "Main database".
In fact, most CASE software allows you to link your ER diagram to a database's representation on a data flow diagram.
Then, you can simply doubleclick on the database representation to the ER diagram into view.There are a few guidelines for keeping data flows and data models separate:
A data flow shows who uses or handles data. A data model does not show which data are transformed.
A data flow shows how data are gathered (the people or other sources from which they come), while a data model does not.
A data flow shows operations on data (the process through which data are transformed). A data model does not.
A data model shows how entities are interrelated. A data flow does not.
A data model shows the attributes that describe data entities.A data flow does not.
The bottom line is this: A data model contains information about the data being stored in the database (entities, attributes, and entity relationships). If data about an entity are not going to be stored in the database, then that entity should not be part of the data model. For example, although the DistributedNetworks data flow diagram shows the employee who handles most of the data, no data about employees are going to be stored in the database. Therefore, there is no employee entity in the ER diagram.