Introduction to UML based on: Introduction to the Unified Modeling - - PowerPoint PPT Presentation

introduction to uml
SMART_READER_LITE
LIVE PREVIEW

Introduction to UML based on: Introduction to the Unified Modeling - - PowerPoint PPT Presentation

"Plan? Who needs a plan?" Introduction to UML based on: Introduction to the Unified Modeling Language , Chapter 2 Terry Quatrani, UML Evangelist, IBM Instructor: Peter Baumann email: p.baumann@jacobs-university.de tel: -3178


slide-1
SLIDE 1

320312 Software Engineering (P. Baumann)

Excellent work! But maybe we should get a little more detailed here...?

"Plan? Who needs a plan?" Introduction to UML

Instructor: Peter Baumann email: p.baumann@jacobs-university.de tel:

  • 3178
  • ffice:

room 88, Research 1 based on: Introduction to the Unified Modeling Language, Chapter 2 Terry Quatrani, UML Evangelist, IBM

slide-2
SLIDE 2

2 320312 Software Engineering (P. Baumann)

What is UML?

  • What is UML?
  • "The UML (Unified Modeling Language)

is the [OMG] standard language for specifying, visualizing, constructing, and documenting all the artifacts of a software system.”

  • Synthesis of notations by Grady Booch,

Jim Rumbaugh, Ivar Jacobson, and many others

  • Rational, Objectory, et al, ...now IBM
  • diagram perspectives
  • Conceptual, specification, implementation
slide-3
SLIDE 3

3 320312 Software Engineering (P. Baumann)

Diagram Types Overview

  • Main diagram types, according to „80/20 rule“:
  • Use Case Diagram (functional)
  • Activity / Action Diagram (behavioral)
  • Class Diagram (structural)
  • State Diagram (behavioral)
  • Sequence Diagram (behavioral)
  • Further, not addressed here:
  • Object Diagram (structural), Collaboration Diagram (structural), Package Diagram

(structural), Deployment Diagram (structural)

  • Interaction Diagram ::= Collaboration Diagram | Sequence Diagram
slide-4
SLIDE 4

4 320312 Software Engineering (P. Baumann)

Use Case Diagrams

  • use case = chunk of functionality, not a software module
  • Should contain a verb in its name
  • actor = someone or some thing interacting

with system under development

  • Aka role in scenario
  • Visualize relationships

between actors and use cases

  • capture high-level alternate

scenarios, get customer agreement (early !)

slide-5
SLIDE 5

5 320312 Software Engineering (P. Baumann)

Activity Diagrams

  • Represents the overall flow of control
  • Graphical workflow of activities and actions
  • like flow chart, but user-perceived actions(business model)

Synchronisation bar (fork/join) Transition guard Swimlanes

slide-6
SLIDE 6

6 320312 Software Engineering (P. Baumann)

Class Diagrams

  • Class = collection of objects with common structure,

common behavior, common relationships, and common semantics

  • Displayed as box with up to 3 compartments:
  • Name
  • List of attributes (aka state variables)
  • List of operations
  • Class modeling elements include:
  • Classes with structure + behavior
  • Relationships
  • Multiplicity and navigation indicators
  • Role names
slide-7
SLIDE 7

7 320312 Software Engineering (P. Baumann)

Class Diagrams: (Instance) Relships

  • Models that two objects can “talk”
  • Association – bi-directional connection between classes
  • “I can send you a message because if I‟m associated with you, I know you‟re there.”
  • Aggregation – stronger form: „has a“
  • R. between a whole and its parts
  • Dependency – weaker form
  • “need your services,

but I don‟t know that you exist.”

  • Quatrani: „typically first make

everything an association, lateron refine“

how described?

slide-8
SLIDE 8

8 320312 Software Engineering (P. Baumann)

Class Diagrams: Multiplicities, Navig.

  • Multiplicity numbers & intervals denote number of instances

that can/must participate in relationship instance

  • For both ends
  • f relationship edge
  • 0..1 (may have one)
  • 1 (must have one)
  • 0..* or * (may have many)
  • 1..* (has at least one)
  • Arrow head to denote:

traversable only this direction

slide-9
SLIDE 9

9 320312 Software Engineering (P. Baumann)

Class Diagrams: Inheritance

  • Inheritance = relation between subclass and superclass
  • Subclass instances have
  • all properties specified

in superclass

  • plus the specific ones

defined with the subclass

  • Also called „is-a“
slide-10
SLIDE 10

10 320312 Software Engineering (P. Baumann)

Sequence Diagrams

  • Displays object interactions arranged in a time sequence
  • Can be from user„s perspective!
  • good for: showing what‟s going on

and driving out requirements when interacting with customers

  • How many SDs? Rule of thumb:
  • for every basic flow of every use case
  • for high-level, risky scenarios
  • Useful for designer and customer to answer the question:

„what objects and interactions will I need to accomplish the functionality specified by the flow of events?“

slide-11
SLIDE 11

11 320312 Software Engineering (P. Baumann)

Activity vs Sequence Diagrams?

Activity diagram:

  • Granularity: user-perceived actions
  • Emphasis on internal state transitions

Sequence diagram:

  • Granularity: actors + system components
  • Emphasis on component interaction
slide-12
SLIDE 12

12 320312 Software Engineering (P. Baumann)

State Transition Diagrams

  • show life history of a given class
  • use for classes that typically have a lot of dynamic behavior
  • Sequence Diagram: class that‟s on a lot of sequence diagrams, getting and sending a

lot of messages is candidate

guard

slide-13
SLIDE 13

13 320312 Software Engineering (P. Baumann)

Re-Iterating...

  • UML knows several diagram types to capture different aspects of a

software system

  • Structural, functional, behavioral
  • Mutual interrelations
  • use them to do consistency & plausibility cross checking!
  • Fine so far? Let‘s go on...
slide-14
SLIDE 14

14 320312 Software Engineering (P. Baumann)

Outlook: UML 2.0

  • Substantially revised, in particular for Model-Driven Architecture
  • Infrastructure: core of architecture, profiles, stereotypes
  • Superstructure: static & dynamic model elements
  • Object Constraint Language (OCL): formalize assertions, rules
  • Diagram Interchange: UML exchange format
  • Vision:

UML spec  platform-indepd. model  target model  implementation PIM PSM

  • verify & validate specs already in design phase
  • Main goals:

speed up process, higher quality, reusability, long-term usability

slide-15
SLIDE 15

15 320312 Software Engineering (P. Baumann)

Outlook: UML 2.0 (contd.)

  • The „ideal UML/MDA machine“:
slide-16
SLIDE 16

16 320312 Software Engineering (P. Baumann)

Outlook: DSLs

  • Alternative to UML for describing systems :

domain-specific modelling languages (DSLs)

  • UML considered (too) complex (general-purpose), software biased
  • Ex. SysML = general purpose modelling language for systems engineering

applications [www.sysml.org]

  • SysML emphasizes hardware, information, processes, personnel, facilities
  • UML dialect, issued by OMG
  • Used, eg, in aerospace, defense, automotive
  • Rule of thumb:
  • UML better for enterprise apps (millions of possible directions)
  • DSLs better for embedded systems (clearly delimited app domain & paths)
slide-17
SLIDE 17

17 320312 Software Engineering (P. Baumann)

  • UML industry standard

for visually describing all aspects during software life cycle

  • Use Case Diagram, Activity Diagram , Sequence Diagram, Class Diagram, State Diagram, ...
  • More work in the beginning (= before coding starts),

but will pay off in

  • Better design (less flaws & more consistency)
  • Fewer costly surprises late at integration / customer testing time
  • Better plannable
  • Higher customer satisfaction, better career

Wrap-Up

slide-18
SLIDE 18

18 320312 Software Engineering (P. Baumann)

  • „revision cloud“ common in mechanical engineering

Caveat: Symbology Interpretation

[autodesk.blogs.com]

slide-19
SLIDE 19

19 320312 Software Engineering (P. Baumann)

  • „revision cloud“ common in mechanical engineering

Caveat: Symbology Interpretation

[autodesk.blogs.com]

slide-20
SLIDE 20

20 320312 Software Engineering (P. Baumann)

Further Reading

  • We had but a primer – UML spec has ~700 pages...
  • See my course web page for a list of tutorials etc.
  • Introduction to the Unified Modeling Language, by Terry Quatrani
  • article from where this presentation was made
  • Books:
  • Visual Modeling with Rational Rose 2002 and UML, by Terry Quatrani
  • UML Distilled, by Martin Fowler
  • UML Explained, by Kendall Scott
  • www.uml.org