04.06.2015 Views

Database Modeling and Design

Database Modeling and Design

Database Modeling and Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

60 CHAPTER 4 Requirements Analysis <strong>and</strong> Conceptual Data <strong>Modeling</strong><br />

ship between Employee <strong>and</strong> City, then “lives-in” is not redundant,<br />

because the relationships are unrelated. However, consider the situation<br />

shown in Figure 4.1b for the ER model <strong>and</strong> Figure 4.1d for UML. The<br />

employee works on a project located in a city, so the “works-in” relationship<br />

between Employee <strong>and</strong> City is redundant <strong>and</strong> can be eliminated.<br />

Ternary Relationships<br />

Define ternary relationships carefully. We define a ternary relationship<br />

among three entities only when the concept cannot be represented by<br />

several binary relationships among those entities. For example, let us<br />

assume there is some association among entities Technician, Project,<br />

<strong>and</strong> Notebook. If each technician can be working on any of several<br />

projects <strong>and</strong> using the same notebooks on each project, then three<br />

many-to-many binary relationships can be defined (see Figure 4.2a for<br />

the ER model <strong>and</strong> Figure 4.2c for UML). If, however, each technician is<br />

Technician<br />

N<br />

uses<br />

Technician<br />

Project<br />

N<br />

works-on<br />

1 1<br />

usesnotebook<br />

N<br />

N<br />

Project<br />

N<br />

has<br />

N<br />

Notebook<br />

(a) Binary relationships<br />

Notebook<br />

(b) Different meaning using a<br />

ternary relationship<br />

1<br />

Technician<br />

*<br />

*<br />

works-on<br />

uses<br />

Technician<br />

uses-notebook<br />

* *<br />

Project<br />

*<br />

Project<br />

* *<br />

has<br />

*<br />

Notebook<br />

*<br />

Notebook<br />

(c) Binary associations<br />

(d) Different meaning using a ternary association<br />

Figure 4.2<br />

Ternary relationships

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!