2. Unified Modeling Language
UML is a standard language for specifying, visualizing,
constructing and documenting the artifacts of software
systems.
UML was created by Object Management Group (OMG).
UML provides an overview of the most important
diagrams used in the visual modeling of computing
programs.
www.advanced.edu.in
3. Features of UML
1. UML visually showing the overall architecture of the
system.
2. UML showing the same system from different points of
view (abstraction).
3. A standard graphical set of shapes representing generic
objects within a system.
4. A way of defining functions / methods that can change
the state of each object.
5. A way of showing how the objects interact with one
another.
6. Making it possible to generate code directly from an
UML diagram.
www.advanced.edu.in
4. Class Diagram
The class diagram shows a collection of classes, interfaces,
associations, collaborations and constraints. It is also known
as a structural diagram.
Class Diagram includes:
Analysis and design of the static view of an application.
Describe responsibilities of a system.
Base for component and deployment diagrams.
Forward and reverse engineering.
www.advanced.edu.in
5. Class Diagram
A Class Diagram is a diagram describing the structure of a
system
shows the system's
classes
Attributes(Status)
operations (or methods),(Behavior)
Relationships among the classes.
Associations
Generalization
Realization
Dependency
www.advanced.edu.in
6. Class
A Class Diagram is a diagram describing the structure of
a system
Class NameClass Name
attributesattributes
operationsoperations
The name of the class is the only required
tag in the graphical representation of a
class. It always appears in the top-most
compartment.
An attribute is a named property of a
class that describes the object being modeled.
In the class diagram, attributes appear in
the second compartment just below the
name-compartment.
www.advanced.edu.in
7. Class Operations
person
name :
String
address :
Address
birth date :
Eat ()
Sleep ()
Play ()
Work ()
Operations describe the class behavior
and appear in the third compartment.
Attributes and operations may
have their visibility marked:
"+" for public
"#" for protected
"−" for private
"~" for package
www.advanced.edu.in
8. Associations
An association between two classes indicates that objects at one end
of an association “recognize” objects at the other end and may send
messages to them.
Example: “A Faculty works for an Institution”
Faculty Institution
www.advanced.edu.in
9. Associations (cont.)
•To clarify its meaning, an association may be
named.
•The name is represented as a label placed
midway along the association line.
•A role is an end of an association where it
connects to a class.
•May be named to indicate the role played by the
class attached to the end of the association path.
www.advanced.edu.in
10. Associations (cont.)
Multiplicity
The number of objects that participate in the association.
Indicates whether or not an association is mandatory.
Exactly one 1
Zero or more (unlimited) * (0..*)
One or more 1..*
Zero or one (optional association) 0..1
Specified range 2..4
Multiple, disjoint ranges 2, 4..6, 8
Multiplicity Indicators
www.advanced.edu.in
11. Aggregation (Shared Association)
In cases where there’s a part-of relationship between ClassA
(whole) and ClassB (part), we can be more specific and use the
aggregation link instead of the association link, taking special
notice that ClassB can also be aggregated by other classes in the
application (therefore aggregation is also known as shared
association).
www.advanced.edu.in
13. Composition (Not-Shared Association)
A strong form of aggregation
•The whole is the sole owner of its part.
•The part object may belong to only one whole
•Multiplicity on the whole side must be zero or one.
•The life time of the part is dependent upon the whole.
•The composite must manage the creation and destruction of
its parts.
www.advanced.edu.in
15. Generalization
A sub-class inherits from its super-class
Attributes
Operations
Relationships
A sub-class may
Add attributes and operations
Add relationships
Refine (override) inherited operations
A generalization relationship may not be used to
model interface implementation.
www.advanced.edu.in
16. Generalization
A generalization is a binary taxonomic (i.e. related to
classification) directed relationship between a more general
classifier(super class) and a more specific classifier (subclass).
A generalization is shown as a line with a hollow triangle as an
arrowhead between the symbols representing the involved
classifiers. The arrowhead points to the symbol representing the
general classifier. This notation is referred to as the "separate
target style."
www.advanced.edu.in