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.

EXAMPLE<br />

Notation: UML Class Diagrams<br />

Professor Institute<br />

1 Leads 0..1<br />

name<br />

name<br />

specialty<br />

director<br />

0..2<br />

Gives<br />

*<br />

Course<br />

title<br />

4..6 Takes 3..*<br />

Student<br />

name<br />

participant inscription_number<br />

5<br />

mulitplicity reading direction<br />

7<br />

role<br />

association name<br />

OBJECT<br />

➠ Abstraction of a real thing, concept or issue.<br />

➠ Has a local state in the form of attributes.<br />

➠ Has a unique identity.<br />

➠ Has behavior defined by a set of operations.<br />

CLASS<br />

➠ Abstraction of a set of uniform objects.<br />

➠ Template for objects (instances).<br />

➠ Defines operations and attributes for its objects.<br />

➠ Corresponds to a type.<br />

DIFFERENT NOTATIONS FOR CLASSES<br />

or or<br />

Class Class Class<br />

a1: T1<br />

a2 : T2<br />

MEANING OF THE CLASS DIAGRAM<br />

6<br />

a1: T1<br />

a2 : T2<br />

➠ Each institute has exactly one professor who leads it.<br />

➠ This professor is called ”director”.<br />

➠ A professor leads at most one institute.<br />

➠ A professor can give course, but need not do so.<br />

op1(p: T1) : T2<br />

➠ Each course is given by at most two professors (also zero professors are<br />

possible).<br />

➠ A student takes four to six courses.<br />

➠ There, he is a “participant”.<br />

➠ A course has to be taken by at least three students.<br />

8

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

Saved successfully!

Ooh no, something went wrong!