UML Introduction

  1. UML (Unified Modeling Language) is a standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems.
  2. UML was created by the Object Management Group (OMG) and UML 1.0 specification draft was proposed to the OMG in January 1997.
  3. It was initially started to capture the behavior of complex software and non-software system and now it has become an OMG standard.
  4. UML is a pictorial language used to make software blueprints.
  5. A picture is worth a thousand words, this idiom absolutely fits describing UML.
  6. A conceptual model can be defined as a model which is made of concepts and their relationships.
  7. A conceptual model is the first step before drawing a UML diagram. It helps to understand the entities in the real world and how they interact with each other.
  8. The conceptual model of UML can be mastered by learning the following three major elements :
    • UML building blocks
    • Rules to connect the building blocks
    • Common mechanisms of UML

UML - Building Blocks

  1. The building blocks of UML can be defined as:
    • Things
    • Relationships
    • Diagrams

UML THINGS

  1. Things are the most important building blocks of UML. These can be divided into 4 types, Those are:
    • Structural
    • Behavioral
    • Grouping
    • Annotational

  1. Structural Things: Structural things define the static part of the model. They represent the physical and conceptual elements. This is again divided into 6 parts, those are:
    • Class - An object with defined attributes and operations. Class represents a set of objects having similar responsibilities.
    • Interface − Interface defines a set of operations, which specify the responsibility of a class. Externally visible behavior of that class.
    • Collaboration - Collaboration defines an interaction between elements.
    • Use case − Use case represents a set of actions performed by a system for a specific goal.
    • Component − Component describes the physical part of a system. A physical and replaceable part of a system that implements a number of interfaces.
    • Node − A node can be defined as a physical element that exists at run time and represents a resource.

  2. Behavioral Things: A behavioral thing consists of the dynamic parts of UML models. This is again divided into 2 parts, those are:
    • Interaction - Interaction is defined as a behavior that consists of a group of messages exchanged among elements to accomplish a specific task.
    • State machine- State machine is useful when the state of an object in its life cycle is important. It defines the sequence of states an object goes through in response to events. Events are external factors responsible for state change.

  3. Grouping Things: Grouping things can be defined as a mechanism to group elements of a UML model together. There is only one package available in UML.
    • Package - Package is the only one grouping thing available for gathering structural and behavioral things. A general purpose mechanism for organizing elements into groups.

  4. Annotational Things: Annotational things can be defined as a mechanism to capture remarks, descriptions, and comments of UML model elements.
    • Note - It is the only one Annotational thing available. A note is used to render comments, constraints, etc. of an UML element.

UML RELATIONSHIPS

  1. Relationship is another most important building block of UML. It shows how the elements are associated with each other and this association describes the functionality of an application.
  2. There are four kinds of relationships available.
    • Dependency
    • Association
    • Generalization
    • Realization

  1. Dependency: Dependency is a relationship between two things in which change in one element also affects the other. A semantic relationship in which a change on one thing (the independent thing) may cause changes in the other thing (the dependent thing).
  2. Association: Association is basically a set of links that connects the elements of a UML model. It also describes how many objects are taking part in that relationship.
  3. Generalization: Generalization can be defined as a relationship which connects a specialized element with a generalized element. It basically describes the inheritance relationship in the world of objects. Simply put this describes the relationship of a parent class (generalization) to its subclasses (specializations).
  4. Realization: Realization can be defined as a relationship in which two elements are connected. One element describes some responsibility, which is not implemented and the other one implements them. This relationship exists in case of interfaces.

UML Diagrams

  1. UML diagrams are the ultimate output of the entire discussion.
  2. All the elements, relationships are used to make a complete UML diagram and the diagram represents a system.
  3. The visual effect of the UML diagram is the most important part of the entire process. All the other elements are used to make it complete.
  4. The current UML standards call for 13 different types of diagrams: class, activity, object, use case, sequence, package, state, component, communication, composite structure, interaction overview, timing, and deployment.
  5. These diagrams are organized into two distinct groups: structural diagrams and behavioral or interaction diagrams.

  1. Structural UML diagrams:
    • Class diagram
    • Package diagram
    • Object diagram
    • Component diagram
    • Composite structure diagram
    • Deployment diagram
  2. Behavioral UML diagrams:
    • Activity diagram
    • Sequence diagram
    • Use case diagram
    • State diagram
    • Communication structure diagram
    • Interaction overview diagram
    • Timing diagram