Title: Systems Analysis and Design II
1Systems Analysis and Design II
2Outline of the course
- Process Model and Software Development Life Cycle
- Software Models and UML 2.0
- Analysis and Requirements
- Requirements elicitation
- Functional Models
- Structural Models
- Dynamic Models
- Design Basics and Software Architectures
- Business, Architecture and Runtime Patterns
- Implementation, Mapping the Design to Code
- Software Testing and Reliability
- Software Performance
- Project Management and Software Economics
3Dynamic Modeling with UML
- Diagrams for dynamic modeling
- Interaction diagrams describe the dynamic
behavior between objects - Statecharts describe the dynamic behavior of a
single object - Interaction diagrams
- Sequence Diagram
- Dynamic behavior of a set of objects arranged in
time sequence. - Good for real-time specifications and complex
scenarios - Collaboration Diagram
- Shows the relationship among objects. Does not
show time - State Chart Diagram
- A state machine that describes the response of an
object of a given class to the receipt of outside
stimuli (Events). - Activity Diagram A special type of statechart
diagram, where all states are action states
4Dynamic Modeling
- Definition of dynamic model
- A collection of multiple state chart diagrams,
one state chart diagram for each class with
important dynamic behavior. - Purpose
- Detect and supply methods for the object model
- How do we do this?
- Start with use case or scenario
- Model interaction between objects gt sequence
diagram - Model dynamic behavior of a single object gt
statechart diagram
5Sequence Diagram Syntax
AN ACTOR AN OBJECT A LIFELINE A FOCUS OF
CONTROL A MESSAGE OBJECT DESTRUCTION
anObjectaClass
aMessage()
x
6Sequence diagram
7Arrow label
predecessor sequence-expression return-value
message-name argument-list
move (5, 7)
Sequence numbering schema 1 actionA 1.1.
firstSubactionOfActionA 1.2.
secondSubactionOfActionA 1.3.
thirdSubactionOfActionA 2 actionB 2.1.
firstSubactionOfActionB 2.1.
secondSubactionOfActionB ...
3.7.4 move (5, 7)
3.1 res getLocation (fig)
8Different kinds of arrows
9Example Different Arrows
10Heuristics for Sequence Diagrams
- Layout
- 1st column Should correspond to the actor who
initiated the use case - 2nd column Should be a boundary object
- 3rd column Should be the control object that
manages the rest of the use case - Creation
- Control objects are created at the initiation of
a use case - Boundary objects are created by control objects
- Access
- Entity objects are accessed by control and
boundary objects, - Entity objects should never call boundary or
control objects This makes it easier to share
entity objects across use cases and makes entity
objects resilient against technology-induced
changes in boundary objects.
11Is this a good Sequence Diagram?
Seat
Onboard Computer
Smart Card
Establish Connection
- First column is not the actor
- It is not clear where the boundary object is
- It is not clear where the control object is
Establish Connection
Accept Connection
Accept Connection
Get SeatPosition
500,575,300
12Communication Diagrams
- Essentially an object diagram that shows message
passing relationships instead of aggregation or
generalization associations. - Emphasize the flow of messages among objects,
rather than timing and ordering of messages
13Example Communication Diagram
14Communication Diagram
15Creating Communication Diagrams
- 1. Set the context.
- 2. Identify which objects (actors) and the
associations between the objects participate in
the collaboration. - 3. Layout the communication diagram.
- 4. Add messages.
- 5. Validate the communication diagram.
16Sequence and Communication Diagram Differences
17Behavioral State Machines
- The behavioral state machine is a dynamic model
that shows the different states of the object and
what events cause the object to change from one
state to another, along with its responses and
actions.
18Statechart Diagrams
- Graph whose nodes are states and whose directed
arcs are transitions labeled by event names. - We distinguish between two types of operations in
statecharts - Activity Operation that takes time to complete
- associated with states
- Action Instantaneous operation
- associated with events
- associated with states (reduces drawing
complexity) Entry, Exit, Internal Action - A statechart diagram relates events and states
for one class - An object model with a set of objects has a
set of state diagrams
19State
- An abstraction of the attributes of a class
- State is the aggregation of several attributes a
class - Basically an equivalence class of all those
attribute values and links that do no need to be
distinguished as far as the control structure of
the system is concerned - Example State of a bank
- A bank is either solvent or insolvent
- State has duration
20Behavioral State Machine Diagram Syntax
21Example of a StateChart Diagram
22Building Behavioral State Machine Diagrams
- Set the context
- Identify the initial final, and stable states of
the object - Determine the order in which the object will pass
through stable states - Identify the events, actions, and guard
conditions associated with the transitions - Validate the statechart diagram
23Modeling Concurrency
- Process
- Independent address space.
- Execute concurrently with other processes.
- Threads
- Hidden inside a process.
- Not independently scheduled by OS
- Processes and threads run concurrently and
compete for shared resources
24Object and Threads
- Passive objects depend on external power (thread
of execution) - Active objects self-powered (own thread of
execution)
25Passive Objects Dynamic Semantics
- Encapsulation does not protect the object from
concurrency conflicts! - Explicit synchronization is still required
26Synchronization
- Active gt passive object communication lead to
multiple flows of control in one object at the
same time. - State corruption may occur ? need for mutual
exclusion. - Use synchronization to implement critical regions
27Synchronization in Activity Diagrams
- Forks and joins implies parallelism and
synchronization - Joins waits for all flows to arrive (sync)
28Convenience Features
- Fork transitions can have guards.
29Convenience Features
- Partitions are a grouping mechanism.
- Swimlanes are the notation for partitions
- They may represent an object or set of object
performing the contained actions. - They do not provide domain-specific semantics.
- Tools can generate swimlane view from
domain-specific information without partitions.
30Convenience Features
Signal
- translates to a transition with a send action.
- translates to a wait state (a state with no
action and a signal trigger event).
31Your Turn
- What distinguishes the sequence diagram, the
collaboration diagram, and the behavioral state
machine diagram? - For what sort of new applications might you need
to develop all of these? Are there any new
applications that would not need all of these
diagrams for full development?
32Summary
- Sequence diagrams illustrate the classes that
participate in a use case and the messages that
pass between them. - Collaboration diagrams provide a dynamic view of
the object-oriented system and accentuate message
passing between collaborating actors and objects. - Behavioral State Machine diagrams show the
different states that a single class passes
through in response to events.
33More info
- Each year the Association for Computing Machinery
(ACM) sponsors a conference on object oriented
programming. For details about future
conferences and other ACM programs check - http//oopsla.acm.org
- http//www.acm.org
- http//www.omg.org