Professional Documents
Culture Documents
COM
The operations
compartment holds
the methods of the
class.
1
CLASS DIAGRAM CHEAT SHEET WWW.LEAKKA.COM
Visibility Levels
Purpose: control who can access the
attributes and the methods of our class
Public
A class method or
attribute marked as public
can be used by code
outside of the object
Example
The Person class has three attributes:
2
CLASS DIAGRAM CHEAT SHEET WWW.LEAKKA.COM
Relationships
Purpose: represent the relations and
the dependencies between the objects
Generalization
Composition
“is-a”
“part-of”
Represents that one element is Denotes ownership. When
based on another element. the owning object is
destroyed, the contained
objects get destroyed, too.
Association
Dependency
“interaction”
“references”
Used to visualize that the Indicates that one element
elements interact with/refer receives a reference to
to each other. another element (e.g. via a
method parameter).
Aggregation
Realization
“has-a”
“implements behavior”
Represents a part-whole Shows that a class
relationship. Parts don’t die implements the behavior
with the whole. specified by another model
element.
As your design evolves, you may want to be more specific about these
relationships, and start showing directed associations, aggregations,
compositions or dependencies.