UML Concepts



Association Class:
An association class is a class used to represent association relationship as a class. Usually, association class is formed when its classes share a many-to-one and many-to-many relationship and it has its own attributes and operations. Association class is depicted by dashed lines link to the class rectangle from the association path. Association class is simply a class attached to the association.



Object, Class, Method, Attribute, Super-class, Sub-class, Concrete-class, and Abstract Class:

# An object is an instance of a class.
# Classis a type of person, place or thing about which we will need to store the information. It is also defined as the collection similar objects stored together.
# Methodsrepresents the operations or functions that the class can perform.
# Attributesare properties of the class which describes the state of an object.
# A subclass is a class derived from another class that inherits properties from another class. The class from which the sub class is derived is super class.
# Abstract class is a class which cannot have its own instances and it is the class from which other classes are derived.
# Concrete class is a derived class that implements all the missing functionality or methods that are not implemented in abstract class.

Derived attribute in class diagram:
The attributes that can be calculated are called derived attributes. These attributes represented by placing slash (‘/’) before the name of the attribute.
Example 1: Age (‘/age’) of an employee class is derived attribute can be calculated by subtracting birth date from current date.
Example 2: Duration (‘/duration’) of the project time period class is a derived attribute which can be calculated as per start and end.
Example 3: Balance amount attribute (‘/balance’) of a bank account class is derived attribute which can be calculated by sum of entry amounts.

Visibility in class diagram:
Visibility is a level of information hiding or protection for the each attribute. There are three types of visibility are: Public(denoted as ‘+’), Private (denoted as ‘-’), Protected (denoted as ‘#’). A publicattribute is not hidden from other objects of a class and the other objects can alter the attribute value. A Protectedattribute is hidden from all other classes except its immediate class. A Private attribute is hidden from all other classes and it is usually default visibility for an attribute.

Aggregation with examples:
Aggregationassociation is relationship between two classes when an object of one class ‘is a part of’ object of another class. Aggregation describes a special type of an association. It is represented as hallow diamond on the class with line connects to the classes that serves as its parts.
Example 1: Engine, door and tire classes having ‘is a part of’ relation with car class.
Example 2: Chapter, Index classes are ‘part of’ book class.

Generalization with example:
Generalizationassociation is the properties of one class (sub class) acquired from properties of another class (super class). In generalization association, there is ‘a kind of’ relationship exist between the classes. It is depicted as hallow arrow pointing to the super class and its solid line connected to sub classes.
Example 1: Structural diagram (subclass 1) and behavioral diagram (subclass 2) class having ‘a kind of’ relationship with diagram class (super class).
Example 2: Student class and professor class having ‘a kind of’ relation with person class.

Association with example:
Associationrepresents the relationship between one or more classes. It is represented as direct link containing multiplicity symbols between the classes.
Example 1: A department has one or more employees.
Example 2: An employee has zero or many children.