You are on page 1of 2

An important part of each pattern's description is a Unified Modeling Language (UML)

class diagram. UML is a universally accepted way of describing software in diagrammatic


form. The diagrams in the book make use of the UML features itemized in .
Table : UML class diagram notation
Program
element Diagram element Meaning
Class Types and parameters specified
when important; access indicated by
+ (public), (private), and #
(protected).

Interface Name starts with I. Also used for


abstract classes.

Note Any descriptive text.

Package Grouping of classes and interfaces.


Inheritance B inherits from A.

Realization B implements A.

Association A and B call and access each other's


elements.

Association A can call and access B's elements,


(one way) but not vice versa.

Aggregation A has a B, and B can outlive A.

Composition A has a B, and B depends on A.

There are three kinds of blocks, for classes, interfaces/abstract classes, and packages.
The class is the most common diagram element and contains details of some of its
corresponding C# class's more important attributes (or fields) and operations (or
methods). A UML diagram is not meant to be an exact copy of a program, and thus only
the elements that are important to the pattern under consideration are shown. The
accessibility of all attributes and operations (private, public, or protected) is indicated.
The default for attributes is private and for operations is public. Deviations from the
defaults will be highlighted as they occur.
The types associated with attributes and operations are not usually given. However, when
these are important, they can be inserted after the identifier, separated by a colon. The
same relaxed approach applies to parameters of methods, which are not usually shown in
a diagram.

You might also like