Professional Documents
Culture Documents
• Visualization.
• Reduction of complexity.
• Class:
• A class describes a group of objects with the same properties
(attributes), behavior (operations), kinds of relationships, and
semantics.
Pqr : Person
: Person
• UML symbol for class is a box, • UML symbol for object is a box with an
list the class name in boldface, object name followed by a colon
center the name in the box, and followed by the class name. List the class
capitalize the first letter. name and object name in boldface,
center the name in the box, and
capitalize the first letter.
• Do not confuse internal identifiers with real world attributes. Internal identifiers
are purely an implementation convenience and have no application meaning.
• But Tax payer number, license plate number, and telephone number are not
internal identifiers because they have meaning in the real world. They are
legitimate attributes.
• The attribute and operation compartment are optional; we may or may not show them.
• A missing attribute compartment means that attributes are unspecified.
• Similarly, A missing operation compartment means that operations are unspecified.
• An empty compartment means that the attributes (or operations) are specified and that
there are none.
Joe : Person
name = “Joe”
Alice:Person
name “Alice” IBM:Company
Sue:Person Name = “IBM”
name “Sue”
Venkatesh Bhat, Dept. of CSE,
Tuesday, December 7, 2021 19
NMAMIT, Nitte
UML Notation for links and association
• UML Notation for link is a line between objects; a line may consist of several line
segments. If the link has a name, it is underlined. Example:
John Owns the stocks in GE Company.
• An association connects related classes and is also denoted by a line (multiple
line segments may be possible).
• Show both link and association names in italics.
• Arrange the classes in an association to read from left–to–right, if possible.
• When there are multiple associations between the same classes, we must use
association names or association end names to resolve the ambiguity.
• Associations are bi directional. But the name of the binary association reads in a
particular direction, but the binary association can be traversed in either
direction. For example: “WorksFor” connects person to company. The inverse of
“WorksFor” could be “Employs”, and it connects a company to a person.
• A “reference” is an attribute in one object that refers to another object.
employee employer
Person * 0 .. 1 Company
WorksFor
User Directory
authorisedUser * * * contents
• Association end names are necessary for association between two objects
of the same class. They can also distinguish multiple associations between
a pair of classes.
PerformanceRating
User * * Workstation
Authorization
priority homeDirecory
privileges 1
Directory
*
startSession
1 *
accountNumber
Venkatesh Bhat, Dept. of CSE,
Tuesday, December 7, 2021 35
NMAMIT, Nitte
Generalization and Inheritance
• Definition of Generalization: Generalization is the
relationship between a class (the super class) and one or
more variations of class (the sub classes).
• Generalization organizes classes by their similarities and
differences, structuring the description of objects. The
super class holds common attributes, operations and
associations. Each sub class is said to inherit the features
of its super class.
• Generalization is called the “is–a” relationship, because
each instance of a sub class is an instance of super class.
• Simple Generalization organizes classes into a hierarchy;
(single sub class has a single immediate super class).
Venkatesh Bhat, Dept. of CSE,
Tuesday, December 7, 2021 36
NMAMIT, Nitte
UML notation for Generalization
• A large hollow arrow head points to the super
class. Super class is on top, and sub classes on
bottom. Curly bracket denotes UML Comment.
• Instance of a subclass is simultaneously an
instance of all its ancestor classes.
• Example: Refer figure in Page#38 and # 39.