Unit 3 Model Development Using Unified Modelling Language (UML)
Unit 3 Model Development Using Unified Modelling Language (UML)
2CEIT406
SOFTWARE ENGINEERING &
PROJECT MANAGEMENT
UNIT 3
MODEL DEVELOPMENT USING UNIFIED MODELING
LANGUAGE (UML)
Prepared by: Prof. Ravi Raval (Asst. Prof in C.E Dept. , UVPCE)
Unit 3: Model Development using UML
Component diagrams
Contents:
Dynamic Modelling
Overview of object oriented Use Case Diagram
concepts
Sequence
Advantage of OOD
Activity Diagram
Unified modelling language(UML) State chart Diagram
Static Modelling:
Exercises and case studies
Class
Object
Package
Overview of object oriented concepts
What is Object-Orientation? 1) Identity
It means that we organize software as a collection It means that data is quantized into
of discrete objects that incorporate both data discrete, distinguishable entities called
structure and behavior objects
Object = Data structure + Behavior
Ex. White queen in chess
Object can be concrete, such as a file in
(attributes)
a file system, or conceptual, such as a
(operations)
scheduling policy in a
Four aspects of OO approach (characteristics) : multiprogramming operating system
1) Identity Each object has its own inherent identity
2) Classification Two objects are different even if the
3) Inheritance attribute values are same
4) polymorphism
Overview of object oriented
concepts
2) Classification 3) Inheritance
Objects with same data structure and It is the sharing of attributes and
behavior are grouped together into a operations among classes based on a
class hierarchical relationship
A class is an abstraction that describes A super class has general information
a properties important to an that subclass refine and elaborate
application and ignores the rest Each subclass inherits all features of its
Any choice of classes is arbitrary and super class and adds its own unique
depends on the application features
Subclasses need not to repeat the
Each class describes infinite set of
features of the super class
individual objects
Ex. Scrolling window and Fixed window
Object is said to be instance of its
are subclasses of Window class
class
Overview of object oriented
concepts
4) Polymorphism
The same operation behave
differently for different classes
Ex. Move operation for a pawn
and the queen in a chess game
An operation is a procedure or
transformation that an object
performs
An implementation of the
operation by a specific class is
called a method
Advantage of OOD
Faster Development
Reuse of Previous work
Increased Quality
Modular Architecture
Client/Server Applications
Better Mapping to the Problem Domain
Unified modelling language(UML)
Why to use UML for modeling?
What is UML? Use graphical notation to
UML stands for “Unified Modeling
communicate more clearly than natural
Language” language (imprecise) and code(too
It is a industry-standard graphical detailed).
language for specifying, visualizing, Help acquire an overall view of a
constructing, and documenting the system.
artifacts of software systems UML is not dependent on any one
The UML uses mostly graphical notations language or technology.
to express the OO analysis and design of
software projects.
Simplifies the complex process of
software design
UML diagrams
UML diagrams
Structure diagrams show the static structure of the Behavior diagrams show the dynamic
system and its parts on different abstraction and behavior of the objects in a system, which
implementation levels and how they are related to can be described as a series of changes to
each other. The elements in a structure diagram the system over time, there are seven types
represent the meaningful concepts of a system, and of behavior diagrams as follows:
may include abstract, real world and Use Case Diagram
implementation concepts, there are seven types of Activity Diagram
structure diagram as follows: State Machine Diagram
Class Diagram Sequence Diagram
Component Diagram Communication Diagram
Deployment Diagram Interaction Overview Diagram
Object Diagram Timing Diagram
Package Diagram
Composite Structure Diagram
Profile Diagram
Static modelling: Class Diagram
The UML Class diagram is a graphical Class diagram is a static diagram. It
notation used to construct and visualize represents the static view of an
object oriented systems. A class application.
diagram in the Unified Modeling
Language (UML) is a type of static Purpose of Class Diagrams
structure diagram that describes the Analysis and design of the static
structure of a system by showing the view of an application.
system's: Describe responsibilities of a system.
classes,
their attributes,
Base for component and deployment
diagrams.
operations (or methods),
and the relationships among objects.
Forward and reverse engineering.
Class Diagram
UML Representation of Class
Class Name
Attributes of Class
Operations/methods of
Class
Class Diagram
Visibility of Attributes and Operations Class Visibility Example
In object-oriented design, there is a notation
of visibility for attributes and operations.
UML identifies four types of
visibility: public, protected, private,
and package.
protected
The +, -, # and ~ symbols before an attribute Access Right public (+) private (-)
(#)
Package (~)
: Multimedia :: AudioStream
t : Transaction
: :keyCode
keyCode
c : Phone
agent : [WaitingForAnswer]
instance with current
multiobject orphan instance
state
(type unknown)
: :Transaction
Transaction current := retrieve()
Instances & Objects - Modeling Prototypical Instances
• Show these instances and their relationships in an interaction diagram or an activity diagram.
1 : create
a: CallingAgent c: Connection
2.1 : startBilling
2: enableConnection
Instances & Objects – some more examples
list() 1: sort() c : Company
d: Directory contents:File
contents: File
s : Department rd : Department
addFile(f:File) 1: addElement(f)
d: Directory contents:File
contents: File name = “Sales” name = “R&D”
[Condition] GUAR
END POINT
D
STEP PARALLEL
STEPS
Invoice Invoice
created paying destroyed
Unpaid Paid
transition
state
Example: Here’s a simple example SD for a washing machine
State
Transition
Condition
Action
Seminar Registration
event action, taken during
transition
Setup
AddParticipant / Set count = 0 Available
do/initialize seminar
do/initialize seminar
cancel
[ count = 20 ]
seminar
cancel seminar
guard
Canceled Full
cancel seminar
do/finalize seminar
do/refund payments