18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

COMMUNITY<br />

F.MASONS<br />

L.MASONS<br />

N.MASONS<br />

F.BOY.SCOUTS<br />

L.BOY.SCOUTS<br />

N.BOY.SCOUTS<br />

Figure 4-3. Automatically-defined Attributes of COMMUNITY Entities<br />

The attributes starting with F. are set pointers that point to the first member of the respective sets.<br />

The attributes starting with L. are set pointers that point to the last member of the respective sets.<br />

The set members, as we shall see, point to one another, defining their interrelationships and making<br />

the connection between the set owner and the set members complete. The attributes starting with<br />

N. maintain the number of entities in each set.<br />

The second statement declares that each entity of the class MAN may belong to sets called MASONS<br />

and BOY.SCOUTS. It is important to note that membership is declared as possible in this statement,<br />

but not mandatory. This statement automatically defines the set attributes shown in figure 4-4 for<br />

member entities.<br />

MAN<br />

P.MASONS<br />

S.MASONS<br />

M.MASONS<br />

P.BOY.SCOUTS<br />

S.BOY.SCOUTS<br />

M.BOY.SCOUTS<br />

Figure 4-4. Automatically-defined Attributes for Members of the Class MAN<br />

The attributes starting with P. are set pointers pointing to the predecessor entity in the indicated set.<br />

Those starting with S. are set pointers pointing to the successor entity in the indicated set, and those<br />

starting with M. indicate whether an entity is currently a member of the set. The concepts of predecessor<br />

and successor, as well as first and last, can be best explained by an illustration. In figure<br />

4-5 the entity COMMUNITY owns one set called MASONS. The members of the set are entities of the<br />

class MAN. The entity-set relationships are defined by the statements:<br />

140

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

Saved successfully!

Ooh no, something went wrong!