What is UML?

In the field of Software Engineering, the UML or Unified Modeling Language is a standardized modeling language that contains a set of integrated diagrams, provides a standard way to visualize the design of a software system. It helps the software developers for specifying, visualizing, constructing, and documenting the artifacts of software systems.

The UML is different from the other programming language such as: Java, C#, C++, etc. It is a pictorials language which is used to make software blueprints. It represents the best engineering practices that have proven successful in the modeling of large and complex system. Usually UML is used to model software system, but it can be used in non-software system such as: the process flow in manufacturing unit.

Directly, the UML is not a programming language, but various tools offer facilities to generate code in various language. It has a direct relation with object oriented analysis and design (OOAD). It provides an important role in the development of object oriented software system.

History of UML
Object Management Group (OMG) creates the UML. The specification draft of UML 1.0 proposed to OMG in January 1997. The OMG is continuously working for the development of UML. The UML 2.5 was released in October 2012.

Types of UML Diagrams
By using UML we can visualize a software program. It uses a collection of diagrams. The UML 2.0 defines 13 types of diagrams and they are divided into 3 categories.

  • Structure Diagrams:
    It represents the static structure of the applications.
    Class Diagram, Object Diagram, Component Diagram, Composite Structure Diagram, Package Diagram, Deployment Diagram
  • Behavior Diagrams:
    It represents the static structure of the applications.
    Use Case Diagram, Activity Diagram, State Machine Diagram.
  • Interaction Diagrams:
    It represents the different aspects of interactions.
    Sequence Diagram, Communication Diagram, Timing Diagram, Interaction Overview Diagram

What is a Class Diagram?
In software engineering, Class diagram is a kind of structure diagram that describes the static structure of a software system. It shows the system’s classes, their attributes, methods (operations), and the relationships among objects. It is the backbone of almost every object oriented method including UML. It is widely used in object oriented system. The purpose of class diagram is to model the static view of any system. Only this diagram can be directly mapped with object oriented language.

How to Draw a Class Diagram?
While drawing a class diagram we should consider some things. The name of a class diagram should be meaningful so that anybody can understand the system. Every element and their relationships should be cleared. All the attributes and methods of each class should be clearly identified. Unnecessary attributes should be removed. Use proper notes if required so that the diagram should be understandable by the developers. Class diagrams are represented by a box that contain 3 components.

  • The top component is the class name. It is bold, center aligned and the first letter is capitalized.
  • The middle component contains the attributes of the class. All are left aligned and first letter is lowercase.
  • The bottom component contains all the methods or operations of the class. They are left aligned and first letter is lowercase.

We can specify the visibility of a class member (attribute, method) by using access modifiers. This modifiers must be placed before the class member’s name. The access modifiers with corresponding symbols are given bellow:

  • Public (+)
  • Private (-)
  • Protected (#)
  • Package (~)
  • Derived (/)
  • Static (underlined)

We can make a relationship between the class diagrams. UML offers the following types of relationships:
class diagram
A sample class diagram example is given bellow. Here Student is the class name, “id” and “name” is the attributes of the class, “savedata()” is the method of the class. The attributes “id” and “name” is public, method “savedata()” is private.
class diagram

Leave a Reply

Your email address will not be published. Required fields are marked *