Unified Modeling Language - PowerPoint PPT Presentation

1 / 89
About This Presentation
Title:

Unified Modeling Language

Description:

Title: UML Generic mechanisms/Diagram elements Author: ENMadmin Last modified by: Pavol Mederly Created Date: 6/28/1999 10:32:09 AM Document presentation format – PowerPoint PPT presentation

Number of Views:222
Avg rating:3.0/5.0
Slides: 90
Provided by: ENMa5
Category:

less

Transcript and Presenter's Notes

Title: Unified Modeling Language


1
Unified Modeling Language
  • a language for specifying, constructing,
    visualizing and documenting the artifacts of a
    software-intensive system
  • also for Business Modeling and other non-software
    systems
  • Authors Grady Booch, Jim Rumbaugh and Ivar
    Jacobson
  • Stems out from Booch, OMT, OOSE (and others)

2
  • History

Industrialization
Standardization
Unification
Fragmentation
Booch method
OMT
3
  • Goals
  • ready-to-use, expressive visual modeling language
  • extensibility and specialization mechanisms to
    extend the core concepts
  • independent of particular programming languages
    and development process
  • formal basis for understanding the modeling
    language
  • encourage the growth of the OO tools (CASE)
    market
  • support higher-level development concepts such as
    collaboration, frameworks, patterns and
    components
  • integrate best practices

4
  • Outside the scope of UML
  • Programming languages
  • the UML is a modeling language, not programming
  • its aim is not to capture all necessary
    constructs of programming languages
  • Tools
  • the UML defines a semantic metamodel, not an tool
    interface, storage or run-time model
  • the UML documents do include some tips to tool
    vendors (implementation choices), but do not
    address everything
  • Process
  • the UML is intentionally process independent, and
    defining a standard process was not a goal of UML
  • UML is a common language for priject artifacts,
    developed in the context of different processes

5
  • Artifacts
  • UML Semantics
  • description of the UML metamodel, i.e. a model
    defining a language
  • Abstract syntax
  • Well formedness rules
  • Semantics
  • UML Notation Guide
  • graphical notation and textual syntax of visual
    elements of the UML language
  • UML Extensions
  • language extensions for Objectory Process,
    Business Modeling, etc.

6
UML Generic mechanisms/Diagram elements
  • Graphs and their contents
  • Strings
  • Name
  • Label
  • Keywords
  • Expression (OCL Expression)
  • Note
  • Type-instance correspondence

7
Graphs and their contents
  • UML diagrams
  • are graphs containing nodes connected by paths.
  • the information is mostly in the topology
    (exception a sequence diagram with a metric time
    axis)
  • Graphical constructs used in UML notation
  • icon, two-dimensional symbols, drawing paths
  • strings

8
Graphs and their contents
  • Invisible hyperlinks and the role of tool
  • a notation may contain additional invisible
    hyperlinks that are not apparent in a static view
  • a dynamic notation - out of scope of the UML
  • Background information
  • each appearance of a symbol may have its own
    presentation choices
  • information presented in a textual or tabular
    format
  • presenting tabular information is a tool
    responsibility (out of scope of UML)

9
  • Strings
  • a sequence of characters
  • they map underlying model strings, although some
    strings may exist purely on the diagrams
  • Example
  • BankAccount
  • integrate (f Function, from Real, to Real)
  • Name
  • a string, that uniquely identifies a model
    element within some scope
  • a pathname names linked by a delimiter (e.g.
    )
  • Example
  • integrate
  • MathPakMatricesBandedMatrix.dimension

10
  • Label
  • a string that is attached to a graphic symbol
  • it is purely a notational term
  • Example
  • Keywords
  • used to distinguish variations on a common theme
  • general notation is keyword
  • Example
  • ltltstereotypegtgt

11
  • Expression
  • expressed as strings in a particular language
  • the OCL is used within the UML semantic
    definition
  • linguistic formulas yielding values
  • Example
  • BankAccount () (Person, int)
  • i gt j and self.size gt i
  • OCL Expression
  • used to define constraints (within the UML
    metamodel itself)
  • Example
  • flight.pilot.training_hours gt flight.plane.minimum
    _hours
  • company.employees-gtselect (title Manager and
    self.reports-gtsize gt 10)

12
  • Note
  • a graphical symbol containing textual information
  • a notation for rendering constraints,comments,
    method bodies, and tagged values
  • is a notational item
  • Example

13
  • Type-instance correspondence
  • a major purpose of modeling is to prepare generic
    descriptions that describe many specific
    particular items -gt type-instance dichotomy
  • in UML the type-instance distinction is shown by
    employing the same symbol and by underlining the
    name string of an instance element.
  • Example

14
Generic mechanisms/Model management
  • Packages
  • may contain packages and ordinary model elements
  • some packages may be Subsystems or Models
  • the basis for configuration control, access
    control
  • element can be directly owned by a single package
  • stereotypes system, facade, framework, top
    package
  • the visibility ( public, - private,
    protected)
  • dependency between packages gt dependencies among
    the elements

15
  • Example (of packages)

16
General extension mechanisms
  • represents general purpose mechanisms that may be
    applied to any modeling element
  • an extensibility device for UML
  • Constraint
  • Comment
  • Tagged values
  • Stereotypes

17
  • Constraint
  • represents semantic information attached to a
    model element - conditions to be maintained as
    true
  • is shown as a text string in braces ( )
  • a predefined language for writing constraints is
    OCL
  • a user-defined constraint is described in words
    in a given language
  • Stereotypes ltltinvariantgtgt, ltltpostconditiongtgt,
    ltltpreconditiongtgt
  • Comment
  • a text string attached directly to a model
    element.
  • attaches arbitrary textual information to any
    model element
  • Stereotypes ltltrequirementgtgt,ltltresponsibilitygtgt

18
  • Example (constraints comments)

19
  • Tagged values
  • a mechanism to define new element properties
  • a property is a value attached to a model element
  • a keyword-value pair gt tag-value
  • Example
  • author Joe Smith, deadline 31-March-1997,
    status analysis or abstract
  • Stereotype
  • built-in extensibility mechanisms of UML
  • a new class (subclass of an existing ) of
    modelling elements introduced at modelling time
  • notation
  • a key-word string (within guillemets,e.g. foo.)
  • a special graphic icon

20
  • Example (of stereotypes)

21
Static structure diagrams
  • Class diagrams
  • show the static structure of the model,
  • contain classes, interfaces, packages,
    relationships
  • also known as static structural diagrams
  • are organized into packages
  • Static object diagram
  • a graph of instances
  • an instance of a class diagram - a snapshot of
    the state of a system at a point in time
  • shows examples of data structures

22
  • Concepts to be discusssed
  • Class
  • Attribute and Operation
  • Interface, Parameterized class, Utility
  • Type vs. Implementation class
  • Importing a package
  • Object
  • Bin, N-ary Association
  • Association end, Aggregation, Composition,
    Multiplicity, Qualifier, Association class
  • Generalization
  • Dependency
  • Derived element

23
  • Class
  • the descriptor for a set of objects with similar
    structure, behavior, and relationships
  • represents a concept within the modeled system
  • classes have data structure and behavior and
    relationships to other elements
  • the name of a class has scope within the package
    in which it is declared gt the name must be
    unique
  • Notation
  • rectangle with 3 compartments
  • name and general properties, attributes,
    operations
  • a reference to a class gt Package-nameClass-name

24
  • Example (of classes)

25
  • Attribute
  • is semantically equivalent to a composition
    association (the intent and usage is normally
    different)
  • Notation
  • visibility name multiplicity type default
    property-string
  • visibility public, protected, - private
  • property-string indicates property values, e.g.
  • frozen - a nonchangeable attribute
  • a class-scope attribute - underlined or preceded
    with
  • multiplicity
  • if absent an attribute holds exactly 1 value
  • e.g. name 0..1 String (permits a distinction
    between the null value and the empty string)

26
  • Operation
  • a service that an instance of the class may be
    requested to perform
  • Notation
  • visibility name ( parameter-list ) return
    property-string
  • parameter-list is a comma-separated list of
  • kind name type-expression default-value
  • kind is in, out, or inout, with the default in if
    absent
  • property-string indicates property values, e.g.
  • query - operation does not modify the system
    state
  • sequential, guarded, concurrent
  • abstract - the class does not implement the
    operation
  • stereotype signal indicates that the class
    accepts the given signal (with operation name)

27
  • Type vs. Implementation class
  • Type
  • is a specification of externally visible
    behavior of a set of objects
  • Implementation Class
  • defines the physical data structure and
    procedures of an object
  • an object may have multiple Types but only one
    Implementation Class (which is fixed)
  • the implementation of a type by an implementation
    class is modeled as the Realizes relationship
    (this implies inheritence of operations, not of
    structure)

28
  • Example (of a type and impl. class)

29
  • Interface
  • is a specifier for the externally-visible
    operations of a class, component, or other entity
    (e.g. packages)
  • does not have implementation
  • may have generalization relationships
  • Example

30
  • Parameterized class Bound element
  • Template
  • the descriptor for a class with unbound formal
    parameters
  • defines a family of classes (but, is not a
    directly-usable class)
  • attributes and operations are defined in terms of
    the parameters
  • Bound element
  • templates parameters are bound to actual values.
  • fully specified by its template (content may not
    be extended)
  • Example

31
  • Utility
  • is a grouping of global variables and procedures
  • attributes and operations are interpreted as
    being at class scope
  • Example
  • Metaclass
  • is a class whose instances are classes
  • shown as the stereotype metaclass of Class

32
  • Importing a package
  • the contents of the target packages (and its
    sub-packages) may be referenced by the client
    package
  • does not modify the namespace of the client
  • the visibilities are combined according to the
    rule that the most restrictive visibility in the
    set is obtained
  • represented by imports dependency relation
  • Example

33
  • Object
  • represents a particular instance of a class
  • has identity and attribute values
  • Example

34
  • Binary Association
  • is an association among exactly two classes
    (including a reflexive association)
  • predefined constraints, e.g. or
  • Notation
  • consists of
  • association ends (2), name, association class
    (optional)
  • Example

35
  • Association end
  • an end of an association where it connects to a
    class
  • each association has two or more ends
  • Notation
  • kinds of adornments of an association end
  • multiplicity
  • ordering
  • the set of related elements can be
    ordered,unordered
  • qualifier
  • navigability
  • aggregation (a diamond)
  • rolename
  • indicates the role played by the class
  • changeability of the links, e.g. frozen or
    addOnly
  • visibility

36
  • Aggregation and composition
  • aggregation (a diamond)
  • a whole-part relationship
  • also treated as an ownership by reference
  • composition (a filled-diamond
  • aggregation with strong ownership and coincident
    lifetime as part of the whole
  • parts
  • may be created after the composite itself
  • they live and die within the whole
  • can be explicitly removed before the death of
    the whole
  • the multiplicity of the aggregate end may not
    exceed one (it is unshared)
  • also treated as an ownership by value

37
  • Example (of an aggregation and composition)

38
  • Multiplicity
  • specifies the range of allowable cardinalities
    that a set may assume
  • a comma-separated sequence of integer intervals
  • lower-bound .. upper-bound, a number, - many
  • Qualifier
  • an attribute or list of attributes whose values
    serve to partition the set of objects associated
    with an object across an association
  • multiplicity
  • 0..1 - a unique value may be selected, but
    every possible qualifier value does not
    necessarily select a value
  • 1 - every possible qualifier value selects a
    unique target
  • - the qualifier value is an index that
    partitions the target objects into subsets

39
  • Example (of a qualifier)

40
  • Association class
  • an association that also has class properties
  • it is a single model element (association
    linked class)
  • Example

41
  • N-ary association
  • an association among 3 or more classes
  • may not contain the aggregation marker
  • Example
  • This example shows the record of a team in each
    season with a particular goalkeeper.The
    goalkeeper might be traded during the season and
    can therefore appear with different teams.

42
  • Generalization
  • taxonomic relationship between a more general
    element and a more specific element that is fully
    consistent with the first element and that adds
    additional information.
  • Notation
  • discriminator
  • the name of a partition of the subtypes of the
    superclass.
  • constraints
  • overlapping - inheritence from more subclasses
    allowed
  • disjoint - inheritence from more subclasses NOT
    allowed
  • complete - all subclasses have been specified
  • incomplete - there are additional subclasses
    that are not yet in the model

43
  • Example (of a generalization)

44
  • Dependency
  • indicates a semantic relationship between two (or
    more) model elements
  • predefined kinds
  • trace - connects the same concept at different
    levels of meaning (history)
  • refine
  • uses - operation calling, instantiating, etc.
  • bind - binding of template parameters to actual
    values
  • Example

45
  • Derived element
  • is one that can be computed from another one
  • is shown for clarity or for design purposes
  • adds no semantic information
  • Example

46
  • Process of static structure modelling
  • Identify classes
  • from Glossary
  • from Business Model
  • stored information items
  • from use case realizations
  • Specify the semantics of classes
  • responsibility
  • attributes, operations and interfaces
  • Identify relationships among classes
  • domain based associations
  • object interactions
  • generalization and aggregation relationships
  • Structure the model into packages

47
Interaction diagrams
  • Sequence siagrams
  • Collaboration diagram
  • show a pattern of interaction among objects
  • they express similar information but show it in
    different ways
  • Multiobject
  • Message flow

48
  • Sequence siagrams
  • show an interaction arranged in time sequence
  • show the sequence of messages exchanged among
    objects
  • for real-time specifications and complex
    scenarios
  • Collaboration diagram
  • represents a Collaboration and an Interaction
  • Collaboration
  • a set of objects related in a particular context
  • context is a collaboration diagram without
    messages
  • Interaction
  • a set of messages exchanged among the objects
    within a collaboration to effect a desired
    operation or result.
  • shows an interaction organized around the objects
  • does not show time as a separate dimension
  • may be attached to an operation or a use case

49
  • Example (of a scenario diagram)

50
  • Example (of a collaboration diagram)

51
  • Multiobject
  • represents a set of objects
  • used to show operations that address the entire
    set, rather than a single object in it
  • Example

52
  • Message flow
  • the sending of a message from one object to
    another
  • shown as a labeled arrow placed near a link
  • kinds of messages (control flow type)
  • procedure call, asynchronous, synchronous
  • balking, time-out, ...
  • Notation
  • predecessor guard sequence-expression iteration
    return-value message-name argument-ist
  • predecessor - list of sequence numbers
  • the message flow is not enabled until all of the
    listed messages have occured
  • represents a synchronization of threads
  • gurad - condition clause
  • iteration - iteration clause

53
  • Example (of message flows)
  • 2 display (x, y) simple message
  • 1.3.1 p find(specs) nested call with return
    value
  • x lt 0 4 invert (x, color) conditional message
  • A3,B4/ C3.1 update () synchronization,iteration

54
  • Process of interaction modeling
  • Identify objects participating in the
    collaboration
  • Trace an interaction (scenario or algorithm) and
    add messages and links
  • Specify synchronization (if needed)

55
Statechart diagrams
  • State
  • Composite states
  • Event
  • Simple and complex transitions
  • History

56
  • Statechart diagram
  • shows the sequences of states that an object goes
    through during its life in response to received
    stimuli
  • a state machine is attached to a class or a
    method
  • Example

57
  • State
  • a condition during the life of an object during
    which performs some action, or waits for some
    event
  • Notation
  • name
  • internal transitions
  • activities performed in response to events
    received while the object is in the state,
    without changing state
  • event-name argument-list condition / action
  • special (predefined) events
  • entry / action action performed on entry to the
    state
  • exit / action action performed on exit from the
    state
  • do / action action performed during the state
  • action
  • action name
  • target.event(arguments)

58
  • Example (of states)

59
  • Composite states
  • a state can be decomposed using (one of these)
  • and-relationships into concurrent substates
  • or-relationships into mutually exclusive disjoint
    substates

60
  • Example (of composite states)

61
  • Event
  • an occurrence that may trigger a state transition
  • kinds of events
  • ChangeEvent -occurs whenever the value of the
    expression changes from false to true
  • SignalEvent - receipt of an explicit signal
  • CallEvent - receipt of a call for an operation
  • TimeEvent - passage of a designated period of
    time
  • Notation
  • event-name ( parameter-list)
  • Example
  • when (balance lt 0)
  • after (5 seconds)

62
  • Simple transition
  • a relationship between two states indicating that
    an object in the first state will enter the
    second state and perform certain specified
    actions when a specified event occurs if
    specified conditions are satisfied
  • the trigger for a transition is the occurrence of
    the event labeling the transition
  • Notation
  • even( parameters) condition / action
    target.event(parameters)
  • Example
  • right-mouse-down (location) location in window
    / object pick-object (location)
    object.highlight ()

63
  • Complex transition
  • may have multiple source states and target states
  • represents a synchronization and/or a splitting
    of control into concurrent threads without
    concurrent substates
  • is enabled when all of the source states are
    occupied
  • fires all of its destination states are occupied
  • Example

64
  • History
  • a state region may contain a history state
    indicator
  • may have any number of incoming transitions
  • may have at most one outgoing unlabeled
    transition (default previous state)
  • transition to the history indicator indicates
    that the object resumes the state it last had
    within the complex region
  • kinds of history indicator
  • shallow history
  • object resumes the state it last had at the same
    level as the history indicator
  • deep history (indicated by H)
  • object resumes the state it last had at any depth

65
  • Example (of a history)

66
  • Process of statechart modeling
  • Identify states
  • Identify external events which can cause change
    of status
  • To each state attach transitions based on events
  • Add transition and internal actions
  • Identify AND/OR substates

67
Activity diagrams
  • Action state
  • Decision and Merge
  • Swimlanes
  • Object flow relationship
  • Controll icons

68
  • Activity diagram
  • a variation of a state machine in which the
    states are Activities representing the
    performance of operations and the transitions are
    triggered by the completion of the operations
  • is attached to a class or to the implementation
    of an operation or a use case
  • the purpose is to focus on flows driven by
    internal processing (as opposed to external
    events)
  • use activity diagrams in situations where all of
    the events represent the completion of
    internally-generated actions (that is, procedural
    flow of control)
  • use ordinary state diagrams in situations where
    asynchronous events occur

69
  • Example (of an activity diagram)

70
  • Action state
  • a state with an internal action and at least one
    outgoing transition representing the completion
    of the action
  • should not have internal transitions or outgoing
    transitions based on explicit events
  • the normal use is to model a step of an algorithm
  • Action
  • represented by an action-expression
  • may use only attributes and links of the owning
    object

71
  • Decision and Merge
  • Decision
  • branching of transitions based on boolean
    conditions
  • may have a predefined guard "else"
  • transitions from the decision may not have an
    event trigger
  • Merge
  • used to merge decision branches back together
  • Example

72
  • Swimlanes
  • actions may be organized into swimlanes
  • kind of package for organizing responsibility for
    activities within a class
  • often correspond to organizational units in a
    business model
  • Object flow relationship
  • objects that are input to or output by an action
    may be shown as object symbols
  • the control flow (solid) arrows is omitted when
    the object flow (dashed) arrows is specified
  • frequently the same object is manipulated by a
    number of successive activities
  • to distinguish its various appearances, the state
    of the object may be supplied (in )

73
  • Example (of swimlanes and object flow)

74
  • Controll icons
  • provide explicit symbols for certain kinds of
    information that can be specified on transitions
  • are not necessary for constructing activity
    diagrams
  • Signal receipt
  • a dashed arrow may be drawn from the sender
  • Signal sending
  • A dashed arrow may be drawn from to the receiver
  • Deffered event
  • an event that occurs must be deferred for later
    use (durig some activity normally an event that
    is not handled immediately is lost.)
  • each state or activity specifies a set of events
    that are deferred
  • is shown within the state followed by / defer

75
  • Example (of control icons)

76
Implementation diagrams
  • Component diagram
  • Component
  • Deployment diagram
  • Processor
  • Device
  • Connection

77
  • Component diagram
  • shows the dependencies among software components,
    including source code components, binary code
    components, and executable components.
  • Component
  • represents a distributable piece of
    implementation of a system, including software
    code (source, binary, or executable) but also
    including business documents, etc., in a human
    system.
  • Stereotypes
  • ltltdocumentgtgt
  • ltltexecutablegtgt
  • ltltfilegtgt
  • ltltlibrarygtgt
  • ltlttablegtgt

78
  • Example (of component diagram)

79
  • Deployment diagram
  • shows the configuration of run-time processing
    elements and the software components, processes,
    and objects that live on them
  • Processor
  • a piece of HW capable to execute programs
  • may show a list of processes
  • Device
  • a piece of HW incapable of executing programs
  • Connection
  • HW (physical) connection between two nodes
  • the type of communication can be specified by a
    stereotype, e.g. ltltTCP/IPgtgt

80
  • Example (of a deployment diagram)

81
  • Links
  • www.rational.com
  • www.omg.org

82
  • Stereotypes
  • prevent explosion of modeling elements in UML
  • adding of semantically new elements, whithout
    changing the language
  • apply to model elements, not to instances
  • extensions to modeling language, not runtime
    environment

83
  • Stereotypable Elements
  • Static/Structure
  • Association (implicit,local, global,)
  • Generalization (implementation)
  • Dependency, Usage (call, create, send,
    instantiate), Abstraction (derive, realize,
    refine)
  • Class (type, interface, utility ), Attribute
  • Component (document, file, exe, library,)
  • Behavior
  • Method/Operation (create, destroy)
  • Collaborations, Flow, Interaction
  • Use cases
  • States (activity)
  • Supplementary
  • Comment
  • Constraint

84
(No Transcript)
85
(No Transcript)
86
(No Transcript)
87
(No Transcript)
88
Business Modeling Extension
89
Soft. Development Processes Extension
Write a Comment
User Comments (0)
About PowerShow.com