11.10.2013 Views

Design Patterns

Design Patterns

Design Patterns

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

ASSOCIATION CLASSES<br />

➠ Associations can also have attributes.<br />

➠ Reasonable, if the attributes cannot be assigned to any of the classes<br />

involved in the association.<br />

Writes<br />

Student Exam<br />

Writes<br />

mark<br />

GENERALIZATION/SPECIALIZATION<br />

➠ Classes correspond to types.<br />

➠ Subclasses correspond to subtypes, not subsets.<br />

➠ Specialization = ”is a” , but ”behaves as” , ”is a kind of”<br />

BachelorCourse MasterCourse<br />

subject<br />

13<br />

Course Personnel Student<br />

Constraint<br />

title<br />

name<br />

name<br />

pers.nr<br />

inscription_number<br />

salary<br />

{complete}<br />

specialization<br />

15<br />

Professor TeachingAssistent<br />

specialty<br />

AGGREGATION AND COMPOSITION<br />

are special associations.<br />

Room<br />

Wall<br />

The wall is a part of the room.<br />

If a part belongs to a whole and can only exist with that whole, then this is a<br />

composition relation.<br />

CONSTRAINTS<br />

Window<br />

Frame<br />

or<br />

➠ Are conditions that must hold.<br />

➠ Are written between “{}”.<br />

14<br />

Window<br />

Frame<br />

➠ The example: “{complete}” means that no other subclasses of Course<br />

can exist.<br />

➠ Meaning of constraints must be described informally.<br />

16

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

Saved successfully!

Ooh no, something went wrong!