16.11.2012 Views

this pdf excerpt

this pdf excerpt

this pdf excerpt

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

..itionship<br />

..i..ler the<br />

'utc called<br />

: for each<br />

hich that<br />

' :et of all<br />

','c did in<br />

rt lor tne<br />

.rn attribtriamuls<br />

tor each<br />

partment.<br />

'EE entity<br />

,ployee of<br />

Jrc repre-<br />

"dl<br />

3.4 Relationship Types, Relationship Sets, Roles, and Structural Constraints<br />

Role Names and Recursive Relationships. Each entity type that participates in<br />

.r relationship type plays a particular role in the relationship. The role name signi-<br />

:lcs the role that a participating entity ti-om the entity tvpe plirvs in each relationship<br />

:nstance, and helps to explain what the relationsl-rip means. For exanrple, in the<br />

WORKS-FOR relationship type, EMPLOYEE plays the role of entployee or worker and<br />

DEPARTMENT plays the role of departrnent or employer.<br />

I{ole names are not technically necessary in relationshipr types rvhere all the participrting<br />

entity types are distinct, since each participating entity type name can be<br />

r.is!'d as the role name. However, in some cases the -srinle entity type participates<br />

;rrcrre than once in a relationship type in diJlbrent role,-s. In such cases the role name<br />

[..'comes essential for distinguishing the meaning of each participation. Such relarionship<br />

types are called recursive relationships. Figure 3.11 shows an example.<br />

I'he SUPERVISION relationship type relates an emplo,vee to a supervisor, where<br />

iroth ernployee and supervisor entities are members o[ the same EMPLOYEE entity<br />

rr'1re. |lgr.., the EMPLOYEE entitv rvpe pnrticipofes fh,ice in SUPERVISION: once in<br />

thr'role of supervisor'(or boss), and once in the role oI supervisee (or subordinate).<br />

F.rcl-r relationship instance r' in SUPERVISION associates two employee entities er<br />

.rnd e1, one of which plays the role of supervisor and the other the role of supervisee.<br />

I n Figure 3. I 1, the lines marked ' 1 ' represent the supervisor role, and those marked<br />

I' reprresent the supervisee role; hence, c, supervises e, and e-,, eo supervises cn and<br />

,' , irDd eo supervises e I and eo. ln <strong>this</strong> example, each relationship instirnce must have<br />

trlo lines, one marked with'1'(supervisory) and the other with'2'(supervisee).<br />

EMPLOYEE SUPERVISION Figure 3.11<br />

A recursive relationship<br />

SUPERVISION<br />

between EIVPLOYEE<br />

in the supervisor role<br />

(1) and EN/PLOYEE<br />

ln lhe subordinate<br />

role (2).

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

Saved successfully!

Ooh no, something went wrong!