0% found this document useful (0 votes)
7 views21 pages

UML Introduction

UML (Unified Modeling Language) is a standardized graphical modeling language used in software engineering to specify, visualize, construct, and document software artifacts. It encompasses various concepts such as objects, classes, and relationships, and includes different types of diagrams categorized into structural, behavioral, and interaction diagrams. UML aids in the design and analysis of software systems, particularly those utilizing object-oriented principles.

Uploaded by

ketandhadve95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views21 pages

UML Introduction

UML (Unified Modeling Language) is a standardized graphical modeling language used in software engineering to specify, visualize, construct, and document software artifacts. It encompasses various concepts such as objects, classes, and relationships, and includes different types of diagrams categorized into structural, behavioral, and interaction diagrams. UML aids in the design and analysis of software systems, particularly those utilizing object-oriented principles.

Uploaded by

ketandhadve95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

UML (Unified Modeling Language) is a general-purpose, graphical modeling

language in the field of Software Engineering. UML is used to specify, visualize,


construct, and document the artifacts (major elements) of the software system. It
was initially developed by Grady Booch, Ivar Jacobson, and James Rumbaugh in
1994-95 at Rational software, and its further development was carried out through
1996.

What is UML
The UML stands for Unified modeling language, is a standardized general-
purpose visual modeling language in the field of Software Engineering. It is
used for specifying, visualizing, constructing, and documenting the primary
artifacts of the software system. It helps in designing and characterizing,
especially those software systems that incorporate the concept of Object
orientation. It describes the working of both the software and hardware
systems.

Characteristics of UML
The UML has the following features:

o It is a generalized modeling language.


o It is distinct from other programming languages like C++, Python, etc.
o It is interrelated to object-oriented analysis and design.
o It is used to visualize the workflow of the system.
o It is a pictorial language, used to generate powerful modeling artifacts.
Conceptual Modeling
o Object: An object is a real world entity. There are many objects
present within a single system. It is a fundamental building block of
UML.
o Class: A class is a software blueprint for objects, which means that it
defines the variables and methods common to all the objects of a
particular type.
o Abstraction: Abstraction is the process of portraying the essential
characteristics of an object to the users while hiding the irrelevant
information. Basically, it is used to envision the functioning of an
object.
o Inheritance: Inheritance is the process of deriving a new class from
the existing ones.
o Polymorphism: It is a mechanism of representing objects having
multiple forms used for different purposes.
o Encapsulation: It binds the data and the object together as a single
unit, enabling tight coupling between them.

OO Analysis and Design


OO is an analysis of objects, and design means combining those identified
objects. So, the main purpose of OO analysis is identifying the objects for
designing a system. The analysis can also be done for an existing system.
The analysis can be more efficient if we can identify the objects. Once we
have identified the objects, their relationships are then identified, and the
design is also produced.

The purpose of OO is given below:

o To identify the objects of a system.


o To identify their relationships.
o To make a design that is executable when the concepts of OO are
employed.

UML-Building Blocks

Things-Anything that is a real world entity or object is termed as things. It


can be divided into several different categories:

o Structural things
o Behavioral things
o Grouping things
o Annotational things
Structural things
Nouns that depicts the static behavior of a model is termed as structural
things. They display the physical and conceptual components. They include
class, object, interface, node, collaboration, component, and a use case.

Class: A Class is a set of identical things that outlines the functionality and
properties of an object. It also represents the abstract class whose
functionalities are not defined. Its notation is as follows;

A class represent a concept which encapsulates state (attributes) and


behavior (operations). Each attribute has a type. Each operation has
a signature. The class name is the only mandatory information.

Class Visibility

The +, - and # symbols before an attribute and operation name in a class


denote the visibility of the attribute and operation.
 + denotes public attributes or operations
 - denotes private attributes or operations
 # denotes protected attributes or operations

Object:: An individual that describes the behavior and the functions of a


system. The notation of the object is similar to that of the class; the only
difference is that the object name is always underlined and its notation is
given below;

Interface: A set of operations that describes the functionality of a class,


which is implemented whenever an interface is implemented.

Collaboration: It represents the interaction between things that is done to


meet the goal. It is symbolized as a dotted ellipse with its name written
inside it.
Use case: Use case is the core concept of object-oriented modeling. It
portrays a set of actions executed by a system to achieve the goal.

Actor: It comes under the use case diagrams. It is an object that interacts
with the system, for example, a user.

Component: It represents the physical part of the system.

Node: A physical element that exists at run time.

Behavioral Things
They are the verbs that encompass the dynamic parts of a model. It depicts
the behavior of a system. They involve state machine, activity diagram,
interaction diagram, grouping things, annotation things

State Machine: It defines a sequence of states that an entity goes through


in the software development lifecycle. It keeps a record of several distinct
states of a system component.
Activity Diagram: It portrays all the activities accomplished by different
entities of a system. It is represented the same as that of a state machine
diagram. It consists of an initial state, final state, a decision box, and an
action notation.
Interaction Diagram: It is used to envision the flow of messages between
several components in a system.

Grouping Things
It is a method that together binds the elements of the UML model. In UML,
the package is the only thing, which is used for grouping.

Package: Package is the only thing that is available for grouping behavioral
and structural things.

Annotation Things
It is a mechanism that captures the remarks, descriptions, and comments of
UML model elements. In UML, a note is the only Annotational thing.

Note: It is used to attach the constraints, comments, and rules to the


elements of the model. It is a kind of yellow sticky note.
Relationships
It illustrates the meaningful connections between things. It shows the
association between the entities and defines the functionality of an
application. There are four types of relationships given below:

Dependency: Dependency is a kind of relationship in which a change in


target element affects the source element, or simply we can say the source
element is dependent on the target element. It is one of the most important
notations in UML. It depicts the dependency from one entity to another.

It is denoted by a dotted line followed by an arrow at one side as shown


below,

Association: A set of links that associates the entities to the UML model. It
tells how many elements are actually taking part in forming that relationship.

It is denoted by a dotted line with arrowheads on both sides to describe the


relationship with the element on both sides.

Generalization: It portrays the relationship between a general thing (a


parent class or superclass) and a specific kind of that thing (a child class or
subclass). It is used to describe the concept of inheritance.

It is denoted by a straight line followed by an empty arrowhead at one side.

Realization: It is a semantic kind of relationship between two things, where


one defines the behavior to be carried out, and the other one implements
the mentioned behavior. It exists in interfaces.

It is denoted by a dotted line with an empty arrowhead at one side.

A relationship can be one of the following types:


Diagrams
The diagrams are the graphical implementation of the models that
incorporate symbols and text. Each symbol has a different meaning in the
context of the UML diagram. There are thirteen different types of UML
diagrams that are available in UML 2.0, such that each diagram has its own
set of a symbol. And each diagram manifests a different dimension,
perspective, and view of the system.

UML diagrams are classified into three categories that are given below:

1. Structural Diagram
2. Behavioral Diagram
3. Interaction Diagram

Structural Diagram: It represents the static view of a system by portraying


the structure of a system. It shows several objects residing in the system.
Following are the structural diagrams given below:

o Class diagram
o Object diagram
o Package diagram
o Component diagram
o Deployment diagram

Behavioral Diagram: It depicts the behavioral features of a system. It deals


with dynamic parts of the system. It encompasses the following diagrams:

o Activity diagram
o State machine diagram
o Use case diagram

Interaction diagram: It is a subset of behavioral diagrams. It depicts the


interaction between two objects and the data flow between them. Following
are the several interaction diagrams in UML:

o Timing diagram
o Sequence diagram
o Collaboration diagram

UML- Architecture
Software architecture provides a basic design of a complete software system. It
defines the elements included in the system, the functions each element has, and
how each element relates to one another. In short, it is a big picture or overall
structure of the whole system, how everything works together.

It can be best understood as a collection of five views:

1. Use case view


2. Design view
3. Implementation view
4. Process view
5. Development view
Use case view
o It is a view that shows the functionality of the system as perceived by
external actors.
o It reveals the requirements of the system.
o With UML, it is easy to capture the static aspects of this view in the use case
diagrams, whereas it?s dynamic aspects are captured in interaction
diagrams, state chart diagrams, and activity diagrams.

Design View
o It is a view that shows how the functionality is designed inside the system in
terms of static structure and dynamic behavior.
o It captures the vocabulary of the problem space and solution space.
o With UML, it represents the static aspects of this view in class and object
diagrams, whereas its dynamic aspects are captured in interaction diagrams,
state chart diagrams, and activity diagrams.
Implementation View
o It is the view that represents the organization of the core components and
files.
o It primarily addresses the configuration management of the system?s
releases.
o With UML, its static aspects are expressed in component diagrams, and the
dynamic aspects are captured in interaction diagrams, state chart diagrams,
and activity diagrams.

Process View
o It is the view that demonstrates the concurrency of the system.
o It incorporates the threads and processes that make concurrent system and
synchronized mechanisms.
o It primarily addresses the system's scalability, throughput, and performance.
o Its static and dynamic aspects are expressed the same way as the design
view but focus more on the active classes that represent these threads and
processes.

Deployment View
o It is the view that shows the deployment of the system in terms of physical
architecture.
o It includes the nodes, which form the system hardware topology where the
system will be executed.
o It primarily addresses the distribution, delivery, and installation of the parts
that build the physical system.
1. Structural Diagrams
Structural diagrams depict a static view or structure of a system. It is widely
used in the documentation of software architecture. It embraces class
diagrams, composite structure diagrams, component diagrams, deployment
diagrams, object diagrams, and package diagrams. It presents an outline for
the system. It stresses the elements to be present that are to be modeled.

o Class Diagram: Class diagrams are one of the most widely used
diagrams. It is the backbone of all the object-oriented software
systems. It depicts the static structure of the system. It displays the
system's class, attributes, and methods. It is helpful in recognizing the
relation between different objects as well as classes.
o Composite Structure Diagram: The composite structure diagrams
show parts within the class. It displays the relationship between the
parts and their configuration that ascertain the behavior of the class. It
makes full use of ports, parts, and connectors to portray the internal
structure of a structured classifier. It is similar to class diagrams, just
the fact it represents individual parts in a detailed manner when
compared with class diagrams.
o Object Diagram: It describes the static structure of a system at a
particular point in time. It can be used to test the accuracy of class
diagrams. It represents distinct instances of classes and the
relationship between them at a time.
o Component Diagram: It portrays the organization of the physical
components within the system. It is used for modeling execution
details. It determines whether the desired functional requirements
have been considered by the planned development or not, as it depicts
the structural relationships between the elements of a software
system.
o Deployment Diagram: It presents the system's software and its
hardware by telling what the existing physical components are and
what software components are running on them. It produces
information about system software. It is incorporated whenever
software is used, distributed, or deployed across multiple machines
with dissimilar configurations.
o Package Diagram: It is used to illustrate how the packages and their
elements are organized. It shows the dependencies between distinct
packages. It manages UML diagrams by making it easily
understandable. It is used for organizing the class and use case
diagrams.

2. Behavioral Diagrams:
Behavioral diagrams portray a dynamic view of a system or the behavior of a
system, which describes the functioning of the system. It includes use case
diagrams, state diagrams, and activity diagrams. It defines the interaction
within the system.
o State Machine Diagram: It is a behavioral diagram. it portrays the
system's behavior utilizing finite state transitions. It is also known as
the State-charts diagram. It models the dynamic behavior of a class
in response to external stimuli.
o Activity Diagram: It models the flow of control from one activity to
the other. With the help of an activity diagram, we can model
sequential and concurrent activities. It visually depicts the workflow as
well as what causes an event to occur.
o Use Case Diagram: It represents the functionality of a system by
utilizing actors and use cases. It encapsulates the functional
requirement of a system and its association with actors. It portrays the
use case view of a system.

3. Interaction Diagrams
Interaction diagrams are a subclass of behavioral diagrams that give
emphasis to object interactions and also depicts the flow between various
use case elements of a system. In simple words, it shows how objects
interact with each other and how the data flows within them. It consists of
communication, interaction overview, sequence, and timing diagrams.

o Sequence Diagram: It shows the interactions between the objects in


terms of messages exchanged over time. It delineates in what order
and how the object functions are in a system.
o Communication Diagram: It shows the interchange of sequence
messages between the objects. It focuses on objects and their
relations. It describes the static and dynamic behavior of a system.
o Timing Diagram: It is a special kind of sequence diagram used to
depict the object's behavior over a specific period of time. It governs
the change in state and object behavior by showing the time and
duration constraints.
o Interaction Overview diagram: It is a mixture of activity and
sequence diagram that depicts a sequence of actions to simplify the
complex interactions into simple interactions.
UML-Relationship
Relationships depict a connection between several things, such as structural,
behavioral, or grouping things in the unified modeling language. Since it is
termed as a link, it demonstrates how things are interrelated to each other at
the time of system execution. It constitutes four types of relationships,
i.e., dependency, association, generalization, and realization.

Cardinality

Cardinality is expressed in terms of:


 one to one
 one to many
 many to many

Dependency
Whenever there is a change in either the structure or the behavior of the
class that affects the other class, such a relationship is termed as a
dependency. Or, simply, we can say a class contained in other class is known
as dependency. It is a unidirectional relationship.

Association
Association is a structural relationship that represents how two entities are
linked or connected to each other within a system. It can form several types
of associations, such as one-to-one, one-to-many, many-to-
one, and many-to-many. A ternary association is one that constitutes three
links. It portrays the static relationship between the entities of two classes.
An association can be categorized into four types of associations, i.e., bi-
directional, unidirectional, aggregation (composition aggregation), and
reflexive, such that an aggregation is a special form of association and
composition is a special form of aggregation. The mostly used associations
are unidirectional and bi-directional.

Aggregation A special type of association.It represents a "part of"


relationship.

An aggregation is a special form of association. It portrays a part-of


relationship. It forms a binary relationship, which means it cannot include
more than two classes. It is also known as Has-a relationship. It specifies
the direction of an object contained in another object. In aggregation, a child
can exist independent of the parent.

Composition
In a composition relationship, the child depends on the parent. It forms a
two-way relationship. It is a special case of aggregation. It is known as Part-
of relationship.

Aggregation VS Composition relationship


Features Aggregation relationship Composition relationship

Dependenc In an aggregation relationship, a In a composition


y child can exist independent of a relationship, the child cannot
parent. exist independent of the
parent.

Type of It constitutes a Has-a relationship. It constitutes Part-


Relationshi of relationship.
p

Type of It forms a weak association. It forms


Association a strong association.

Examples A doctor has patients when the A hospital and its wards. If
doctor gets transfer to another the hospital is destroyed, the
hospital, the patients do not wards also get destroyed.
accompany to a new workplace.
Generalization
The generalization relationship implements the object-oriented concept
called inheritance or is-a relationship. It exists between two objects (things
or entities), such that one entity is a parent (superclass or base class), and
the other one is a child (subclass or derived class). These are represented in
terms of inheritance. Any child can access, update, or inherit the
functionality, structure, and behavior of the parent.

Realization
It is a kind of relationship in which one thing specifies the behavior or a
responsibility to be carried out, and the other thing carries out that behavior.
It can be represented on a class diagram or component diagrams. The
realization relationship is constituted between interfaces, classes, packages,
and components to link a client element to the supplier element.

Association Aggregation Composition

Association Aggregation The composition


relationship is relationship is relationship is
represented using represented by a represented by a straight
an arrow. straight line with an line with a black
empty diamond at one diamond at one end.
end.

In UML, it can exist It is a part of the It is a part of the


between two or association relationship. aggregation relationship.
more classes.

It incorporates one- It exhibits a kind of It exhibits a strong type


to-one, one-to- weak relationship. of relationship.
many, many-to-one,
and many-to-many
association between
the classes.

It can associate one In an aggregation In a composition


more objects relationship, the relationship, the
together. associated objects exist associated objects
independently within cannot exist
the scope of the independently within the
system. scope of the system.
In this, objects are In this, the linked Here the linked objects
linked together. objects are independent are dependent on each
of each other. other.

It may or may not Deleting one element in It affects the other


affect the other the aggregation element if one of its
associated element relationship does not associated element is
if one element is affect other associated deleted.
deleted. elements.

Example: A tutor Example: A car needs a Example: If a file is


can associate with wheel for its proper placed in a folder and
multiple students, functioning, but it may that is folder is deleted.
or one student can not require the same The file residing inside
associate with wheel. It may function that folder will also get
multiple teachers. with another wheel as deleted at the time of
well. folder deletion.

Class Diagram Example: Order System

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy