Unified Modeling Language (UML) is a type of static structure diagram that describes the
structure of a system by showing the system's:
• classes,
• their attributes,
• operations (or methods),
• and the relationships among objects.
1. Class Name
• The name of the class appears in the first partition.
2. Class Attributes
• Attributes are shown in the second partition.
• The attribute type is shown after the colon.
• Attributes map onto member variables (data members) in code.
3. Class Operations (Methods)
• Operations are shown in the third partition. They are services the class provides.
• The return type of a method is shown after the colon at the end of the method signature.
• The return type of method parameters is shown after the colon following the parameter name.
• Operations map onto class methods in code
Example
1. Association
2. Aggregation
3. Composition
4. Inheritance
5. Dependency
6. Multiplicity
An association is a relationship, where 2 components interact with each other in some way, but are not dependent or related
with each other.
• They are represented by a solid line between classes
• Component B has multiple components A. But when you delete component B, A still exists.
• It describes a part-of relationship. It is a binary association, i.e., it only involves two classes. It is a kind of relationship in
which the child is independent of its parent.
Composition represents a strong "has-a" relationship where the part cannot exist without the whole.
• A special type of aggregation where parts are destroyed when the whole is destroyed.
• Objects of Class2 live and die with Class1.
• Class2 cannot stand by itself.
A special type of association.
• Exists between two classes if changes to the definition of one may cause changes to the other (but not the other way
around).
• Class1 depends on Class2
• Denoted with a dashed line with an open arrow.
In the following example, Student_Name is dependent on the Student_Id.
Inheritance (or Generalization) represents an "is-a" relationship where one class (subclass) inherits the attributes and methods
of another class (superclass).
Example, Both the savings and the credit card account inherits the generalized properties from the Bank Account, which is
Account Number, Account Balance, etc.
It defines a specific range of allowable instances of attributes. In case if a range is not specified, one is considered as a default
multiplicity
How entities act upon each other or are associated with each other. Think of relationships as verbs. For example, the
named student might register for a course. The two entities would be the student and the course, and the relationship
depicted is the act of enrolling, connecting the two entities in that way. Relationships are typically shown as diamonds or
labels directly on the connecting lines
