Professional Documents
Culture Documents
UML - Basic Notations: Class Notation
UML - Basic Notations: Class Notation
UML - Basic Notations: Class Notation
UML is popular for its diagrammatic notations. We all know that UML is for visualizing,
specifying, constructing and documenting the components of software and non software
systems. The list is;
Classes
object
Interface
Collaboration
Use case
Active classes
Components
Nodes
Class notation:
Object notations:
eDAC-AUG2020 Batch
Interface Notation:
Collaboration Notation:
Relationships
A model is not complete unless the relationships between elements are described
properly. The Relationship gives a proper meaning to an UML model. Following are the
different types of relationships available in UML.
1. Dependency
2. Association
3. Generalization
4. Extensibility
Dependency Notation:
eDAC-AUG2020 Batch
Association Notation:
Association is a relationship between two objects. In other words, association defines the
multiplicity between objects. You may be aware of one-to-one, one-to-many, many-to-one,
many-to-many all these words define an association between objects. Aggregation is a special
form of association. Composition is a special form of aggregation.
eDAC-AUG2020 Batch
Generalization Notation:
Extensibility Notation:
Stereotypes (Represents new elements)
Tagged values (Represents new attributes)
Constraints (Represents the boundaries)
eDAC-AUG2020 Batch
Generalization, Specialization, and Inheritance:
Constraints:
A constraint is a packageable element which represents some condition, restriction or
assertion related to some element (that owns the constraint) or several elements. Constraints
are commonly used for various elements on class diagrams.
Comments:
eDAC-AUG2020 Batch
Compare Aggregation Association & Composition:
Association is a relationship where all objects have their own lifecycle and there is no owner.
Let's take an example of Teacher and Student. Multiple students can associate with
single teacher and single student can associate with multiple teachers, but there is no
ownership between the objects and both have their own lifecycle. Both can be created
and deleted independently.
Aggregation is a specialised form of Association where all objects have their own lifecycle,
but there is ownership and child objects can not belong to another parent object.
Let's take an example of Department and teacher. A single teacher can not belong to
multiple departments, but if we delete the department, the teacher object will not be
destroyed. We can think about it as a “has-a” relationship.
Composition is again specialised form of Aggregation and we can call this as a “death”
relationship. It is a strong type of Aggregation. Child object does not have its lifecycle and if
parent object is deleted, all child objects will also be deleted.
Let's take again an example of relationship between House and Rooms. House can
contain multiple rooms - there is no independent life of room and any room can not
belong to two different houses. If we delete the house - room will automatically be
deleted.
eDAC-AUG2020 Batch
Relationship Reading:
A Class can be instantiated but an Interface cannot be instantiated You can create an instance
of an Object that implements the Interface. A Class is a full body entity with members,
methods along with their definition and implementation.
eDAC-AUG2020 Batch