01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

126<br />

Saturday Afternoon<br />

Dog<br />

Discriminator<br />

Breed<br />

Collie Spaniel Setter<br />

Discriminator<br />

Sub-breed<br />

English Springer<br />

Spaniel<br />

Dwarf<br />

Spaniel<br />

Japanese<br />

Spaniel<br />

Cocker<br />

Spaniel<br />

Figure 11-9<br />

Step 4: Further specialization — subclassing a subclass<br />

REVIEW<br />

Associations identify the fact that types of objects can work together. Two specialized forms<br />

of association, aggregation and composition, tighten the rules about how the objects work<br />

together.<br />

Aggregation models assemblies or configurations of objects. You identify an aggregation<br />

association with a hollow diamond on the end of the association.<br />

Composition is a form of aggregation. Composition says that the member objects<br />

may not exist outside of the assembly. You identify a composition association with<br />

a solid diamond on the end of the association.<br />

Generalization is not a form of association. It is often called the “is a” relationship.<br />

Generalization allows you to break apart a class definition according to the similarities<br />

and differences in the objects that the class represents. You identify an inheritance<br />

or generalization relationship with a hollow triangle at the superclass end of<br />

the relationship.<br />

A superclass contains shared properties, common to many types of objects within<br />

the same class. A subclass contains only the properties unique to one type of object<br />

within the class.<br />

Abstract classes cannot create objects because their definition is missing a method<br />

for at least one operation. Concrete classes can create objects because they have<br />

access to a method for every operation.<br />

The discriminator describes the attribute(s) or rule that you used to choose the subclasses.<br />

You place the discriminator on the relationship line between the superclass<br />

and the subclasses.

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

Saved successfully!

Ooh no, something went wrong!