UML CLASS DIAGRAM

UML Class Diagram
The class diagram depicts a static view of an application.
A class consists of its objects, and also it may inherit from other classes.
A class diagram is used to visualize, describe, document various different aspects of the system, and also construct executable software code.
 It constitutes class names, attributes, and functions in a separate compartment that helps in software development.
Purpose of Class Diagrams
The main purpose of class diagrams is to build a static view of an application. 
1. It analyses and designs a static view of an application.
2. It describes the major responsibilities of a system.
3. It is a base for component and deployment diagrams.
4. It incorporates forward and reverse engineering.
Vital components of a Class Diagram
The class diagram is made up of three sections:
o Upper Section: The upper section encompasses the name of the class. A class is a representation of similar objects that shares the same relationships, attributes, operations, and semantics. Some of the following rules that should be taken into account while representing a class are given below:
1. Capitalize the initial letter of the class name.
2. Place the class name in the center of the upper section.
3. A class name must be written in bold format.
4. The name of the abstract class should be written in italics format.
o Middle Section: The middle section constitutes the attributes, which describe the quality of the class. The attributes have the following characteristics:
1. The attributes are written along with its visibility factors, which are public (+), private (-), protected (#), and package (~).
2. The accessibility of an attribute class is illustrated by the visibility factors.
3. A meaningful name should be assigned to the attribute, which will explain its usage inside the class.
o Lower Section: The lower section contain methods or operations. The methods are represented in the form of a list, where each method is written in a single line. It demonstrates how a class interacts with data.

Comments