Systems Analysis and Design II - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

Systems Analysis and Design II

Description:

ringing tone. ringing signal. lift receiver. teller : Order : Article. Nested ... events cause the object to change from one state to another, along with its ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 34
Provided by: fredn152
Category:

less

Transcript and Presenter's Notes

Title: Systems Analysis and Design II


1
Systems Analysis and Design II
  • Behavioral Modeling

2
Outline 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

3
Dynamic 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

4
Dynamic 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

5
Sequence Diagram Syntax
AN ACTOR AN OBJECT A LIFELINE A FOCUS OF
CONTROL A MESSAGE OBJECT DESTRUCTION
anObjectaClass
aMessage()
x
6
Sequence diagram
7
Arrow 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)
8
Different kinds of arrows
9
Example Different Arrows
10
Heuristics 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.

11
Is 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
12
Communication 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

13
Example Communication Diagram
14
Communication Diagram
15
Creating 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.

16
Sequence and Communication Diagram Differences
17
Behavioral 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.

18
Statechart 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

19
State
  • 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

20
Behavioral State Machine Diagram Syntax
21
Example of a StateChart Diagram
22
Building 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

23
Modeling 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

24
Object and Threads
  • Passive objects depend on external power (thread
    of execution)
  • Active objects self-powered (own thread of
    execution)

25
Passive Objects Dynamic Semantics
  • Encapsulation does not protect the object from
    concurrency conflicts!
  • Explicit synchronization is still required

26
Synchronization
  • 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

27
Synchronization in Activity Diagrams
  • Forks and joins implies parallelism and
    synchronization
  • Joins waits for all flows to arrive (sync)

28
Convenience Features
  • Fork transitions can have guards.
  • Instead of doing this

29
Convenience 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.

30
Convenience Features
Signal
  • Signal send icon
  • translates to a transition with a send action.
  • Signal receipt icon
  • translates to a wait state (a state with no
    action and a signal trigger event).

31
Your 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?

32
Summary
  • 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.

33
More 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
Write a Comment
User Comments (0)
About PowerShow.com