Analysis-Dynamic-Modelling-03122024-015241pm
Analysis-Dynamic-Modelling-03122024-015241pm
Engineering
27
Outline of the Lecture
z Dynamic Modeling
z Mapping use cases to Objects with Sequence diagrams
z Modeling Interactions among Objects with CRC CARDS
z Identifying Associations
z Identifying Aggregates
z Identifying Attributes
z Modeling State-Dependent behavior of individual Objects
z Modeling Inheritance Relationships between Objects
z Reviewing the analysis model
28
Dynamic Modeling
29
Dynamic Modeling with UML
31
What is an Event?
32
Mapping Use Cases to Objects with Sequence Diagrams
33
UML First Pass: Sequence Diagram
Object
pressButton1() blinkHours()
pressButton1() blinkMinutes()
pressButton2() incrementMinutes()
refresh()
pressButtons1And2()
commitNewTime()
stopBlinking()
Message
Activation
Sequence diagrams represent the behavior as interactions
34
Example Sequence Diagram
press()
create()
create()
fillContents()
submit()
submitReport()
create()
submitReportToDispatcher()
35
Heuristics for drawing sequence diagrams
36
What else can we get out of sequence diagrams?
37
Modeling Interactions among Objects with CRC CARDS
Class name
Responsibilities Collaborators
ReportEmegencyControl
Incident
Responsibilities Collaborators
Responsibilities Collaborators
Collects input from Field- EmergencyReportForm
officer EmergencyReport Track all information Resource
Controls sequence of AcknowledgementNotrelated to a single inci-
forms during emegrency dent.
reporting
39
Identifying Associations
z Association
- Relationship between two or more
classes
An -to-many
z -One association
example of association between the
EmergencyReport and the FieldOfficer
classes.
EmergencyReport
FieldOfficer
1 writes *
author document
40
Identifying Associations
name:String name:String
One-to-one association
Many-to-many association
Mechanics Plane
* Work on *
41
Identifying Aggregation
42
Identifying Aggregation
Automobile
Engine serial number
1 year
horsepower manufacturer
model
volume
on color
off weight
drive
purchase
3,4,5 1
* 2,4
Wheel Brakelight Door Battery
diameter amps
number of bolts open volts
on close
off charge
discharge
43
Identifying Aggregation
z Aggregation
- Special types of associations; whole-part
relationship
- Existence ofAggregation
z Composition the parts depends on the
whole
z Shared Aggregation
State FireStation
County
FireFighter LeadCar
FireEngine Ambulance
Township
44
Identifying Attribute
z Attributes
- Proprieties of individual objects
z Attributes
- Name
- A brief description
- Type; legal values
EmergencyReport
emergencyType:{fire,traffic,other}
location:String
description:String
45
Statechart Diagrams
z Graph whose nodes are states and whose directed arcs are
transitions labeled by event names.
z A statechart diagram relates events and states for one class
- An object model with a set of objects has a set of state diagrams
46
State
z State
- State is a defined set of properties which
describe an object or thing at a given time.
- State may change when the properties making
up the state change.
47
UML Statechart Diagram Notation
Event trigger
With parameters
48
UML statechart for Incident.
all reports
are submitted
49
Statechart diagram for 2Bwatch
button1&2Pressed button2Pressed
Blink Increment
Minutes Minutes
button1Pressed
button2Pressed
Stop Blink
Blinking Increment
Seconds Seconds
button1&2Pressed
Final state
50
Modeling Inheritance Relationship between Objects
z Generalization
- Eliminate redundancy from the analysis model
- Two or more classes share attributes or behavior
- Similarities are consolidated into super class
- badgeNumber
PoliceOfficer
badgeNumber:Integer
FieldOfficer Dispatcher
51
Define
Analysis activities
use cases
(UML activities
Define diagram).
participating
objects
Define
interactions
Define
nontrivial Define Define
behavior attributes associations
Consolidate
model
Review
model
Reviewing the Analysis Model
53
Model Correct?
54
Model Consistent?
z Are there multiple classes or use cases with the same name?
z Do entities (e.g. use cases, classes, attributes) with similar
names denote similar phenomena?
z Are all entities described at the same level of detail?
55
Model Realistic?
z Are there any novel features of the system? Were any studies
or prototypes built to ensure their feasibility?
z Can the performance and reliability be met?
z Etc.
56
Managing Analysis
z Documenting
z Assigning Responsibilities
z Communicating
z Client Sign-off
57
Requirements Analysis Document Template
1. Introduction
2. Current system
3. Proposed system
3.1 Overview
3.2 Functional requirements
3.3 Nonfunctional requirements
3.4 Constraints (“Pseudo requirements”)
3.5 System models
3.5.1 Scenarios
3.5.2 Use case model
3.5.3 Object model
3.5.3.1 Data dictionary
3.5.3.2 Class diagrams
3.5.4 Dynamic models
3.5.5 User interface
4. Glossary
58
Documenting Analysis
59
Object Models
60
Dynamic Models
61
Assigning Responsibilities
62
User and Client
z User
- Domain expert
- Generates information about the current system and about the
tasks that the future system should support
- Corresponds to one or more actors
Ë Helps identify their use cases
z Client
- Integration of user requests
- Defines the scope of the system based on (sometimes conflicting)
user requirements
63
Analyst and Architect
z Analyst
- Development domain expert
- Models current system
- Generates information about the future
system
z -Architect
Integrates the use case and object models
- Ensures consistency and completeness
- Develops system philosophy
64
Editor, Reviewer, Configuration Manager
z Editor
- Integration of document
- Format of
document
z Reviewer
- Validates document against requirements
qualities
z -Configuration
Maintains revision history
Manager
- Coordinates traceability with other documents
65
Communicating
z Challenges
- Different backgrounds
- Different expectations
- Passing information to new teams
- Evolving system
z Guidelines
- Define clear territories
- Define clear objectives and success criteria
- Brainstorm
66
Client Sign-off
67
Client Developer
Example of a
Review proposed
change
[change approved]
revision
process
Update Archive
requirements request
Design Update
test design
Update code
(if applicable)
Execute all
relevant tests
Review actual
change
Summary: Analysis
z 1. What are the transformations?
Functional Modeling
- Create scenarios and use case diagrams
Ë Talk to client, observe, get historical records, do thought experiments
69