UML Presentation
UML Presentation
Lecture 3 & 4
UML-Basic Concepts
Sajiya Tariq
What is the UML*?
• UML stands for Unified Modeling Language
• The UML combines the best of the best from:
▫ Data Modeling concepts (Entity Relationship
Diagrams)
▫ Business Modeling (Work Flow)
▫ Object Modeling
▫ Component Modeling
• The UML is a standard language for specifying,
visualizing, documenting and constructing the
artifacts of a software-intensive system
• It can be used with all processes, throughout the
development life cycle, and across different
implementation technologies
UML Heritage
General-purpose OO modeling language
– convergence of a number of popular
OO methods UML
2.0
OMT
(Rumbaugh et al.)
1996
UML
UML 1.4
0.9 Mar. 1999
Booch
UML
1.1
OOSE Nov. 1997
(Jacobson et al.)
Catalysis ROOM etc.
UML Heritage
• The Unified Modeling Language (UML) has been
formally under development since 1994
• The standardized architecture of UML is based
on the Meta-Object Facility (MOF).
• Managed by OMG (Object Management Group)
• Amongst the most popular designing languages
in the market. Around 70% coverage)
UML Heritage
• The MOF (Meta Object Facility) defines the foundation for
creating modeling languages used for object modeling, such as
UML, and for data modeling, such as the Common Warehouse
Model (CWM).
• The MOF defines standard formats for the key elements of a
model so that they can be stored in a common repository and
exchanged between modeling tools and languages.
• XML Metadata Interchange (XMI) provides the mechanism to
implement the sharing of these modeling elements between
modeling tool vendors and between repositories.
• PIM & PSM interoperability
UML Heritage
• The story of Three Amigos
▫ Object-Oriented Software Engineering (OOSE),
developed by Ivar Jacobson, is based around the
use-case concept
▫ Object-Modeling Technique (OMT) developed by
James Rumbaugh with an emphasis on the
analysis of business and data intensive systems for
defining a target problem
▫ The Booch method, developed by Grady Booch,
had particular strengths in design and
implementation, defining and mapping a solution
to the target problem
Contributions to the UML
Harel
Meyer Gamma, et al
Statecharts
Before and after Frameworks and patterns,
conditions
HP Fusion
Booch
Operation descriptions and
Booch method message numbering
Rumbaugh Embley
Singleton classes and
OMT
high-level view
Jacobson Wirfs-Brock
OOSE
Responsibilities
• Modeling elements
• Relationships
• Diagrams
Basic Modeling Elements
• Structural elements
▫ type, class, instance, collaboration, use case,
component, node
• Behavioral elements
▫ interaction, state machine
• Grouping elements
▫ package, subsystem
Models and Diagrams
A model is a complete
description of a system
from a particular State
State
Diagrams
perspective Class
Diagrams
Use Case Diagrams
Use Case
Diagrams State
Use Case Use Case
Diagrams State
Diagrams
Use Case Diagrams Object
Diagrams
Diagrams
Sequence Diagrams
Diagrams
Diagrams
Scenario State
Scenario
Diagrams State
Diagrams
Collaboration
Diagrams Component
Diagrams
Diagrams Models Diagrams
Scenario Component
Scenario
Diagrams
Component
Diagrams
Deployment
Statechart
Diagrams Diagrams
Diagrams Diagrams
Activity
Diagrams
Classes and Instances
• Specifications for one or more distinct objects
with a common form (structure and behavior)
instance
class phone1:Telephone
busy = true
offHook()
onHook ()
Telephone ring()
phone2:Telephone
busy : boolean
busy = false
offHook()
onHook () offHook()
ring() onHook ()
ring()
Attributes
• The data/static structure aspect of a class is
represented by its attributes
• Attributes may be found by examining class
definitions, the problem requirements, and by
applying domain knowledge
CourseOffering
Each course offering number
has a number, location location
time
and time
Operations
• The behavior of a class is represented by its operations
• Operations may be found by examining interaction
diagrams
registration registration
form manager
RegistrationManager
Scenario State
Scenario
Diagrams State
Diagrams
Collaboration
Diagrams Component
Diagrams
Diagrams Models Diagrams
Scenario Component
Scenario
Diagrams
Component
Diagrams
Deployment
Statechart
Diagrams Diagrams
Diagrams Diagrams
Activity
Diagrams
Why Build Models?
• To understand the problem better
• To communicate with stakeholders
• To find errors or omissions
• To plan out the design
• To generate code
UML Model Views
• Requirements (use case diagrams)
• Static structure (class diagrams)
▫ kinds of objects and their relationships
• Dynamic behavior (state machines)
▫ possible life histories of an object
• Interactive behavior (activity, sequence, and
collaboration diagrams)
▫ flow of control among objects to achieve system-level
behavior
• Physical implementation structures (component
and deployment diagrams)
▫ software modules and deployment on physical nodes
Diagrams
• A diagram is a view into a model
▫ Presented from the aspect of a particular
stakeholder
▫ Provides a partial representation of the system
▫ Is semantically consistent with other views
• In the UML, there are nine standard diagrams
▫ Static views: use case, class, object, component,
deployment
▫ Dynamic views: sequence, collaboration,
statechart, activity
Use Case Diagram
• Captures system functionality as seen by users
Use Case Diagram
• Captures system functionality as seen by users
• Built in early stages of development
• Purpose
▫ Specify the context of a system
▫ Capture the requirements of a system
▫ Validate a system’s architecture
▫ Drive implementation and generate test cases
• Developed by analysts and domain experts
Class Diagram
• Captures the vocabulary of a system
Class Diagram
• Captures the vocabulary of a system
• Built and refined throughout development
• Purpose
▫ Name and model concepts in the system
▫ Specify collaborations
▫ Specify logical database schemas
• Developed by analysts, designers, and
implementers
Domain Model: Example
Shows the entities in a system and their general
relationships
Bank Trust
Company
residence 0..*
House
Object Diagram
• Captures instances and links
Object Diagram
• Shows instances and links
• Built during analysis and design
• Purpose
▫ Illustrate data/object structures
▫ Specify snapshots
• Developed by analysts, designers, and
implementers
Component Diagram
• Captures the physical structure of the
implementation
Component Diagram
• Captures the physical structure of the
implementation
• Built as part of architectural specification
• Purpose
▫ Organize source code
▫ Construct an executable release
▫ Specify a physical database
• Developed by architects and programmers
Deployment Diagram
• Captures the topology of a system’s hardware
Deployment Diagram
• Captures the topology of a system’s hardware
• Built as part of architectural specification
• Purpose
▫ Specify the distribution of components
▫ Identify performance bottlenecks
• Developed by architects, networking engineers,
and system engineers
Sequence Diagram
• Captures dynamic behavior (time-oriented)
Sequence Diagram
• Captures dynamic behavior (time-oriented)
• Purpose
▫ Model flow of control
▫ Illustrate typical scenarios
Collaboration Diagram
theManager :
aCourse : CurriculumManager
Course
4: new course
Statechart Diagram
• Captures dynamic behavior (event-oriented)
Statechart Diagram
• Captures dynamic behavior (event-oriented)
• Purpose
▫ Model object lifecycle
▫ Model reactive objects (user interfaces, devices,
etc.)
Activity Diagram
• Captures dynamic behavior (activity-oriented)
Summary: the UML
• An industry standard for analysis and design of
object-oriented systems
▫ based on extensive experience and best practices
▫ gaining rapid acceptance (training, tools, books)
• Comprises:
▫ set of modeling concepts
▫ graphical notation
• Concepts are organized into diagram types
▫ class, state machine, collaboration, use case,
sequence, activity, component, deployment
• The UML can be used in many different domains
to capture domain-specific concepts and ideas