Data and Process Modeling

11/1/2011 Data and Process Modeling 1 END 213E Data Processing in Industrial Systems Başar Öztayşi 2011 Key Concepts • Data Model Diagramming Alt...
Author: Theresa Welch
1 downloads 2 Views 179KB Size
11/1/2011

Data and Process Modeling

1

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

Key Concepts • Data Model Diagramming Alternatives – Guidelines for Drawing ERDs

• Process Models • Unified Modeling Language – UML Class Diagrams – Other Oth UML Di Diagrams

• Relating Entities and Processes

2

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

1

11/1/2011

– ERD Formats • • • •

3

Chen’s Ch ’ Format F t The Relational Format Information Engineering Format The IDEF1X Format

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

• Most data models are diagrammed using the E tit Relationship Entity R l ti hi Diagram Di (ERD) (ERD). • An ERD is a diagram that visually represents entities, attributes, and relationships. • The chief advantage of ERDs is that they can be understood by nontechnical people while still providing great value to technical people.

4

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

2

11/1/2011

ERD Formats • First developed by Peter Chen in 1976. • Since Si then, h vendors, d computer scientists,and i i d academics have developed many variations, • Common elements of all ERD formats: – Entities are represented as rectangles or boxes. – Relationships are represented as lines. – Line Li ends d indicate i di the h maximum cardinality d l off the h relationship (that is, one or many). – Symbols near the line ends indicate the minimum cardinality of the – Attributes may be optionally included 5

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

ERD (Chen’s format) • Lines contain a diamond which describes the relationship. • For many-to-many many to many relationships that require an intersection table a rectangle is often drawn around the diamond. • Maximum cardinality of each relationship is shown using the symbol 1 for “one” or M for “many.” • Minimum cardinality is not shown. • Attributes, appear in ellipses p connected to the entity or relationship to which they belong with a line. 6

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

3

11/1/2011

ERD (Chen’s format) • The diamonds take up a lot of space on the di diagrams ffor th the littl little added dd d value l they th provide. • Any ERD that includes many attributes becomes very difficult to read.

END 213E Data Processing in Industrial Systems

7

Başar Öztayşi 2011

The Relational Format • Over time, an ERD format known generically as the th relational l ti l format f t evolved. l d • It is available as an option in several of the better-known data modeling software tools, including – – – – 8

PowerDesigner from Sybase Sybase, ERwin from Computer Associates, ER/Studio from Embarcadero Technologies, and Visio from Microsoft. END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

4

11/1/2011

The Relational Format • Relationship cardinality is shown with an arrowhead on the line end to signify “one” and nothing on the line end to signify “many.” • Attributes are shown inside the rectangle that represents each entity. • Unique identifier attributes are shown above a horizontal line within the rectangle and are usually also shown with “PK” (for primary key) • Attributes that are foreign keys are shown with “FK”. 9

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

Information Engineering Format • The most popular ERD type

10

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

5

11/1/2011

Information Engineering Format • Identifying relationships: Shown with a solid line are those for which the foreign key is part of the child entity entity’ss primary key. • Non-identifying relationships Shown with a dotted line are those for which the foreign key is a nonkey attribute in the child entity. • The relationship between PRODUCT and INVOICE LINE ITEM is identifying, INVOICE_LINE_ITEM identifying but the one between CUSTOMER and INVOICE is non-identifying.

11

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

Information Engineering Format • Maximum relationship cardinality Shown with a short perpendicular line across the relationship near its line end to signify “one” and with a “crow’s foot” on the line end to signify “many.” • Minimum relationship cardinality Shown with a small circle near the end of the line to signify “zero” (participation in the relationship is optional) or with a short perpendicular line across the relationship line to signify “one” one (participation in the relationship is mandatory). • Dependent entities Shown with the corners of the rectangle rounded, these entities have an existence dependency on one or more other entities 12

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

6

11/1/2011

Information Engineering Format • Cardinality Example: • A PRODUCT may have zero to many associated INVOICE_LINE_ITEM occurrences (shown as a circle and a crow’s foot); • An INVOICE_LINE_ITEM must have one and only one associated PRODUCT (shown as two vertical bars). • An INVOICE Must have one or more associated INVOICE LINE ITEM occurrences (shown INVOICE_LINE_ITEM (h as a vertical ti l bar b andd a crow’s foot);

• An INVOICE_LINE_ITEM must have one and only one associated INVOICE (shown as two vertical bars). 13

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

The IDEF1X Format • It is widely used and understood across the information technology industry and is the mandatory standard for many branches of the U.S. government

14

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

7

11/1/2011

The IDEF1X Format • A solid line indicates that the foreign key is part of the dependent entity entity’ss primary key, while a broken line indicates that the foreign key is a non key attribute. • A solid line indicates that the foreign key is part of the dependent entity’s primary key, while a broken line indicates that the foreign key is a non key attribute. • A solid circle next to an entity generally means zero, one, or more occurrences of that entity, entity • Absence of a solid circle at the end of the relationship line means that only one occurrence of the entity is involved.

15

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

Guidelines for Drawing ERDs • Do not try to relate every entity to every other entity. Entities should be related only when the entire primary key in one entity appears as a foreign key in another. • Except for subtypes, avoid relationships involving more than two entities. Although drawing fewer lines might seem simpler, simpler it is far too easy to misinterpret relationships drawn from one parent entity to multiple child entities by using a single line. • Be consistent with entity and attribute names. Develop a naming convention and stick with it. 16

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

8

11/1/2011

Guidelines for Drawing ERDs • Use abbreviations in names only when absolutely necessary and in those cases, necessary, cases use a standard list of abbreviations. • Name primary keys and foreign keys consistently. Most experts prefer that the foreign key have exactly the same name as the primary key. • When relationships are named named, strive for action words, avoiding non-descriptive terms such as “has,” “belongs to,” “is associated with,” and so on.

17

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

In Class Application Example 1 • a professor teaches zero, one or many classes and a class is taught by one professor • a course may generate zero, one or many classes and a class comes from one course • a class l is i held h ld in i one room but b t a room has h many classes

18

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

9

11/1/2011

19

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

• The many-to-many relationship between student t d t andd class l is i resolved. l d

20

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

10

11/1/2011

Example 2 1. an invoice is written by one salesrep but a salesrep l writes it many invoices i i 2. a vendor sells many products but a product is bought from one vendor 3. an invoice has one or many products and a product is found on zero, zero one or many invoices

21

END 213E Data Processing in Industrial Systems

Başar Öztayşi 2011

11