You are on page 1of 24

ADVANCED PROGRAMMING WITH JAVA

AND UML
CSC 417

By
Dr. Salamudeen Alhassan

March 22, 2022


Intoduction to UML

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 2 / 24
Overview of UML

UML stands for Unified Modeling Language.


It is a standard language for specifying, visualizing, constructing,
and documenting the artifacts of software systems.
It was created by the Object Management Group (OMG).
UML 1.0 specification draft was proposed to the OMG in
January 1997.
UML is a pictorial language used to make software blueprints.
It is not a programming language but tools can be used to
generate code in various languages using UML diagrams.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 3 / 24
Overview of UML

Goals of UML
To define some general purpose modeling language which is
simple to understand and use by all modelers.
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.
Three major elements
UML building blocks
Rules to connect the building blocks
Common mechanisms of UML

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 4 / 24
Building Blocks of UML

Things
Relationships
Diagrams

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 5 / 24
Building Blocks of UML - Things

They are the most important building blocks of UML. They can be
Structural
Behavioral
Grouping
Annotational

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 6 / 24
Building Blocks of UML - Things

Structural things define the static part of the model.


They represent the physical and conceptual elements.
They include
Name Description Symbol

Class Represents a set of objects having similar responsibilities

Interface It defines a set of operations, which specify the responsibility of a class.

Collaboration It defines an interaction between elements.

Use case It represents a set of actions performed by a system for a specific goal.

Component Describes the physical part of a system.

Node It can be defined as a physical element that exists at run time.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 7 / 24
Building Blocks of UML - Things

Behavioral Things consist of the dynamic parts of UML


models.
They include
Name Description Symbol

Interaction It is a behavior that consists of a group of messages exchanged among


elements to accomplish a specific task.

State machine It defines the sequence of states an object goes through in response to
events.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 8 / 24
Building Blocks of UML - Things

Grouping Things is a mechanism to group elements of a UML


model together.
They include

Name Description Symbol

Package It is used for gathering structural and


behavioral things.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 9 / 24
Building Blocks of UML - Things

Annotational Things is a mechanism to capture remarks,


descriptions, and comments of UML model elements.
They include

Name Description Symbol

Note It is used to render comments, con-


straints, etc. of an UML element.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 10 / 24
Building Blocks of UML - Relationships

They show how the elements are associated with each other and this
association describes the functionality of an application.
The four kinds of Relationships
Name Description Symbol

Dependency It is a relationship between two things in which change in one element


also affects the other.

Association It is a set of links that connects the elements of a UML model. It also
describes how many objects are taking part in that relationship.

Generalization It is a relationship which connects a specialized element with a gener-


alized element. It basically describes the inheritance relationship in the
world of objects.
Realization It is a relationship in which two elements are connected. One element
describes some responsibility, which is not implemented and the other
one implements them.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 11 / 24
Architecture

Any real-world system is used by different users.


Before designing a system, the architecture is made with
different perspectives in mind.
Different perspectives of a system.
Design. It consists of classes, interfaces, and collaboration. UML provides class
diagram, object diagram to support this.
Implementation. It defines the components assembled together to make a
complete physical system. UML component diagram is used to support the
implementation perspective.
Process. It defines the flow of the system. The same elements as used in
Design are also used to support this perspective.
Deployment. It represents the physical nodes of the system that forms the
hardware. UML deployment diagram is used to support this perspective.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 12 / 24
Modeling Types - Structural Modeling

It captures the static features of a system.


Classes diagrams
Objects diagrams
Deployment diagrams
Package diagrams
Composite structure diagram
Component diagram
It represents the framework for the system and this framework is
the place where all other components exist.
The class diagram, component diagram and deployment
diagrams are part of structural modeling.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 13 / 24
Modeling Types - Behavioral Modeling

It describes the interaction in the system.


It represents the interaction among the structural diagrams.
Behavioral modeling shows the dynamic nature of the system.
Activity diagrams
Interaction diagrams
Use case diagrams

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 14 / 24
Modeling Types - Architectural Modeling

It represents the overall framework of the system.


It contains both structural and behavioral elements of the
system.
It can be defined as the blueprint of the entire system.
Package diagram comes under architectural modeling.

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 15 / 24
UML - Notations

Structural Things

Notation Symbol

Class

Object

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 16 / 24
UML - Notations

Structural Things

Notation Symbol

Interface

Collaboration

Use Case

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 17 / 24
UML - Notations

Structural Things

Notation Symbol

Actor

Initial State

Final State

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 18 / 24
UML - Notations

Structural Things

Notation Symbol
Active Class

Component

Node

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 19 / 24
UML - Notations
Behavioral Things

Notation Symbol

Interaction

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 20 / 24
UML - Notations

Behavioral Things

Notation Symbol

State Machine

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 21 / 24
UML - Notations

Grouping Things

Notation Symbol

Package

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 22 / 24
UML - Notations

Annotational Things

Notation Symbol

Note

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 23 / 24
UML - Notations

Relationships Things

Notation Symbol

Dependency

Association
Generalization

Extensibility

ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 22, 2022 24 / 24

You might also like