L8 Architecture
L8 Architecture
courses.cs.washington.edu/courses/cse403/15sp/
Software Architecture
Emina Torlak
[email protected]
Outline
2
basics
software architecture: motivation & definition
Why software architecture?
4
The basic problem: from requirements to code
Requirements
Code
5
The basic problem: solve with inspiration
Requirements
a miracle happens
Code
6
The basic problem: solve with engineering
Requirements
Provides a high-level
framework to
Software Architecture build and evolve a
software system.
Code
7
depict
what does an architecture look like?
Box and arrow diagrams
9
An architecture: components and connectors
10
A standard notation for architecture: UML
11
judge
what is a good architecture?
A good architecture …
13
A good architecture …
13
A modular architecture helps with …
14
You know your software is modular when it is …
15
You know your software is modular when it is …
• Decomposable
• can be broken down into pieces
15
You know your software is modular when it is …
• Decomposable
• can be broken down into pieces
• Composable
• pieces are useful and can be combined
15
You know your software is modular when it is …
• Decomposable
• can be broken down into pieces
• Composable
• pieces are useful and can be combined
• Understandable
• one piece can be examined in isolation
15
You know your software is modular when it is …
• Decomposable
• can be broken down into pieces
• Composable
• pieces are useful and can be combined
• Understandable
• one piece can be examined in isolation
• Adaptable
• change in requirements affects few modules
15
You know your software is modular when it is …
• Decomposable
• can be broken down into pieces
• Composable
• pieces are useful and can be combined
• Understandable
• one piece can be examined in isolation
• Adaptable
• change in requirements affects few modules
• Safe
• an error affects few other modules
15
Achieving modularity: think about interfaces
16
Achieving modularity: think about interfaces
16
Achieving modularity: think about interfaces
16
know
properties of architectures
Key properties of an architecture
• Coupling
• Cohesion
• Style conformity
• Matching
18
Loose coupling
19
Tightly or loosely coupled?
-End21
*
User Interface -End1
-End2
Graphics
*
-End6 *
-End3 * *
* -End16
* -End25 * -End23
* -End11
* -End26 * -End24
* -End4
-End13
* -End9
* -End7 * -End19
* -End12
* -End14 * -End8
* -End20
-End10 -End15
Business Rules
*
* * -End18
Enterprise Level Tools -End22
-End17
*
*
20
Tightly or loosely coupled?
* -End5
* -End3
* -End6
* -End15 * -End13
* -End7
* -End14
* -End16
*
-End8 *
21
Strong cohesion
22
Strong or weak cohesion?
class Employee {
public:
…
}
23
Style conformity: what is a style?
24
Style conformity: more than boxes and arrows
25
Style conformity: more than boxes and arrows
25
Component matching
27
study
example architectures
Client-server architecture
29
Client-server architecture
29
Model, view, controller (MVC)
30
Model, view, controller (MVC)
Separates:
• the application object (model)
• the way it is represented to
the user (view)
• the way in which the user
controls it (controller)
30
Shared nothing (SN) architecture
Network
31
Shared nothing (SN) architecture
Network
31
Summary
32