next up previous contents index
Next: 4.2 The Class-Relationship Diagram Up: 4 Data View Editors Previous: 4 Data View Editors

Subsections

4.1 The Entity-Relationship Diagram Editor (TERD)

    

4.1.1 Nodes and Edges

See figure 4.1 for the subjects and the representing shapes that are used in TERD. In figure 4.2 you can see which node types can be connected by which edge types. The constraints of which node types can be connected by which edge types are immediately enforced. Note that function edges can be represented by two shape types, uni-directional (single) arrows and bidirectional (double) arrows. The latter denotes a one-one relationship. So, in figure 4.2 a single function arrow may also be a bidirectional arrow.


  
Figure 4.1: Entity-relationship diagram nodes and edges.
\begin{figure}
\begin{center}
\begin{tabular}
{\vert c p{1.3in}\vert c p{1.3in}\...
 ...tion & &\index{One-one function} \  \hline\end{tabular}\end{center}\end{figure}


  
Figure 4.2: Permitted Entity-relationship connections.
\begin{figure}
\begin{center}

\includegraphics {p/ERconnections.eps}\end{center}\end{figure}

4.1.2 Cardinality Constraints and Role Names

  Most edge types have a name label, which is shown as an L in figure 4.1. The default position of a name label is near the center of the middlemost segment of the edge. The middlemost segment is ``number of segments div 2''. When the label is first edited, the default position becomes the center of the segment where the line is selected for editing. When the line is not vertical, the name label is by default positioned at a fixed distance above the line, preventing that the label goes through the line and becomes unreadable. When the line is vertical, the label is positioned slightly to the left of the line, preventing that a short label goes through the line and becomes unreadable.   Some edge types like Binary relationships and Functions also have role names and/or cardinality constraints. See figure 4.3 for the default positions of the roles names (r1 and r2) and cardinality constraints (c1 and c2). These labels are editable just like the name labels. The role name r1 and the cardinality constraint c1 have their default positions near the middle of the first quarter of the first segment of the line. r2 and c2 have their default positions near the middle of the last quarter of the last segment of the line [*]. When the line is more or less horizontal, role names are positioned above the line and when the line is more or less vertical, role names are positioned at the left side of the line (just like the name label). Cardinality constraint labels are positioned at the side opposing the role name labels. See figure 3.2 for an example ER diagram with role names and cardinality constraints.

Remark: A binary relationship whose c2 cardinality constraint is 1, is equivalent to a function edge. The difference is that, instead of a 1, an arrow head is drawn. Nevertheless, TERD considers them as separate edge types.


  
Figure 4.3: Default label positions of a binary relationship edge.
\begin{figure}
\begin{center}

\includegraphics {p/defaultpositions.eps}\end{center}\end{figure}

TERD enforces immediately that cardinality constraints conform to the BNF syntax of figure 4.4. But TERD does not check if subranges are contradictory such as the constraints 1..0 and 2,>=3.

  
Figure 4.4: Cardinality constraint syntax.
\begin{figure}
\begin{center}

\framebox {\begin{math}
\begin{array}
{lll}
const...
 ...{\bf 8}\vert{\bf 9} \  \nonumber\end{array}\end{math} }\end{center}\end{figure}

4.1.3 Taxonomic Structures

      

A taxonomic relationship (also called specialization, generalization, inheritance or is-a hierarchy)  is constructed from a taxonomy junction node connected to an entity type by a single is-a relationship edge and connected to two or more other entity types by two or more empty edges. The entity type where the is-a relationship edge ends is the generalization (or supertype), the other entity types are specializations (or subtypes). See, for example, figure 4.5. If two entity types are is-a related then a single is-a relationship arrow can be drawn between them, but when an entity type is specialized into more than one different entity type then it is customary to draw one compound is-a relationship with a taxonomy junction.


  
Figure 4.5: Example taxonomic structure.
\begin{figure}
\begin{center}

\includegraphics {p/taxonomyexample.eps}
\end{center}\end{figure}

The Show Is-a Only toggle in the View menu of TERD shows the shapes which constitute the is-a hierarchy. When you turn it on, the shapes that are not part of the hierarchy are made invisible. When you turn it off, all shapes are made visible again. 

An is-a relationship has a built-in name label "is_a", an empty edge does not have a label. Taxonomy junctions should have one of the following labels : "", "d", "e" or "de". A "d" stands for disjunctive and an "e" stands for exhaustive. These constraints are immediately enforced.

4.1.4 Constraint Checking

In addition to the connection constraints, the syntax of cardinality constraints and the other graphical conventions that TERD enforces, TERD checks a lot of immediately enforced and soft constraints. These are summarized in figure 4.6.

Some of these constraints are enforced immediately during most but not all editor commands. If that is the case, they are additionally checked by Check Diagram as a soft constraint.

Note that the unique name constrains do not concern duplicate node shapes. This is one of the reasons for the existence of duplicate shapes.


  
Figure 4.6: Immediately checked and soft constraints on ERDs.
\begin{figure}
\begin{center}

\includegraphics {p/ERconstraints.eps}\end{center}\end{figure}


next up previous contents index
Next: 4.2 The Class-Relationship Diagram Up: 4 Data View Editors Previous: 4 Data View Editors
Frank Dehne,Faculty of Mathematics and Computer Science, Vrije Universiteit Amsterdam
11/17/1997