Dynamic Model • Show the temporal order of operations • Control model • Show the sequence of operations that occur in response to external stimuli • Do not worry about • what operations do • what they operate on • how they are implemented
Dynamic Model • Consists of multiple state diagrams • One for each class with important dynamic behavior • Shows • states of objects and activities performed in states • conditions under which events cause transitions • transitions and actions produced by events
Terminology • States - determined by the values of an object’s attributes and links • have a duration in time • may be associated with activities • Activities - operations performed by an object • take time to complete
Terminology • Events - external stimuli • instantaneous • may produce state transitions • may produce actions • Conditions - boolean functions of object values • “guard” state transitions
Terminology • Actions - instantaneous operations performed by an object Triggered by • an event that produces a state transition • entering a state • exiting a state • an event that does not cause a state transition • soentry and exit actions are not performed
State 1 do:activity entry/action2 exit/action3 event/action4 State 2 . . . Graphical Notation Event(attrs)[cond]/ action1 Ordering of Actions • actions on incoming transition • entry action • activity and event action as appropriate • exit action • actions on outgoing transition
Ready do: monitor DDE msgs Example: Helper_App Registering entry/Register(mimetype, this) do: monitor DDE msgs DDE_exception Stop Ack/start_service DDE_exception IO_Exception Ack Ack ChangeURL(file, url)/ Send_file(file, url) Spawn_viewer(appname, file) Wait Changing URL
Nesting State Diagrams • Helps organize and modularize SDs • A way to manage complexity • Two forms of nesting • Refinement • add detail to a state • permits inheritance of transitions • Concurrency (aggregation) • aggregates objects, each with their own SDs
Substate-1 Notation for Refinement Superstate event 1 Substate-2 event 2 event 3
Registering entry/Register(mimetype, this) do: monitor DDE msgs Ready do: monitor DDE msgs Wait Example: Helper_App ChangeURL(file, url)/ Send_file(file, url) Spawn_viewer(. . .) IO_Exception Ack/start_service Ack Ack Changing URL DDE_exception Stop
Registering entry/Register(this) Ready Wait Example:Browser_Listener ChangeURL(file,url) [url/=lastUrl and type =HTML] / sendURL(url,frame) ChangeURL(file,url) [url=lastUrl or type/=HTML] Ack/ start_service Ack DDE_exception Stop
Substate-1 Substate-3 Substate-2 Substate-4 Notation for Concurrency Superstate event 1 event 2
Ready Example:Browser_Slave Frame_manager Rec_URL_manager Registering entry/Register(this) DDE_exception Wait RecURL(url,frame) / B_activate Ack/ start_service Stop Ack / B_OpenURL(url,frame) ChangeURL(file,url) / UpdateFrameVector (frame) Ack Ack Wait
Example: WEB Class Web_Student Browser_Wrapper Mreceiver Browser_Slave Web_Instructor Helper_App1 Browser_Wrapper Msender Browser_Listener ... Helper_App9
Dynamic Model: Creation Tips • Create SDs only for object classes with meaningful dynamic behavior • Check consistency between • SDs on shared activities • SDs and object model • Use scenarios to • Begin construction of SDs • Check completeness of SDs
Dynamic Model: Creation Tips (cont.) • Let application determine granularity • Distinguish between activities and actions • Make use of entry and exit actions for multiple transitions • Make use of nested SDs to reduce complexity • Distinguish SDs for super and subclasses
Functional Model • Describes computations within a system • Specifies what happens • Shows how output values are derived from input values • Is not concerned with when computations are performed • Consists of multiple data flow (DF) diagrams
Terminology • Process - transforms data values • Data flow - connects output of a process or object to the input of another process or obj • Actor - active object that drives the DF by producing or consuming data values • Data store - passive object that stores data for later use
Graphical Notation Process: Data flow between Processes: Process name data name Process name Process name Data store or file object: Data flow that results in a data store: Name of data store Name of data store
Graphical Notation (cont.) Actor objects (as source or sink of data: d1 Process name d2 Actor1 Actor2 Composition, duplication, and decomposition of data values: d1 d1 composite d1 composite d2 d2
Example: Banking application accounts Account Bank Select name balance request Customer Update
Functional Model: Creation Tips • Create FM only for objects/processes with meaningful data flow • Start simple • one process with correct inputs and outputs • Refine to next level by expanding the process • Continue to refine one process at a time • Check consistency between the inputs and outputs