Sie sind auf Seite 1von 43

Unified Modeling Language

Basic Concepts

UML

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

*Note: This presentation includes materials from Grady Booch, James Rumbaugh and Ivar Jacobsons overviews on
different aspects of UML available at http://www.rational.com/uml/resources

UML

UML Heritage
General-purpose OO modeling language

convergence of a number of popular


OO methods

UML
2.0

OMT
(Rumbaugh et al.)

UML
1.4
1996

UML
0.9

Booch

Mar. 1999

UML
1.1
Nov. 1997

OOSE
(Jacobson et al.)

Catalysis

UML

ROOM

etc.

Contributions to the UML


Harel

Meyer
Before and after
conditions

Statecharts

Gamma, et al
Frameworks and patterns,

HP Fusion

Booch

Operation descriptions and


message numbering

Booch method

Embley

Rumbaugh

Singleton classes and


high-level view

OMT

Jacobson

Wirfs-Brock

OOSE

Responsibilities

Shlaer - Mellor
Object lifecycles

UML

Odell
Classification

Creating the UML


UML 2.0
UML 1.4
UML 1.3
UML 1.1

Planned major revision, 2001 (UML 2.0)

public
feedback

OMG Acceptance, Nov 1997


Final submission to OMG, Sep 97
First submission to OMG, Jan 97
UML partners

UML 0.9

Web - June 96

OOPSLA 95

Other methods

UML

UML 1.0

Unified Method 0.8

Booch method

OMT

OOSE

UML Usage: Overview

The UML may be used to:

Represent the Elements of a system or a domain


and their Relationships in a Static Structure using
class and object diagrams
Model the Behavior of objects with state transition
diagrams
Reveal the Physical Implementation Architecture
with component & deployment diagrams
Display the Boundary of a System & its major
Functions using use cases and actors
Illustrate Use Case Realizations with interaction
diagrams

UML

UML for Information Modeling

Provides a uniform modeling formalism and a set of


(object-oriented) constructs (notation) for representing
the elements of a domain of interest as well as their
relationships in a Static Structural Model
Use Cases can be used to model usage
Example (DMTF, IETF): development of a common
model to serve as an underlying information framework
for the specification of a common directory schema;
the common model & schema support the operation of
multiple applications and systems in the enterprise

UML

UML: Basic Types of Concepts

UML

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

UML

Classes and Instances

Specifications for one or more distinct objects


with a common form (structure and behavior)
instance
class

phone1:Telephone
busy = true

Telephone
busy : boolean
offHook()
onHook ()
ring()

UML

offHook()
onHook ()
ring()
phone2:Telephone
busy = false
offHook()
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

Each course offering


has a number, location
and time

UML

CourseOffering
number
location
time

Operations

The behavior of a class is represented by its


operations
Operations may be found by examining interaction
diagrams
registration
form

registration
manager

RegistrationManager

addCourse(joe, math 01)

UML

addCourse(Student,Course)

Relationships

Relationships provide a pathway for


communication between objects
Sequence and/or collaboration diagrams are
examined to determine what links between
objects need to exist to accomplish the
behavior -- if two objects need to talk there
must be a link between them

UML

Copyright 1997 by Rational Software Corporation

Basic Relationship Types

Association
Dependency
Aggregation
Generalization
Realization

UML

Relationships: Defined

An association is a bi-directional connection


between classes
An association is shown as a line connecting the related
classes

An aggregation is a stronger form of


relationship where the relationship is between
a whole and its parts
An aggregation is shown as a line connecting the related
classes with a diamond next to the class representing the
whole

A dependency relationship is a weaker form of


relationship showing a relationship between a
client and a supplier where the client does not
have semantic knowledge of the supplier.
A dependency is shown as a dashed line pointing from the
client to the supplier

UML

Copyright 1997 by Rational Software Corporation

Generalization (Inheritance)

A generalization is a relationship between a


more general and a more specific element

Inheritance is the main property of generalizationspecialization relationships defined between a


superclass and its subclasses
Common attributes, operations, and/or relationships
are shown at the highest applicable level in the
hierarchy

Realization is a relationship defined between a


type and its implementation classes

UML

Copyright 1997 by Rational Software Corporation

Relationships: Notation

Association

Dependency

Client

name

Supplier

Aggregation

Generalization

Realization

Part

Superclass

type

UML

Aggregate

Subclass

Implementation
class

Models and Diagrams


A model is a complete
description of a system
from a particular
perspective
Use Case
Use Case
Diagrams
Sequence
Diagrams
Diagrams

Scenario
Scenario
Diagrams
Collaboration
Diagrams
Diagrams

Scenario
Scenario
Diagrams
Statechart
Diagrams
Diagrams

UML

Use Case
Use Case
Diagrams
Use Case
Diagrams
Diagrams

State
State
Diagrams
Class
Diagrams
Diagrams

State
State
Diagrams
Object
Diagrams
Diagrams

State
State
Diagrams
Component
Diagrams
Diagrams

Models

Component
Component
Diagrams
Deployment
Diagrams

Activity
Diagrams

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

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

UML

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

UML

Use Case Diagram

Captures system functionality as seen by users

UML

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 systems architecture
Drive implementation and generate test cases

Developed by analysts and domain experts

UML

Class Diagram

UML

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

UML

Class Diagram: Example

Shows the entities in a system and their general


relationships
Person

client
0..*

creditor
0..*

Financial
Institution

owner 0..*

generalization
association

Bank
residence 0..*

House

UML

Trust
Company

Object Diagram

Captures instances and links

UML

Object Diagram

Shows instances and links


Built during analysis and design
Purpose
Illustrate data/object structures
Specify snapshots

Developed by analysts, designers, and


implementers

UML

Component Diagram

Captures the physical structure of the


implementation

UML

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

UML

Deployment Diagram

Captures the topology of a systems hardware

UML

Deployment Diagram

Captures the topology of a systems hardware


Built as part of architectural specification
Purpose
Specify the distribution of components
Identify performance bottlenecks

Developed by architects, networking engineers,


and system engineers

UML

Sequence Diagram

Captures dynamic behavior (time-oriented)

UML

Sequence Diagram

Captures dynamic behavior (time-oriented)


Purpose
Model flow of control
Illustrate typical scenarios

UML

Sequence Diagram: Example

Assertions of legal interactions between objects


(e.g., operator-assisted call)
Caller

Operator

Callee

sequence
diagram

call
ack
number
call
ack
transfer
talk
time

UML

Collaboration Diagram

Captures dynamic behavior (messageoriented)

UML

Collaboration Diagram

Captures dynamic behavior (messageoriented)


Purpose

Model flow of control


Illustrate coordination of object structure and control

UML

Collaboration Diagram: Example

A collaboration diagram displays object


interactions organized around objects and their
links to one another
course form :
CourseForm

1: set course info


2: process
3: add course

: Registrar

theManager :
CurriculumManager

aCourse :
Course
4: new course

UML

Statechart Diagram

Captures dynamic behavior (event-oriented)

UML

Statechart Diagram

Captures dynamic behavior (event-oriented)


Purpose
Model object lifecycle
Model reactive objects (user interfaces, devices,
etc.)

UML

Activity Diagram

Captures dynamic behavior (activity-oriented)

UML

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

UML

References

Grady Booch, James Rumbaugh, Ivar Jacobson, The Unified


Modeling Language User Guide, Addison-Wesley, 1999.
UML documentation - http://www.rational.com/uml/resources
UML in Action, Communications of the ACM, October 1999, V.
42, N. 10
Whitepapers:

(1) "Why Use the UML?" by Martin Fowler


(2) "How the UML Models Fit Together," by Scot Ambler
(3) "UML Applied: Nine Tips to Incorporating UML into Your Project"
by D. Rosenberg
(1) ,(2) and (3) are available at http://www.sdmagazine.com/uml
(Focus on UML).
There are several whitepapers on UML available at The UML Home
http://www.rational.com/uml/resources/whitepapers -

UML

Das könnte Ihnen auch gefallen