Docstoc

Behavioral Modeling with UML - PowerPoint

Document Sample
Behavioral Modeling with UML - PowerPoint Powered By Docstoc
					Aktivitätsdiagramme
Activity Diagram Applications
Intended for applications that need control
flow or object/data flow models …
... rather than event-driven models like state
machines.
For example: business process modeling
and workflow.
The difference in the three models is how a
step in a process is initiated, especially with
respect to how the step gets its inputs.

               Behavioral Modeling with UML       2
        Control Flow
            Each step is taken when the previous one finishes
            …regardless of whether inputs are available,
            accurate, or complete.
            Emphasis is on order in which steps are taken.

                       Start
                                                                Weather Info

                                 Analyze Weather Info



Not UML
                Start Trip                                    Cancel Trip
Notation!



                               Behavioral Modeling with UML                    3
       Object/Data Flow
           Each step is taken when all the required input
           objects/data are available …
           … and only when all the inputs are available.
           Emphasis is on objects flowing between steps.

               Design Product                                  Acquire Capital


                                          Procure
                                          Materials



                           Build                          Build
                       Subassembly 1                  Subassembly 2




Not UML                                     Final
                                          Assembly
Notation
                                Behavioral Modeling with UML                     4
           State Machine
                 Each step is taken when events are
                 detected by the machine …
                 … using inputs given by the event.
                 Emphasis is on reacting to environment.
                                  Ready To Start
       Coin
     Deposited

                                 Ready For Order
     Selection
                                                                 Cancel Button
      Made
                                                                   Pressed

                    Dispense                            Return
                    Product                             Change

Not UML
Notation
                               Behavioral Modeling with UML                      5
Kinds of Steps in Activity Diagrams

  Action (State)                  Action




  Subactivity (State)             Subactivity



  Just like their state machine counterparts
  (simple state and submachine state) except
  that ...
  ... transitions coming out of them are taken
  when the step is finished, rather than being
  triggered by a external event, ...
  ... and they support dynamic concurrency.

               Behavioral Modeling with UML      6
Action (State)

                         Action


An action is used for anything that does not
directly start another activity graph, like invoking
an operation on an object, or running a user-
specified action.

However, an action can invoke an operation that
has another activity graph as a method (possible
polymorphism).


                Behavioral Modeling with UML           7
Subactivity (State)
                      Subactivity


A subactivity (state) starts another activity graph
without using an operation.

Used for functional decomposition, non-
polymorphic applications, like many workflow
systems.

The invoked activity graph can be used by many
subactivity states.

                Behavioral Modeling with UML          8
     Example

POEmployee.sortMail                              Deliver Mail




                                               Deliver Mail
  POEmployee

  sortMail()                    Check Out                       Put Mail
                                  Truck                         In Boxes




                      Behavioral Modeling with UML                         9
      Activity Graph as Method

POEmployee.sortMail                            POEmployee.deliverMail



POEmployee
                                        PO Employee Deliver Mail Method
sortMail()
                 «realize»
deliverMail()                         Check Out                  Put Mail
                                        Truck                    In Boxes



       THE model (application) is completely OO when
       all action states invoke operations, and all
       activity graphs are methods for operations.
                             Behavioral Modeling with UML                   10
 Dynamic concurrency
                    Action/Subactivity            *

Invokes an action or subactivity any number of times in
parallel, as determined by an expression evaluated at
runtime..
Upper right-hand corner shows a multiplicity restricting the
number of parallel invocations.
Outgoing transition triggered when all invocations are done.
Currently no standard notation for concurrency expression
or how arguments are accessed by actions. Attach a note as
workaround for expression.


                   Behavioral Modeling with UML                11
Object Flow (State)
                           Class
                          [State]


A special sort of step (state) that represents the
availability of a particular kind of object, perhaps
in a particular state.

No action or subactivity is invoked and control
passes immediately to the next step (state).

Places constraints on input and output parameters
of steps before and after it.
                 Behavioral Modeling with UML          12
Object Flow (State)
                          Order
 Take Order                                   Fill Order
                         [Taken]


Take Order must have an output parameter
giving an order, or one of its subtypes.

Fill Order must have an input parameter taking
an order, or one of its supertypes.

Dashed lines used with object flow have the
same semantics as any other state transition.

               Behavioral Modeling with UML                13
Coordinating Steps

Inherited from state machines

Initial state

Final state

Fork and join


                Behavioral Modeling with UML   14
 Coordinating Steps
       Decision point and merge (       )
       are inherited from state machines.
       For modeling conventional flow
       chart decisions.

Calculate      [cost < $50]                     Charge
  Cost                                          Account
             [cost >= $50]




                          Get
                      Authorization


                 Behavioral Modeling with UML             15
           Coordinating Steps
              Synch state (       ) is inherited from state
              machines but used mostly in activity graphs.
              Provides communication capability between
              parallel processes.
State
machine                                        Put                       Install
                  Build
notation          Frame                         On                        Walls
                                               Roof

   Install
                                                                                   Inspect
 Foundation                                                      *
                                   *


                      Install                   Install
                                                                       Install
                    Electricity               Electricity
                                                                     Electricity
                  in Foundation               In Frame
                                                                      Outside




                                  Behavioral Modeling with UML                        16
   Convenience Features (Synch State)
               Forks and joins do not require composite
               states.
               Synch states may be omitted for the
               common case (unlimited bound and one
               incoming and outgoing transition).
Activity
diagram          Build                 Put
                                                                    Install
                 Frame                  On
notation                               Roof
                                                                     Walls

    Install                                                                   Inspect
  Foundation



                     Install                    Install           Install
                   Electricity                Electricity       Electricity
                 in Foundation                In Frame           Outside


                                 Behavioral Modeling with UML                    17
Convenience Features (Synch State)
   Object flow states can be synch states

      A11                A12                  A13


                         Obj
                         [S2]


      A21                A22                  A23




               Behavioral Modeling with UML         18
Convenience Features
Fork transitions can have guards.
                                   Evaluate             Revise
             [ priority = 1]
                                    Impact               Plan

  Register                                                          Release
    Bug                                                               Fix
                                        Fix              Test
                                        Bug              Fix



Instead of doing this:
                   [ priority = 1]        Evaluate        Revise
                                           Impact          Plan

    Register                                                         Release
                               [else]
      Bug                                                              Fix


                                          Fix                Test
                                          Bug                Fix


                                  Behavioral Modeling with UML                 19
      Convenience Features
          Partitions are a grouping mechanism.
          Swimlanes are the notation for partitions.
          They do not provide domain-specific semantics.
          Tools can generate swimlane presentation from
          domain-specific information without partitions.

Management
                                    Evaluate              Revise
                                     Impact                Plan
                 [ priority = 1]

Support
          Register                                                 Release
            Bug                                                      Fix


Engineering
                                       Fix                 Test
                                       Bug                 Fix


                                   Behavioral Modeling with UML              20
  Convenience Features
Signal send icon
                                                       Wake Up
       Signal



… translates to a transition                      Turn on Coffee Pot
with a send action.
                                                       Get Cups        Coffee
                                                                        Pot
Signal receipt icon
      Signal
                                                    Coffee Done

… translates to a wait state
(an state with no action and
a signal trigger event).                             Drink Coffee




                   Behavioral Modeling with UML                         21
                                                                               partition


                                   Submission Team                            Task Force            Revision Task Force


                                                                                                  initial state
                            action state       control flow


                                                                             Begin

                                                                                                  fork of control
Case Study

                                       Develop
                                     technology                           Issue RFP
                                    specification

                                                          RFP
                                                        [issued]
                            conditional
                            fork                                               join of control


                                      Submit
                                    specification
                                       draft                                   object flow


                                                      Specification
                                [optional]                                     input value
                                                         [initial
                                                       proposal]
                                   Collaborate with
                                     competitive
Communications of the ACM




                                     submitters
                                                                       Evaluate initial
                                                                        submissions
Kobryn, “UML 2001”




                                      Finalize
October 1999
Adapted from




                                    specification
                                                      Specification
                                                         [final
                                                       proposal]
                                                                   Behavioral Modeling with UML                           22
                            Collaborate with
                              competitive
                              submitters                          Evaluate initial
                                                                   submissions



                               Finalize
                             specification
                                               Specification
                                                  [final
                                                proposal]
Case Study

                                                                  Evaluate final
                                                                  submissions




                                                                     Vote to
                                                                   recommend
                                                                                                              guard


                              Specification                    [YES]            [NO]
                               [adopted]
                                                                                                              decision


                                                                                                                   Revise
                                                                                                                 specification
                               Implement
                              specification
Communications of the ACM




                                                                                              Specification
                                                                                                [revised]
                                                                     Enhance
                                                                                                                 Recommend
                                                                   specification
                                                                                                                   revision
Kobryn, “UML 2001”

October 1999
Adapted from




                                                                       [else]    [Enhanced]

                                                                                                              final state
                                                         Behavioral Modeling with UML                                            23
When to Use Activity Diagrams
  Use activity diagrams when the behavior
  you are modeling ...
     does not depend much on external events.
     mostly has steps that run to completion,
      rather than being interrupted by events.
     requires object/data flow between steps.
     is being constructed at a stage when you are
      more concerned with which activities happen,
      rather than which objects are responsible for
      them (except partitions possibly).


                Behavioral Modeling with UML          24
Activity Diagram Modeling Tips
Control flow and object flow are not
separate. Both are modeled with state
transitions.

Dashed object flow lines are also
control flow.

You can mix state machine and
control/object flow constructs on the
same diagram (though you probably do
not want to).
             Behavioral Modeling with UML   25
         Activity Diagram Modeling Tips

From UML      Customer     Telesales          Accounting   Warehouse
User Guide:

              Request
              Return
                           Get Return
                            Number

              Ship Item

                                                            Receive
                                                             Item

                 Item
              [returned]
                                                            Restock
                                                             Item



                                                Credit       Item
                                               Account     [available]




                           Behavioral Modeling with UML                  26
                         Customer      Telesales          Accounting   Warehouse



                          Request
                          Return
                                       Get Return
                                        Number

                          Ship Item
Activity Modeling Tips




                                                                        Receive
                            Item                                         Item
                         [returned]




                                                                        Restock
                                                                         Item




                                                             Credit
                                                            Account       Item
                                                                        [available]




                                      Behavioral Modeling with UML                    27
 Activity Diagram Modeling Tips

Activity diagrams inherit from state machines the
requirement for well-structured nesting of
composite states.

This means you should either model as if
composite states were there by matching all
forks/decisions with a correspond join/merges …

… or check that the diagram can be translated to
one that is well-nested.

This insures that diagram is executable under state
machine semantics.

                Behavioral Modeling with UML          28
      Activity Diagram Modeling Tips

Well-nested:




                 Behavioral Modeling with UML   29
     Activity Diagram Modeling Tips

Not well-nested:




Apply structured coding principles. (Be careful with goto’s!)



                        Behavioral Modeling with UML            30
      Activity Diagram Modeling Tips

Can be translated to well-nested
diagram on earlier slide:




                          Behavioral Modeling with UML   31
     Anwendungsbeispiel



Geschäftsprozessmodellierung
Behavioral Modeling with UML   33
   Models of Business Processes
UML became the standard modeling language for business processes.
Of the 9 UML diagram types, 3 are particularly important:
       use cases,
       activity diagrams and
       scenarios (sequence or colaboration diagrams).

Use cases show informally how the business process interacts
with outside actors (customers, stakeholders, suppliers etc.)

The process dynamics is modeled by activity diagrams.

Often only specific scenarios are of interest. E.g. service monitoring,
system reconfiguration, performance degradation etc.

                          Behavioral Modeling with UML              34
A Use Case

              Room Reservation


                    WEB
                              <<extends>>
  John
                                Reservation
                                  System


                                 <<includes>>


                     Hotel
                     Desk           Room
                                    Service
                     <<extends>>
     Markus
                 Behavioral Modeling with UML   35
Activity Diagrams
Activity diagrams constitute the core of a business model.

 Activity Diagram: state transition diagram with
                   concurrent states (Statechart)

 Activity:          state with internal action

 BPM:               activity = Mealy state


        input                         event
         data
                         action                        agent
       output
        data
                        Behavioral Modeling with UML           36
Behavioral Modeling with UML   37
A UML Business Process Model: Different Views




          Behavioral Modeling with UML          38
Behavioral Modeling with UML   39

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:8/21/2011
language:English
pages:39