1 / 31

Dynamic Modeling

Dynamic Modeling. for real-time issues other complex systµems also use it. Active Classes and Objects. own an execution thread, i.e. can initiate control activity by own code sending messages can execute concurrently

qamra
Télécharger la présentation

Dynamic Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dynamic Modeling • for real-time issues • other complex systµems also use it

  2. Active Classes and Objects • own an execution thread, i.e. can initiate control activity by • own code • sending messages • can execute concurrently • passive class instance can execute only when some other object performs some operation on it (sends a message to it)

  3. Active Class Implementation • typically impl’d as process or thread • class library with • superclass or • interface that can be implemented that maps process/thread operations e.g. start, stop, suspend, resume, priority handling to operating system calls

  4. Active Object Interactions • issues • communication between active objects • usage of shared resources • often package/component controlled by an active object • much more passive than active objects(active need much more resources from the system)

  5. Active Object Internal Structure • internal classes can be both active and passive

  6. Communication • asynchronous • unpredictablean event can occur at any time • synchronous • events can occur only at specified times(can be found when by reading the code) • typical of passive objectsone object sends a message(calls an operation) and waits till that executes (maybe a value is returned (return value))

  7. Communication (2) of active objects • operation call, i.e. synchronous message • mailbox/message queuealso called publish/subscribe modelasynchronous messages • shared memoryaccess to be guarded • rendezvous • RPC (remote procedure call) • calling thread identifies operation in an object • request is furthered to RPC library • RPC finds the object in the network • request is sent over the network • receiving side receives and translates the format and then makes a call • when call is finished, the result is returned in a similar manner

  8. Events and Triggers • event • The specification of a significant occurrence that has a location in time and space and can cause the execution of an associated behavior. In the context of state diagrams, an event is an occurrence that can trigger a transition. • signal • The specification of an asynchronous stimulus that triggers a reaction in the receiver in an asynchronous way and without a reply. The receiving object handles the signal as specified by its receptions. The data carried by a send request and passed to it by the occurrence of the send invocation event that caused the request is represented as attributes of the signal instance. A signal is defined independently of the classifiers handling the signal.

  9. Trigger Types • Changea Boolean expression becomes truee.g. guard condition(triggers even if the expression later becomes false) • Signalreceipt of async signal, i.e.AcceptEventAction • Callof an operation (other’s or own)considered as synchronous message • Timea specified amount of time has passedalso absolute time (e.g. tax-report deadline)

  10. Signals • signala classifier passed between objects for communication • can have attibutes and operations (information, behavior) • passed asynchronously in the system • as a classifier can use Class notation, see e.g. hierarchy of signal classes

  11. Message • objects interact thru messages • can be implemented by • operation call • signal put into a mailbox or a queue

  12. Message Types • reception of message represents an event that can trigger a behaviour kinds • Synchronous • wait semantics, i.e. sender waits for handlingtypically a method call • Reply • shows return message from another message • Create • call of a constructor • Asynchronous • no-wait semantics; no explicit return to caller;allows concurrency

  13. Message Types(cont’d) • Lost • sender is know, but there is no reception • allows dynamic models to be built from fragments • Found • receiver know, but sender is unknown • balking • msg sent only if receiver is ready to accept it • time-out • canceled if not handled within a specified amount of time

  14. Synchronization and Concurrency Issues • incorrect shared access - mutual exclusion necessary • inefficient resource usage • e.g. busy-wait loop • deadlock • starvation – incorrect priority assignment • priority inversion • happens when resources are locked for exclusive use • a lower-priority object holds resources needed by a higher-priority object, i.e. causes stalling/blocking

  15. Synchronization and Concurrency (cont’d) Synchronization mechanisms • Guard mechanisms • semaphores, monitors, critical regions • Scheduling algorithm • Set priorities, other parameters • Supervisor thread • Active objects • priority as tagged value • Concurrency requirements of a class • sequential, guarded, concurrent • stereotype <<semaphore>>

  16. Fault Tolerance ability of system to function in presence of HW and SW failures. A number of techniques to help achieve it • Error and exception handling • built into many languages; can be modeled in activity diagrams, state machines, sequence diagrams; • Multiple Systems • supervisor process monitoring; • Formal proofs • UML ”united with” such methods

  17. Sequence Diagram withTiming Indicator and Constraint • time expression • write-once attibute • t=now • e.g. bid is not accepted after closing time

  18. Sequence Diagram withDurations and Timing Constraints • duration

  19. Streaming Input and Output Example • stream: like a conveyor belt • exception: triangle • {weight=12} indicates that 12 are needed before the next action can execute

  20. Activity Diagram

  21. House Alarm SystemSensors

  22. House Alarm SystemAlarms

  23. House Alarm SystemActive and Passive Objects

  24. House Alarm SystemSignal Hierarchy

  25. House Alarm SystemDetailed Activity Diagram with Message Handling

  26. House Alarm SystemCommunication Diagram

  27. House Alarm System(HAS)Sequence Diagram

  28. House Alarm System(HAS)Strict Sequencing and Parallel Merge

  29. House Alarm System(HAS)Critical Region

  30. Timing Diagram

  31. State Machine Regions and Concurrency

More Related