Download presentation
Presentation is loading. Please wait.
Published byMaximilian Pearson Modified over 9 years ago
1
University of Utah SoCCS6961 - Lecture 121 Dynamic Models in Design CS6961 – Lecture 12 Nathan Dykman
2
University of Utah SoCCS6961 - Lecture 122 Dynamic Models To review, there are two major type of models in UML Static models –Use Case, Class, Component, Deployment Composite structure (mix of static/dynamic) Dynamic models –Sequence, State, Activity
3
University of Utah SoCCS6961 - Lecture 123 Dynamic Models Dynamic modeling is often overlooked in the design process –Why is this, do you think? Using dynamic models comes down to balance: –Too little: Critical dynamic details may be missed –Too much: Overwhelming detail
4
University of Utah SoCCS6961 - Lecture 124 Dynamic Modeling I think dynamic models are best used in two ways: –Exploratory: Does this design do what we want, how could it do it? –Descriptive: This is a tricky aspect of the system, this model (should) help explain what is going on
5
University of Utah SoCCS6961 - Lecture 125 Dynamic Modeling Traps Unfortunately, dynamic models are easy to overuse –For example, requiring a state diagram for every class Not surprising, most of these diagrams aren’t helpful –Or activity diagram, or sequence diagram, etc. Therefore, some avoid them completely –Missing out where they are useful.
6
University of Utah SoCCS6961 - Lecture 126 Dynamic Modeling Domains However, in some software domains, these kinds of models are critical: –Embedded Systems: Must have predictable, reactive behavior –Telecommunications: Strict protocol requirements –Service Oriented Applications: Conversations, Transactions very important. –And so on.
7
University of Utah SoCCS6961 - Lecture 127 UML 2.0 Example
8
University of Utah SoCCS6961 - Lecture 128 Sequence Diagram Hopefully, all of you recognized the preceding diagram as a sequence diagram –If not, review chapter 4 of UML Distilled. In design, the messages can be actual method calls –Because the instances on the sequence diagram are class instances
9
University of Utah SoCCS6961 - Lecture 129 Sequence Diagrams Are probably the most popular means of showing interaction between objects in UML –Communication Diagrams are still preferred by some (not me) Remember, UML 2.0 added interaction frames –Which added to the expressiveness of sequence models.
10
University of Utah SoCCS6961 - Lecture 1210 Sequence Diagrams It is often useful to take select use cases and build a sequence diagram in the design that reflects the use case –Insures that the design does cover use case functionality –Doesn’t need to be perfect, but enough detail to verify that the use case can be performed as required.
11
University of Utah SoCCS6961 - Lecture 1211 Sequence Diagrams Complex systems often contain quite a bit of messaging –For example, most web systems pass between multiple classes (and layers) to process/render web pages Sequence diagrams can show this interaction fairly well –Examples show how the flow of messages is structured.
12
University of Utah SoCCS6961 - Lecture 1212 UML 2.0 Example Action/ Activity Decision Point Fork/Join Activity with Sub-activity model
13
University of Utah SoCCS6961 - Lecture 1213 Activity Diagrams This is an activity diagram. –We will cover activity models in more detail For now: –Easy modeling of parallelism –Activities can nest (have sub-structure) –We will cover how to link activity models to classes As well as execution in general.
14
University of Utah SoCCS6961 - Lecture 1214 Activity Diagrams I find activity diagrams best used to model large scale workflow in the system –Workflow is a topic in of itself, of course Workflows are more common in systems with longer-standing transactions –For example, maintaining a relationship with a shipping office, a supplier of goods, a long- term customer, etc.
15
University of Utah SoCCS6961 - Lecture 1215 Activity Diagrams Again, activity diagrams should feel forced –They should pop out naturally to you Also, remember that activity diagrams display parallel/concurrent behaviors –Sequence diagrams don’t do this nearly as well. Activities can be linked to use cases –For example, a use case can become an activity (or activities) in a system.
16
University of Utah SoCCS6961 - Lecture 1216 State Example
17
University of Utah SoCCS6961 - Lecture 1217 State Diagram Again, more details to come. But for now, note the following: –We have states. States can nest, or have their own state machine –We have start states (final states as well) –Substates (or complex states) can have multiple entry/exit states Later, we will learn that these, like start/final states, are called pseudostates.
18
University of Utah SoCCS6961 - Lecture 1218 State Machines In some domains, state machines are rare –In embedded systems, they can be the most commonly used diagram Executable UML often centers around state diagrams –The state model in UML is quite complex Again, don’t force it –But sometimes, it is a very useful abstraction to use. (So, don’t ignore it completely)
19
University of Utah SoCCS6961 - Lecture 1219 Pushing the Edges For those interested in how dynamic models are used in real-time systems, check out: –Real Time UML (3 rd Edition), by Bruce Powell Douglas –You can get access to real-time tools from Telelogic, iLogix, IBM/Rational if you liked All require the use of a license server.
20
University of Utah SoCCS6961 - Lecture 1220 Dynamic Models Tools like RSA tools do very little with dynamic models –You need a special modeling tool to do code generation from state machines, etc. These are very complex tools –Some tools are starting to do forward and reverse engineering of sequence diagrams RSA is supposed to do this for Java, no clue if it really does
21
University of Utah SoCCS6961 - Lecture 1221 Summary Next Time, we go into more details –This may include exercises! –Be warned. Reading: Chap. 4, 10, 11 in UML Distilled.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.