6+-+Entity+Relationship+Diagrams

System Modeling II – Entity Relationship Diagrams (Yourdon 12) I.   ** Entity-Relationship Diagrams ** -is the network model that describes stored data layout of a system at high level of abstraction. It will answer the questions for Presidents, Vice-President and Managers in an Organization.  ·   What data do we need to run our Business?  ·   How are the data related to other data?  ·   Who owns the data?  ·   Who is allowed to access the data? II. The Components of an ERD a.   ** Object Types (Entity) ** - Each object can be indentified uniquely in some fashion. A good example of this would be each store has its own CUSTOMERS. By using Object Types (Attributes) we are able to distinguish CUSTOMERS by their Account Number, Last Name or by Social Security Number. ** Relationship Cardinality- ** Number of times an entity is related to another entity. ** 1:1 ** One to One **(**One customer can purchase one item) ** 1: M ** One to Many (One customer can purchase many items) ** M: N ** Many to Many (Many customers can purchase many items) **Relationship Modality-** Minimum number of times an entity is related to      another entity. ** ZERO- ** Optional (doesn’t have to happen in order for the entity to exist) ** ONE- ** Required (has to happen for the entity to exist) ** Example: ** We can have employees that are paid by hour or salaried employee. a.    The first model of the objects types and relationships are often from i.    The understanding of the user’s application ii. Interviews with the users iii. Other research and information gathering b.    The first model will most likely not be your final model. The model should be revised throughout the process due to changing information, guidelines, and object types. Although, through your knowledge of the user’s business and initial interviews, you should have a strong basic model. c.    Adding Additional Object Types i.    After the first model is developed the assign the data elements to the object types. The data elements can be found if: 1.    The data flow diagram has been/is being developed 2.    Interviewing the user’s to develop a list of data elements (This is not suggested due to the time consuming effort and frustration associated with work from the bottom-up) 3.    A data dictionary ii. Reasons for creating new object types 1.    Data elements are assigned to some instances, but do not fit into others a.    this exists when a data element __ cannot __ be assigned to a object type, not to be confused with a data element that doesn’t apply b.   ** Example ** : Let’s say we have an Employee as the object type and our data elements are name, age, and (for lack of a better example) number of pregnancies. Now we know that the number of pregnancies, as a data element, would not be assigned to all employees. It could only apply to female employees. Some employees are male; therefore, they do not get pregnant so the object type number-of-pregnancies could not apply. c.   ** Solution ** : create a subtype and assign the appropriate data elements 2.    Data elements are about to be assigned to two or more object types a.   ** Example ** : We have Cash-Customers and Credit-Customers as two different object types, but many of the data elements are attributed to both of the object types b.   ** Solution ** : Create a supertype   Figure 12.9: Creation of a new supertype/subtype object; source:    3.  Data elements describe relationships between other object types  a.    **Example **: Customer and Item are two object types, and purchases describes the relationship. It is later discovered that there is a date-of-purchase data element that can be attributed to purchases.  b.    **Solution **<span style="FONT-SIZE: 12pt; COLOR: black; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE">: Make Purchases a object type <span style="FONT-SIZE: 12.5pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE"> <span style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE">Figure 12.10(a): Initial E-R diagram; source: <span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE"> <span style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE"> <span style="FONT-SIZE: 12.5pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"> <span style="FONT-SIZE: 12.5pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE"> <span style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE">Figure 12.10(b): Replacing a relationship with an associative object type; source: <span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE"> <span style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; mso-bidi-language: HE"> Here are some web sites that might be helpful: http://en.wikipedia.org/wiki/Entity-relationship_model http://www.infocom.cqu.edu.au/Courses/spr2000/95169/Extra_Examples/ERD.htm http://www.youtube.com/watch?v=q1GaaGHHAqM Resouces: Yourdon, Ed. "Entity-Relationship Diagrams." __Structured Analysis Wiki__. 18 Sept. 2008 <http://yourdon.com/strucanalysis/wiki/index.php?title=Chapter_12>.
 * b.   ** ** Relationship ** - Each instance of the relationship represents an association between zero or more occurrences of one object and zero or more occurrences of the other object.
 * Example:  **
 * c.   ** ** Associative Object Type Indicators- ** This represents something that functions both as an object //and// a relationship. It represents //a relationship about which we wish to maintain some information//. Customer can purchase many items.
 * d.   ****  Subtype/Supertype Indicators-  **<span style="FONT-SIZE: 12.5pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'"> The  subtype/supertype object types consist of an object type and one or more subcategories, connected by a relationship.
 * III.   ****  Guidelines for Constructing Entity-Relationship Diagrams  **

Johnson, Richard. "Enitity Realtionship Diagrams." University at Albany. Albany, NY 22 Sept. 2008