Professional Documents
Culture Documents
Summary
Contents
1 The Design Problem
1.1 Waterfall Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Software Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Design Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
3
4
4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4
4
5
6
6
7
7
7
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
10
10
10
10
11
11
11
11
12
13
13
13
14
14
14
15
15
17
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
20
20
20
20
20
21
21
.
.
.
.
.
.
21
21
22
22
22
24
24
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5 Interaction Models
5.1 Sequence Diagrams . . . . . . . . . .
5.1.1 Message Specification Format
5.1.2 Interaction Fragments . . . . .
5.1.3 Sequence Diagram Heuristics
5.1.4 Uses for Sequence Diagrams .
5.1.5 Interaction Design Process . .
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
24
24
25
25
26
6 Software Architectures
6.1 Role of Software Architecture . . . . . .
6.2 Characteristics of Software Architecture
6.3 Guidelines for a Good Design . . . . . .
6.3.1 Heuristics for Good Design . . .
6.4 Decomposition . . . . . . . . . . . . . .
6.4.1 Hierarchical Decomposition . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
26
26
26
26
27
27
27
7 Architecture Styles
7.1 Repository Style . . . . . . . .
7.1.1 Problem . . . . . . . . .
7.1.2 Solution . . . . . . . . .
7.2 Pipes and Filters . . . . . . . .
7.2.1 Problem . . . . . . . . .
7.2.2 Solution . . . . . . . . .
7.3 Client-Server . . . . . . . . . .
7.4 Control Styles . . . . . . . . . .
7.4.1 Call-Return Model . . .
7.4.2 Manager Model . . . . .
7.4.3 Event Driven . . . . . .
7.4.4 Reference Architectures
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
27
28
28
29
29
29
29
29
30
30
30
30
30
8 State Charts
8.1 Transition String Format . . . .
8.2 Symbol Compartments . . . . .
8.3 Internal Transitions . . . . . . .
8.4 Sequential Composite States .
8.5 Stubs . . . . . . . . . . . . . .
8.6 State Chart Heuristics . . . . .
8.7 Recognisers and Transducers .
8.8 Dialog Map . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
31
31
31
31
32
32
32
33
34
.
.
.
.
.
.
.
34
34
34
35
35
35
35
36
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
36
36
36
38
39
The design problem is to develop a description of the system that can be implemented by developers and, if implemented, will meet all of the requirements. Designs can be seen as a
reasoning from a set of requirements and constraints to a new piece of reality; bringing something new into being. Requirements (what) and design (how) come from different conceptual
worlds and can have different competing objectives. The design problem is solved by:
Design Methods A set of activities that systematically guides the development of a solution
to a design problem.
Modelling represents the objects, system and software in a way that aids understanding and
solution.
Decomposition breaks the complicated problem down into smaller and more easily solved
pieces.
Design Knowledge uses, adapts and extends previously developed ideas where applicable.
1.1
Waterfall Model
!!"#$!%$&$'()!*+,-$.!/$0$123.$&-!4(5$6)+)1$!728$1!
Requirements
Software Requirements
Package
System
Design
System Designs
H/W and S/W
Software
Design
Software Architecture
and Detailed Designs
Implementation
Code
Testing
System
Maintenance
Semester 1, 2013
10
1.2
Software Architecture
Component Design aims to identify the key sub-systems and establish a framework for both
control flow and communication between sub-systems. Key activities in component design are:
System Structuring
4
Control Modelling
Modular Decomposition
Component design also aims to design the services that each component must deliver
and develop abstract models of the components.
Interface Design aims to develop the interface for each component including method calls,
messages and event handlers.
Data in the systems consists of:
Persistent data that is saved long term.
Data that flows between components; attribute data in classes.
1.3
Design Methods
Structured Methods Notations, guidelines and often sets of activities that can be used to
move from requirements to design.
Data flow
Jackson's technique
Entity-relationship modelling
Structural and functional block modelling
OO analysis and design
1. Start with use cases and domain model
2. Add more detail to class models to evolve design into something that can be
implemented
3. Repeat 2 until a model is reached in which the classes, interfaces and control
strategies are straightforward to implement.
2
2.1
Begin with the functional requirements specified in the requirements specification. During the
design process:
High-level functions are successively decomposed into more detailed functions
When the functions are simple enough - such that they could be implemented - they are
mapped to a module structure.
Essentially taking the problem, breaking it down and rebuilding it into a known structure. n.b.
most function oriented design solutions assume a common system state or data store which
the functions operate.
F1
F3
F2
F4
F5
!"#$%&'()*"(%+,-.($./%0.#-1(%2"3'*"(#%4##'5.%4%)"55"(%
Semester 1, 2013
10
Project
Coordinators
Project
Coordinators
Commands
Students
Project
Details
Reports
SEPD
System
Project
Details
Students
Project
Details
Queries
Administrators
Project Clients
Semester 1, 2013
12
Context Diagram shows the data flows coming into - and out of - the system.The system is
required to transform the inputs to outputs.
2.1.2
Product Engineering
In the context diagram data must flow from the environment into the system transform and
out of the system transform back into the environment. External data must be transformed to
internal data flows, processed and then transformed back into external data flows.
Input Flows are data flows that take data into the system and transform it to internal form.
Transform Centre At the heat of the system where incoming data flows pass through the transform centre and start to move on paths back to the environment.
Output Flows are data flows that lead back to the environment.
Semester 1, 2013
22
Start at the transform centre and work outwards along input flows and then forward
along output flows.
Each transform is added as a sub-module of the one it is connected to by a data
flow.
Modules can be combined according to the good design (high cohesion, low coupling).
Second Level Factoring
2.2
Semester 1, 2013
24
Jackson's technique; data-structure oriented design methods start out by designing the input
and output data structures. The assumption is that any system interacts with the outside world
though its data structures. Thus, a correct model of the data can be transformed into a system
that incorporates a correct view of the world.
2.2.1 Design Strategy
1. Form a system network using Jackson's notation that models the problem domain
2. Define and verify the data-flow data structures (input and output)
3. Derive and verify the program structures
4. Derive and verify the elementary operations
5. Write the structure text and program text
These steps can be separately and independently encouraging a separation of concerns.
Sequence
Legend
Action/Process
Selection
Iteration
Procedure
Semester 1, 2013
Figure 5: Jackson's Structure Diagrams.
Proj.
Details.
Project
Details
(Persistent Store)
Queries
Process
State Vector
Generate
Report R1
Report
R1
Generate
Report R2
Report
R2
Generate
Report R3
Report
R3
Data Stream
Symbols
Semester 1, 2013
Company
Contact
Name
Features
Environment
Mobile
Tool-Chain
Project Status
IP
Contract
IP Position
Prog. *
Languages
Operating
System Spec.
Hardware
Spec.
Generate
Contact
Generate
Company
Generate
Name
Generate
Mobile
Generate
Email
Generate
IP
Generate
Contract
Generate
Project Status
Generate
IP Position
Figure 8: Step 3: derive the program structures e.g. report generator 1 of SEPD.
!"#$%&'(&)*$+,&-.,-&#$/+$"/#&)&."/.)0$)12$,"#$%&'.#++#+$#3#.-,#$0#4$,'$&/(",5$6,$
7'00'8+$,"#$'-,%-,$2),)$+,&-.,-&#$9-/,#$.0'+#0:$/1$,"/+$#3)*%0#$;-,$,"/+$/+$1',$
)08):+$,"#$.)+#5$<4#1$"#-&/+=.+$)12$+'*#$2#)0$'7$.&#)=>/,:$/+$1##2#2$,'$(#,$
,"#$'-,%-,$7&'*$,"#$/1%-,5$
SWEN30006: Software Modelling and Design
Semester 1, 2013
!"#$%&'(#))$)*&+(*+&#$(,-$.#$
*&,-)/,*#0$*'$1+-(2'-)$3-$4$5"#&#$
*"#$%&'(#))$6!"#"$%&"'(")*$&'+7$3)$
*"#$,%-#$%&'(#0+$$
9/*#&-,2:#/;$*"#$%&'(#))$(,-$.#$
#,)3/;$*&,-)/,*#0$*'$(/,))#)$5"#&#$
#,("$%&'(#))$3)$3<%/#<#-*#0$.;$,$
<#*"'08$$
Semester 1, 2013
10
14
13
3
3.1
!"#$%&'()#'$*+,#-.+//$0-&1#22$
0-&'31,$45+/62(2$
Requirements
Engineering
0-&'31,$758(5##-(58$
9#2(85$:,6/#2;$0+<#-52$+5'$
%#,"&'2$+-#$32#'$"#-#=$
Design
Implementation
Testing
Maintenance
SWEN30006: Software Modelling and Design
Semester 1, 2013
11
!!"#$!%&$'()*$!+,-$.!
Analysis
Architecture
Test
Implementation
Design
"#$!(/0!/1!(1!/&$'()*$!
0,-$.!/2!&,!-$*$.,3!(!
0/1/0(.!45&!!"#$%&'
262&$0!(1-!&#$1!/03',*$!
53,1!/&!,*$'!2577$22/*$!
/&$'(),128!'!
9(7#!1$:!/&$'(),1!45/.-2!
/1!1$:!'$;5/'$0$1&2<!
/03',*$2!&#$!-$2/=1!(1-!
$>/2)1=!7,-$8!
Semester 1, 2013
Each successive product design activity extends and improves the results of the previous
product engineering activity.
The products engineering activities in successive iterations are similarly linked.
3.1.3 Rapid Prototyping
Is a form of iterative development. Each iteration focuses on the production of a Prototype.
Prototype is an incomplete or preliminary version of the system from which the complete production system can be developed.
3.2
12
3.3
Activity Diagrams
Model processes by showing the activities that are performed in a process and show the flow
of control and data !"#$%&'(!)&*+,*-.!/,*0#1&0+!
between
Click to the
editactivities.
Master title style
merge
node
guards
decision
node
!!"#$%&'(!)'*!+#&'&'(!,#*-.!
Click to edit Master title style
SWEN30006: Software Modelling and Design
Semester 1, 2013
24
fork node
join node
Semester 1, 2013
28
!"#$%&'(!)*+$$,-.!
Click to edit Master title style
Do Laundry
Sort
Clothes
Wash
Whites
Wash
Darks
Dry
Clothes
Fold
Clothes
Machine A
Person X
Machine B
Semester 1, 2013
31
control flow
pin
data flows
control flow
Semester 1, 2013
34
Make sure all nodes entering an action node can provide tokens concurrently
Use the [else] guard at every branch
!!"#$%&'(!)&*+,*-!./*-012!
FindMax
a : int[1..*]
max : int
max = a[0]
i=1
[else]
[i < a.length]
[else]
[max < a.[i]]
max = a[i]
max
i++
3.4
Semester 1, 2013
37
Model the interactions that an external entity has with the system. Consists of:
3.4.1 Use Case Diagrams
Are static models that capture the users' interaction with the system. Consist of use cases and
the actors involved in each use case.
Use
Case
toagent,
edit
Diagram
title style
Actor is aClick
type of
orMaster
external Symbols
entity,
that interacts with a product. Actors are roles not
individuals; the product in never an actor.
Association
Line
Use Case
Symbol
Scenario is a concrete interaction between a product and particular individuals. A use case is
an abstraction
of the interaction between the product and specific
individuals.9 A scenario
SWEN30006: Software Modelling and Design
Semester 1, 2013
is thus an instance of a use case. Scenarios can help to envisage how the product may
be used. Designers can use a bunch of scenarios to explore ideas about the product and
how it could be designed for the way it will be used. The scenarios are then generalised
to generate use case by identifying actors and the sequence of actions that must be taken
during an interaction to achieve the goals of an activity.
16
Stall Sensor
Buy a
Wash
Activate/
Deactivate
Soap Sensor
Wash the
Car
Produce a
Log
Manager
Semester 1, 2013
10
Beneficiary of a use case is an actor that receives some benefit from the use case. If there
are no beneficiaries of a use case then it is questionable if the use case is needed at all.
Use case and Actor briefs is a short description of a use case or an actor. e.g. Customer:
A person who comes to the car wash to get a car washed. e.g. Buy Wash: Accepting
a request for a car wash, checking if the car wash if ready for the next wash... Briefs
supplement the use case diagram and help document the use case.
Every use case diagram must have:
At least one use case
At least one actor
At least one actor associated with each use case
At least one use case associated with each actor
No association line between actors
No association line between use cases
Name every actor and use case
No label on any association line
Some use case diagram heuristics:
Name actors with nouns
Name use cases with verbs
Achieve a stakeholder's goal in a use case
Make use cases of uniform size and complexity
Fit the top level use case diagram for the system on a single page
17
stakeholderneedsList.
Pre-conditions: what is assumed at the start.
Post-conditions: what is guaranteed at the end.
Trigger: the event that starts the use case.
Basic Flow:
# stepDescription
Extensions:
extensionIdentifier condition:
extensionIdentifier # stepDescription
Semester 1, 2013
30
!"#$%&"#'#%()%*+'#%&",$%+$#%-#')(+$%+.%&"#%/)#%0,)#1%2(&"%
Extension relationships
between use cases is used to show where one use case is option3(4#'#$&%-#')(+$)%)+*#%,05+$)%($%0+**+$%,$3%)+*#%,05+$)%
ally extended
by an additional use case.
/$(6/#%&+%&"#%/)#%0,)#%/)#%7#$#',8(9,5+$:%
Semester 1, 2013
19
37
!!"#$#%&'()&*+$!,#'&*+$-.(/-!0#12##$!341+%-!
Click to edit Master title style
5$!1.#!6&%!7&14.!#8&9/'#:!
;%&$4.(-##!4&$!<+!#=#%>!
1.($?!1.#!&<9($(-1%&1+%!4&$!
<+!&$<!9+%#@!!
A.(-!4&$!B#!4&/1C%#<!($!&!
?#$#%&'()&*+$!%#'&*+$-.(/!
B#12##$!1.#!&41+%-!D!-(9('&%!
1+!($.#%(1&$4#!B#12##$!
4'&--#-@!
!"#$%&'(");'/.7+*$"#<$%='1)''*%>$'%?.$'$%
Semester 1, 2013
38
!"#$%#$%&$'(%)"'*%$+,'%&$'%-.$'$%)#//%./).0$%*''(%.*+1"'2%&$'%
-.$'%#*-/&('(3%
452+-'$$%5.0,'*16%)#//%$7//%8'%.%$1.*(./+*'%&$'%-.$'%1+%8'%&$'(%9+2%
4:.*&.//0%.((%-.2%$".2'263%
%!"#$%&'(%)@'2-1*/$"#0%A')+''/%B,)*.$%%
Semester 1, 2013
39
!"#$%#$%&$'(%)*%$"*+%,-$'$%+"'.'%*/'%&$'%,-$'%#$%*01*/-223%
'4)'/('(%53%-/%-((#1*/-2%&$'%,-$'6%
7/%)"'%'4-802'%)"'%9:.*,'$$%:-38'/);%&$'%,-$'%,*/)-#/$%-22%)"'%<&/,1*/-2#)3%
.'=&#.'(%<*.%-%,-$"%*.%,"'=&'%0-38'/)>%"*+'?'.%#$%"-$%)*%5'%'4)'/('(%<*.%
,.'(#)%*.%('5#)%,-.(%0-38'/)6%
Semester 1, 2013
20
40
4
4.1
Domain (conceptual) class models represent the problem including important entities or concepts and their attributes and important relationships. Important in product design because they help to:
Understand the problem domain
Setup data requirements
Validate requirements
Important in engineering design because they help to:
Understand a product design
Provide a basis for engineering design modelling
Conceptual modelling process:
1. Identify classes
2. Add attributes
3. Add associations
4. Add multiplicities
Design class models represent the classes in a software system including their attributes,
operations, association but no implementation details.
Implementation class models represent the classes in software system with implementation
details
Design and implementation class models represent the solution to the problem.
4.2
4.3
name(parameter-list) : return-type-list
e.g. getScore() : int, setName(in : String)
4.4
Associations
Generalisation (inheritance) is useful when a class is the name as another class, and more
Aggregation used to show part-whole relationships. Composition is a weaker form.
Association are associations between classes that is not either of previous two.
21
!!"##$%&'($)#!'*+!,*+#+)-+.!/*'01&%'223!&)!456!
!!"##$%#&'()!
Pedals
Bicycle
1
Brakes
Frame
Semester 1, 2013
15
1
2
Seat
Wheels
4.5
Multiplicity
Number of instances of target class associated with single instance of source class.
SWEN30006: Software Modelling and Design
4.6
Semester 1, 2013
17
Object diagrams
Models that show state of one or more objects at a moment during execution. Dynamic model
as opposed to class diagrams-static. Used in development of class diagrams. Comprised of
object name and attributes.
object-name : class-name
attribute-name = value
Interaction Models
Interaction Diagrams are notation used for modelling the communication behaviour of individuals exchanging information to accomplish some task. Focus is on sequence diagrams.
5.1
Sequence Diagrams
Semester 1, 2013
22
16
Semester 1, 2013
24
Synchronous arrow has filled in head and suspends execution until message is complete
Asynchronous arrow has un-filled head and continues execution after sending message
Synchronous message return arrow is dotted.
5.1.1 Message Specification Format
variable = name(argumentList)
e.g. hello(), msg = getMessage(helloMessage), x = sin(a/2)
!"#$%&'(!)*'+,-&.!/0',#(-!
23
Semester 1, 2013
22
!"#$%&'()*%!+&(,-%'$!./(-0#%!
Semester 1, 2013
!"#$%&!'#%()$*+!,-%)./$!
Semester 1, 2013
26
!!"##$!%&'()*+,!-.')$/*!
Semester 1, 2013
24
29
24
5.2
Control Styles
5.2.1 Centralised
A few controllers make all significant decisions.
Advantages:
Easy to locate decision making
Easy to see how decisions are made and alter the decision making process
Disadvantages:
Controller may become bloated - large, complex and hard to understand, maintain, text.
25
May treat other components are data repositories - increases coupling and destroys information hiding
Heuristics:
Avoid interaction designs where most messages originate from a single component
Keep components small
Make sure operational responsibilities are not all assigned to just a few components
Make sure operations responsibilities are consistent with data responsibilites
5.2.2 Delegated
Decision making is distributed among a few controller making the main decisions.
Advantages:
Controllers coupled to fewer components, reducing coupling
Information hidden better
Progtram easier to divide into layers
Preferred control style
Heuristics:
Have components delegate as many low-level tasks as possible
5.2.3 Dispersed
Decision making spread widely through program with few or no components making decisions
on their own.
Disadvantages:
Hard to see and understand flow of control
Components cannot do much on their own - increases coupling
Hard to hide information
Poor cohesion
Few modularity principles satisfied
Heuristics:
Avoid interactions that require each component to send many message.
26
5.3
Software Architectures
Architectural design is the activity of specifying the major parts; their responsibilities; properties
and interfaces; and the relationships and interconnections between them.
6.1
The architecture acts as a "blue-print" for the development team and provides the necessary
schematic which they can use to integrate their component. It can be used to assess impact
of changes and provides basis for evaluating extensions and maintenance - does the same for
new or additional requirements.
6.2
6.3
6.4
Decomposition
Layer 1 (Top)
A:Subsystem
B:Subsystem
E:Subsystem
C:Subsystem
F:Subsystem
D:Subsystem
Layer 2
G:Subsystem
Layer 3 (Bottom)
ISO/OSI Model The decomposition into layers allows the developer to build up simple interfaces between layers that hide the details of the layer below. Layering allows a clean
separation of concerns - the developer can concentrate on the details of one layer while
not needing to worry about the details of other layers. OSI is a closed architecture. Utilised
abstraction.
SWEN30006: Software Modelling and Design
Semester 1, 2013
Architecture Styles
21
Boundary conditions
Inter-subsystems communications protocols
Architectural Style is a template or a form of design pattern that can use common structures
and interactions to specify high-level designs. Part of the knowledge base of good designers. Typical styles:
Pipes and Filters
Repositories
Objects
Layered
Event-driven
Client-Server
Process-control
Interpreters
The final architecture may come from a single style but usually is a combination of styles.
Awareness of styles simplifies problem of coming up with good system architectures - use
whats already been done. They capture existing knowledge about trade-offs in system
architecture.
7.1
Repository Style
7.1.2 Solution
Data is independent from computation
Interaction style is given by the computational elements interacting the central data store
Control style varies and depends on the application; can be state driven (depends on the
data), synchronous or asynchronous
7.2
Data flows from input of pipeline through a variety of pipes to the output end of pipeline. As it
flows, functional transformations are carried out on the data. Extensively used in data processing systems but not suitable for top-level architecture of interactive systems.
7.2.1 Problem
Used when there is a series of operations to be performed on data
Requires problem to be decomposed into a set of computational elements that continuously transforms data from input to output
7.2.2 Solution
Interaction style is through data-streams; data may be represented as ASCII text, XML
or internal data structures
Control style between filters in linear; output of one filter is fed directly the input of next
filter. Thread of control is inside the filters and thus is independent and may be complex
7.3
Client-Server
7.4
Control Styles
31
State Charts
Specified by a:
1. Set of states
2. Set of inputs
3. Set of outputs
4. Next state function
Deterministic means that an input to every state has a clear transition to another state. Nondeterministic means that it could go to different states from the current state with a single
input.
8.1
8.2
Symbol Compartments
Name
Idle
entry/amount = 0
do/display( greeting )
Internal Transitions
!"#!$%!$&'((!)%*#+'$*(,$-!
8.3 Internal
Transitions
.+*(!)%*#+'$*(,$!
/#0%,+12!*+3!4(!+5+)&(6!$%!+!$+4!$%!-+7(!-#+)(!
action-label
/ action-expression
e.g. entry
/ count
:= 0, do / display flashing light
8+$&,+*(!
9,$(',+1!$'+,-:0%,-!
9,$(',+1!$'+,-:0%,!-#():;)+0%,-<!%,(!#('!1:,(!
entry execute
the associated action-expression upon entry
='+,-:0%,!#'%)(--(6!>:$&%?$!)+?-:,@!+!-$+$(!)&+,@(!
exit execute the associated action-expression upon exit
/#0%,+1!
do execute
the associated action-expression upon state entry and continue until exit or action
.(-$(6!6:+@'+*!
completion
/#0%,+1!
include a finite state automaton (composite)
SWEN30006: Software Modelling and Design
Semester 1, 2013
32
17
!"#$%$&"'(%)$"*+$(",-$&)-%."/)%-0+12-0"
Click to edit Master title style
8.4
Semester 1, 2013
21
1. Entering a composite state also means entering its nested state. Its entry command is
executed as well as its nested state. This continues until there are no more nested state.
They jointly become the current state.
2. A transitions from the enclosed state causes the exit actions of that state to be exited,
along with any other enclosing states.
3. The transition action is then performed
4. The entry actions of entered state are executed from outermost state to innermost state
as in step 1.
8.5
Semester 1, 2013
Stubs
Symbol used as a termination and origin point for transitions to and from states in a suppressed
nested state chart.
8.6
26
Semester 1, 2013
28
8.7
Recogniser is a finite automaton that responds to events but generates no actions. Typically
used to determine if the input is valid - accepted or recognised. Accepted iff:
1. The automaton reads each input value
2. The automaton moves to the corresponding new state for the input symbol
3. and finishes in an accepting state when all the input is consumed
Typical examples include language translators, lexical analysers and interpreters
Transducer is a finite automaton that both responds to events and generates actions. Typically
used to model things that transform inputs to outputs.
Useful in product design as well as engineering design
Examples: devices, programs with complex state-based behaviour.
34
8.8
Dialog Map
User InterfaceSWEN30006:
Diagram
is a drawing
of (part of) a product's visual
when
it is in a parSoftware Modelling
and Design
Semester display
1, 2013
40
ticular state. Dialog maps and user interface diagrams can be used together: every user
interface diagram should specify the visual form of a state in a dialog map, and every
state is a dialog map should have its visual form specified by a user interface diagram.
!"#$%!&'($%)*+$!,-*.%*/!01*/23$!
9
9.1
Semester 1, 2013
42
9.1.6 Composition
Method of reuse in which new functionality is obtained by creating an object composed of other
objects - new functionality obtained by delegating functionality to one of the objects used in
the composition. e.g. window class having a rectangle attribute to delegate all the rectangle
related operations to. Window shouldn't merely inherit rectangle because not every window
must be a rectangle.
Delegation occurs when two objects are involved in handling a request: a receiving object and
a delegate.
10.1
Intent - define an interface for creating an object, but let subclasses decide which class
to instantiate. Factory Method lets a class defer instantiation to subclasses.
Motivation The createDocument() method is a factory method.
Applicability - used when:
A class can't anticipate the class of object it must create
37
!"#$"#%
!"#$"%&$%'$(")*&+"%*,)%+)"&-$.%&$%,/0"+(1%/2(%3"(%42/+3&44"4%5"+'5"%67'+7%
+3&44%(,%'$4(&$-&("8%9&+(,):%;"(7,5%3"(4%&%+3&44%5"*")%'$4(&$-&-,$%(,%
42/+3&44"48%
&'()*('"%
<,$4'5")%(7"%*,33,6'$.%*)&="6,)>8%
Document
Application
Theopen()
Factory Method
Pattern (contd)!
createDocument()
close()
openDocument()
Document doc=createDocument()
docs.add(doc)
Save()
!""#$%&'$#$()*
doc.open()
!"#$%&#$'()%*+,$-#%&*.$/(0#+1$21$(1,$*3$%&#$3*44*5216$"2%7(8*1"9$
:$)4(""$)(1;%$(18)2/(%#$%&#$)4(""$*3$*<=#)%"$2%$>7"%$)+#(%#?$
MyDocument
MyApplication
:$)4(""$5(1%"$2%"$"7<)4(""#"$%*$"/#)23,$%&#$*<=#)%"$2%$)+#(%#"?$
createDocument()
return MyDocument
+(,-%(-,.*
?7"%!"#$%#&'!()#*%@A%="(7,5%'4%&%*&+(,):%="(7,58%
Creator
factoryMethod()
Product
SWEN30006: Software
Modelling and Design
anOperation()
ConcreteProduct
.
product = factoryMethod() Semester 1, 2013
.
26
ConcreteCreator
factoryMethod()
Semester 1, 2013
27
38
0..*
Attach(Observer) 1
Detach(Observer)
Notify()
For all o in Observers
o-> Update()
Doument
DoumentState
GetDocument()
SetDocument()
0..*
Observer
Update()
Reviewer
ReviewerState
UpdateDocument()
ObserverState
= Subject->GetState()
Return subject
state
Semester 1, 2013
40
Participants
Subject
* Keeps track of its observers
* Provides an interface for attaching and detaching Observer objects
Observer - defines an interfaces for update notification
ConcreteSubject (model)
* The object being observed
* Stores state of interest to ConcreteObserver objects
* Sends a notification to its observers when its state changes
ConcreteObserver
* The observing object
* Stores state that should stay consistent with the subject's]
* Implements the Observer update interface to keep its state consistent with the
subject's
Benefits
Minimal coupling between the Subject and Observer
* Can reuse subjects without reusing their observers and vice versa
* Observers can be added without modifying the subject
39
Is an architectural pattern that is similar to the observer pattern where there are multiple clients
interacting with a single model.
Model contains the data and the methods that govern the access to and updates of the data. In
enterprise systems, a model serves as a software approximation of a real-world process.
View displays the content of a model. It specifies exactly how the data should be presented.
If the data changes, the view must update the presentation of the data as needed. Note
- there may be multiple views registered with a single model.
40
!"#$%&'($)&*"+,-"%%$-.
Controller
Method
Calls
Application behaviour
Maps user actions to model updates
Selects a view for a response
Notifies views of changes
Events
Select
View
Model
Updates
User
Actions
View
Model
State
Requests
Change
Notifications
Application State
Handles Queries about State
Notifies each view of changes in
state.
Controller translated the user's interactions with the view into actions that the model will perform.
SWEN30006: Software Modelling and Design
Semester 1, 2013
49
!"#$!%&'()*+!,-.(/*01!
Semester 1, 2013
52
Advantages:
View and controllers can be added, removed or changed without disturbing the model
Views can be added or changed during execution
User interface components can be changed even at runtime
Disadvantages:
41