Professional Documents
Culture Documents
CPSC-4360-01, CPSC-536001,
Lecture 4
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Analysis
Software Architecture
Use Case Realization
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Requirement
Analysis
Design
Implement
Understanding how
business entities can be
used to support use cases.
Test
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Analysis: Overview
Inputs:
Use Cases.
Domain Model.
Activities:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Analysis: Overview
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Analysis:
Design:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
What is Software
Architecture?
High level description of the overall system:
Improve Cohesion.
Reduce Coupling.
Cohesion:
Coupling:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Software Architecture:
Example
Display:
Application Logic:
Record Storage:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
10
03/19/15
Bad Cohesion:
Low Coupling:
CPSC-4360-01, CPSC-5360-01,
Lecture 4
11
class Minesweeper {
Minesweeper msApp;
MSStorage msStore;
MSStorage msStore;
public void openSquare(position){
if (square == bomb)
gameState = dead;
else if (square == number){
open neighboring squares
mark squares as opened;
}
}
class MSStorage {
public void writeHighScore(..){ }
public void writeBoard(..) { }
}
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
12
Cohesion:
Coupling:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
13
class Minesweeper {
MSStorage msStore;
Not needed
.. .. ..
.. .. ..
class MSStorage {
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
14
Coupling:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
15
Minesweeper: Systems
Comparison
System 1
System 2
System 3
MSGui
Minesweeper
Minesweeper
Minesweeper
MSGui
MSStorage
MSStorage
Bad Cohesion
Good Cohesion
Good Cohesion
No Coupling
Medium Coupling
Low Coupling
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
16
Minesweeper: Observations
User Interface.
Main Application Logic.
Storage (Persistency).
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
17
Presentation Layer
Application Layer
Storage Layer
User Interface.
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
18
03/19/15
Dependency:
Represent the make
use of relationship .
CPSC-4360-01, CPSC-5360-01,
Lecture 4
19
Minesweeper: Package
Diagram
Presentation
MSGUI
Application
Minesweeper
Corresponds to
programming construct:
Java: Package.
C++: namespace.
Storage
MSStorage
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
20
Layered Architecture:
Advantages
Layers aim to insulate a system from the
effects of change.
For example, user interfaces often change:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
21
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
22
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
23
Steps:
Possible refinements:
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
24
Sequence Diagram
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
25
Actors or Classes
involve in
interaction
Message
With parameter
Class
Actor
Message ( Para )
Activation
Bar
Lifeline
Returned value
Return
Control and
possibly value
are returned
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Time
Passes
26
Sequence Diagram:
Explanation
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
27
:B
:A
method ( 123 )
Returned 456
}
}
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
28
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
Staff sends a
message.
System
returns
results.
29
03/19/15
30
03/19/15
31
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
32
03/19/15
BookingSystem (why?)
Booking (why?)
CPSC-4360-01, CPSC-5360-01,
Lecture 4
33
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
34
CPSC-4360-01, CPSC-5360-01,
Lecture 4
35
Follow up:
03/19/15
36
* denotes
multiple
messages
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
03/19/15
38
New
association
added
Operation
added
Association
refined
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
39
Refining Association
rName
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
40
Refining Association:
Example
Human
Eats >
Mee
Human
Domain Model
Eats >
myFood
Mee
Class Diagram
class Human {
Mee myFood;
void method( ) {
myFood.cook( );
}
}
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
41
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
42
Object Creation/Deletion.
Role Name to distinguish objects of the same class.
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
43
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
44
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
45
Constructor Message
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
New Object
46
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
47
Destruction
message
03/19/15
Role
Lifeline
NameCPSC-5360-01,
Terminated
CPSC-4360-01,
Lecture 4
48
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
49
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
50
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
51
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
52
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
53
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
54
Typical Artifacts:
Software Architecture
Sequence Diagrams
Analysis Class Diagram
Implement
Test
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
55
Summary
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
56
Reading Suggestions
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
57
Coming up next
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
58
03/19/15
CPSC-4360-01, CPSC-5360-01,
Lecture 4
59