Professional Documents
Culture Documents
Class Diagram
A graphic notation for modeling classes and
their relationships.
An Object Diagram shows individual objects
and their relationships.
Multiplicity
Multiplicity specifies the number of instances of
one class that may relate to a single instance of
an associated class.
Constraints the number of related objects.
UML diagrams specifies multiplicity at the end of
association lines.
1
exactly one
1..*
one or more
3..5
three to five(both inclusive)
Association Vs Link
Link- relationship between objects
Association- relationship between classes.
Association Class
An Association Class is an association that is
also a class.
Has attributes, operations and can participate
in associations.
Generalisation
Is the relationship between a class(superclass)
and one or more variations of the
class(subclass).
The superclass holds common attributes,
operations, and associations; the subclass add
specific attributes, operations, and
associations.
Is-a relationship because each instance os a
subclass is an instance of a superclass as well.
Multiple Inheritance
The ability of a class to inherit behaviors and
features from more than one super class.
Button
class
inherits
two
different
implementations of equals() while it has no own
implementation of the operation. When
button.equals() is called, it is unknown which
implementation- from Rectangle or from
Clickable- will be used.
Overriding Features
A subclass may override a superclass feature by
defining a feature with the same name.
The overriding feature(the subclass feature)
refines and replaces the overridden feature(the
superclass feature).
Override methods and default values of
attributes.
Never override the signature, or form, of a
feature i.e. an override should preserve attribute
type, number and type of arguments to an
operation and operation return type.
Visibility
Use visibility markers to signify who can access
the information contained within a class.
+
Public
Private
Protected