Class diagram shows the static view of the application or system, it is used for visualizing, describing, documenting and constructing executable code of the software system. It is used in modeling of the object-oriented systems; it can be mapped directly with the object-oriented programming languages. The attributes and methods of the class and relationship between classes are shown. Class diagram forms basis of the component and deployment diagram.
Class diagram consists of classes and their relationships. Application is developed to serve user; application has features which users use; application is integration of different objects. Objects with similar features belong to same class. Classes of the application are figured about by analyzing the requirements of the users; the requirements of users from the application are collected during the requirement collection phase of software (application) development. One of the methods to find classes is noun phrase analysis of the requirements text collected from the users of the software.
In the class diagram, classes are represented by the rectangle with three parts: in the first (top) part, name of the class is written, in the second (middle) part, attributes of the class are written, in the third (bottom) part, methods of the class are written. The relationship or association between the classes are shown with a straight line. Role of the class in the relationship can be also shown. The multiplicity (like 1 to 1, 1 to many, many to many) between the classes are also show in the diagram; multiplicity defines the number of objects involved in the relationship between the objects.
There are three types of relationships that can exist between the classes: