Software Architecture PDF
Software Architecture PDF
Software Architecture
Lecture 14
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
3
Software Architecture: Foundations, Theory, and Practice
5
Software Architecture: Foundations, Theory, and Practice
Example – ATAM
Security
Performance
Reliability
ATAM Process
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
8
Software Architecture: Foundations, Theory, and Practice
ATAM Scenarios
Use-case scenarios
Describe how the system is envisioned by the stakeholders
to be used
Growth scenarios
Describe planned and envisioned modifications to the
architecture
Exploratory scenarios
Try to establish the limits of architecture’s adaptability with
respect to
system’s functionality
operational profiles
underlying execution platforms
Scenarios are prioritized based on importance to
stakeholders
9
Software Architecture: Foundations, Theory, and Practice
ATAM Architecture
Technical constraints
Required hardware platforms, OS, middleware,
programming languages, and OTS functionality
Any other systems with which the system must interact
Architectural approaches that have been used to meet
the quality requirements
Sets of architectural design decisions employed to
solve a problem
Typically architectural patterns and styles
10
Software Architecture: Foundations, Theory, and Practice
ATAM Analysis
Key step in ATAM
Objective is to establish relationship between architectural
approaches and quality attributes
For each architectural approach a set of analysis questions are
formulated
Targeted at the approach and quality attributes in question
Non-Risks
Sensitivity points
Trade-off points
ATAM in a Nutshell
Completeness
Consistency
Goals
Compatibility
Correctness`
Subsystem- and system-level
Scope
Data exchange
Concern Non-functional
Informal
Models
Semi-formal
Type Scenario-driven
Architects
Developers
Stakeholders
Managers
Customers 12
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Model-Based Architectural
Analysis
Analysis techniques that manipulate architectural description to
discover architectural properties
Tool-driven, hence potentially less costly
Typically useful for establishing “hard” architectural properties only
Unable to capture design intent and rationale
13
Software Architecture: Foundations, Theory, and Practice
14
Software Architecture: Foundations, Theory, and Practice
Architectural refinement
E.g., SADL and Rapide
15
Software Architecture: Foundations, Theory, and Practice
Reliability is the probability that the system will perform its intended
functionality under specified design limits, without failure
A failure is the occurrence of an incorrect output as a result of an
input value that is received, with respect to the specification
An error is a mental mistake made by the designer or programmer
A fault or a defect is the manifestation of that error in the system
An abnormal condition that may cause a reduction in, or
loss of, the capability of a component to perform a
required function
A requirements, design, or implementation flaw or
deviation from a desired or intended state
17
Software Architecture: Foundations, Theory, and Practice
Reliability Metrics
Time to failure
Time to repair
Time between failures
18
Software Architecture: Foundations, Theory, and Practice
Assessing Reliability at
Architectural Level
Challenged by unknowns
Operational profile
Failure and recovery history
Challenged by uncertainties
Multiple development scenarios
Varying granularity of architectural models
Different information sources about system usage
Architectural reliability values must be qualified by assumptions
made to deal with the above uncertainties
Reliability modeling techniques are needed that deal effectively with
uncertainties
E.g., Hidden Markov Models (HMMs)
19
Software Architecture: Foundations, Theory, and Practice
Architects
Managers
Stakeholders
Customers
Vendors 20
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Simulation-Based Analysis
21
Software Architecture: Foundations, Theory, and Practice
22
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Simulation-Based Analysis in a
Nutshell
Analysis Goals – any
Analysis Scope – any
Analysis Concern –behavioral, interaction, and non-
functional properties
Architectural Models – formal
Analysis Types – dynamic and scenario-based
Automation Level – fully automated; model mapping
may be manual
Stakeholders – any
23
Software Architecture: Foundations, Theory, and Practice
Example – XTEAM
24
Software Architecture: Foundations, Theory, and Practice
25
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
26
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
XTEAM in a Nutshell
Consistency
Goals Compatibility
Correctness
Component- and connector-level
Scope Subsystem- and system-level
Data exchange
Structural
Behavioral
Concern
Interaction
Non-functional
Models Formal
Dynamic
Type
Scenario-based
Architects
Developers
Stakeholders Managers
Customers
Vendors 27
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Closing Remarks
Architectural analysis is neither easy nor cheap
The benefits typically far outweigh the drawbacks
Early information about the system’s key characteristics is
indispensable
Multiple analysis techniques often should be used in
concert
“How much analysis?”
This is the key facet of an architect’s job
Software Architecture
Lecture 15
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
Implementation as a mapping problem
Architecture implementation frameworks
Evaluating frameworks
Relationships between middleware, frameworks,
component models
Building new frameworks
Concurrency and generative technologies
Ensuring architecture-to-implementation consistency
Examples
Different frameworks for pipe-and-filter
Different frameworks for the C2 style
Application
Implementing Lunar Lander in different frameworks
30
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
Implementation as a mapping problem
Architecture implementation frameworks
Evaluating frameworks
Relationships between middleware, frameworks,
component models
Building new frameworks
Concurrency and generative technologies
Ensuring architecture-to-implementation consistency
Examples
Different frameworks for pipe-and-filter
Different frameworks for the C2 style
Application
Implementing Lunar Lander in different frameworks
31
Software Architecture: Foundations, Theory, and Practice
Design Implementation
Decisions Artifacts
32
Software Architecture: Foundations, Theory, and Practice
33
Software Architecture: Foundations, Theory, and Practice
Design rationale
Often does not appear directly in implementation
35
Software Architecture: Foundations, Theory, and Practice
Design Implementation
Decisions Artifacts
36
Software Architecture: Foundations, Theory, and Practice
37
Software Architecture: Foundations, Theory, and Practice
38
Software Architecture: Foundations, Theory, and Practice
Architecture Implementation
Frameworks
Ideal approach: develop architecture based on a known
style, select technologies that provide implementation
support for each architectural element OO Class
Design Software
Decisions Library
Database
39
Software Architecture: Foundations, Theory, and Practice
Architecture Implementation
Frameworks
This is rarely easy or trivial
Few programming languages have explicit support for
architecture-level constructs
Support infrastructure (libraries, operating systems,
etc.) also has its own sets of concepts, metaphors,
and rules
To mitigate these mismatches, we leverage an
architecture implementation framework
40
Software Architecture: Foundations, Theory, and Practice
Architecture Implementation
Frameworks
Definition: An architecture implementation framework
is a piece of software that acts as a bridge between a
particular architectural style and a set of implementation
technologies. It provides key elements of the
architectural style in code, in a way that assists
developers in implementing systems that conform to the
prescriptions and constraints of the style. F OO Class
r
a
m
Design
Design e Software
Decisions
Decisions w Library
o
r
k Database 41
Software Architecture: Foundations, Theory, and Practice
Canonical Example
42
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; ゥ 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
More on Frameworks
43
Software Architecture: Foundations, Theory, and Practice
44
Software Architecture: Foundations, Theory, and Practice
Evaluating Frameworks
Can draw out some of the qualitative properties just
mentioned
Platform support
Target language, operating system, other
technologies
Fidelity
How much style-specific support is provided by the
framework?
Many frameworks are more general than one
target style or focus on a subset of the style rules
How much enforcement is provided?
45
Software Architecture: Foundations, Theory, and Practice
Matching Assumptions
Styles impose constraints on the target architecture/application
50
Software Architecture: Foundations, Theory, and Practice
Resolving Mismatches
51
Software Architecture: Foundations, Theory, and Practice
(thread)
Implementation
Comp 2 Comp 2
52
Software Architecture: Foundations, Theory, and Practice
54
Software Architecture: Foundations, Theory, and Practice
55
Software Architecture: Foundations, Theory, and Practice
56
Software Architecture: Foundations, Theory, and Practice
Concurrency
57
Software Architecture: Foundations, Theory, and Practice
Generative Technologies
With a sufficiently detailed architectural model, various
implementation artifacts can be generated
Entire system implementations
Maintaining Consistency
Software Architecture
Lecture 16
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
Implementation as a mapping problem
Architecture implementation frameworks
Evaluating frameworks
Relationships between middleware, frameworks,
component models
Building new frameworks
Concurrency and generative technologies
Ensuring architecture-to-implementation consistency
Examples
Different frameworks for pipe-and-filter
Different frameworks for the C2 style
Application
Implementing Lunar Lander in different frameworks
61
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
Implementation as a mapping problem
Architecture implementation frameworks
Evaluating frameworks
Relationships between middleware, frameworks,
component models
Building new frameworks
Concurrency and generative technologies
Ensuring architecture-to-implementation consistency
Examples
Different frameworks for pipe-and-filter
Different frameworks for the C2 style
Application
Implementing Lunar Lander in different frameworks
62
Software Architecture: Foundations, Theory, and Practice
Recall Pipe-and-Filter
63
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
64
Software Architecture: Foundations, Theory, and Practice
Evaluating stdio
Platform support Matching assumptions
Available with most, if Filters are processes and
not all, implementations pipes are implicit. In-
of C programming process P&F applications
language
might require
Operates somewhat modifications
differently on OSes with
no concurrency (e.g., Efficiency
MS-DOS) Whether filters make
Fidelity maximal use of
Good support for concurrency is partially
developing P&F up to filter
applications, but no implementations and
restriction that apps have partially up to the OS
to use this style 65
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
69
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Evaluating Lightweight C2
Framework Matching assumptions
73 classes, 8500
lines of code
Uses interfaces
rather than base
classes
Threading policy
for application
is pluggable
Message queuing policy is
also pluggable
71
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
72
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
Implementation as a mapping problem
Architecture implementation frameworks
Evaluating frameworks
Relationships between middleware, frameworks,
component models
Building new frameworks
Concurrency and generative technologies
Ensuring architecture-to-implementation consistency
Examples
Different frameworks for pipe-and-filter
Different frameworks for the C2 style
Application
Implementing Lunar Lander in different frameworks
74
Software Architecture: Foundations, Theory, and Practice
Framework: java.io
Implementing as a multi-process application
Each component (filter) will be a separate OS process
Operating system will provide the pipe connectors
Going to use just the standard input and output streams
Ignoring standard error
Ignoring good error handling practices and corner cases for
simplicity
75
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
A note on I/O:
Some messages sent from components are intended for output
to the console (to be read by the user)
These messages must be passed all the way through the
pipeline and output at the end
We will preface these with a ‘#’
Some messages are control messages meant to communicate
state to a component down the pipeline
These messages are intercepted by a component and
processed
We will preface these with a ‘%’
76
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
77
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GetBurnRate Filter
//Import the java.io framework
import java.io.*;
try{
//Begin reading from System input
BufferedReader inputReader =
new BufferedReader(new InputStreamReader(System.in));
. . .
78
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GetBurnRate Filter
//Import the java.io framework
import java.io.*;
. . .
public class GetBurnRate{
//Read user response
public static void
try{main(String[] args){
String burnRateString = inputReader.readLine();
//Send welcome message
burnRate = Integer.parseInt(burnRateString);
System.out.println("#Welcome to Lunar Lander");
//Send user-supplied burn rate to next filter
try{ System.out.println("%" + burnRate);
//Begin reading
} from System input
BufferedReader inputReader =
catch(NumberFormatException nfe){
new BufferedReader(new InputStreamReader(System.in));
System.out.println("#Invalid burn rate.");
}
//Set initial burn rate to>=0 0);
}while(burnRate
int burnRate = 0;
inputReader.close();
do{ }
//Prompt user
catch(IOException ioe){
System.out.println("#Enter
ioe.printStackTrace();burn rate or <0 to quit:");
}
. . . }
} 79
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
80
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
CalcBurnRate Filter
import java.io.*;
try{
BufferedReader inputReader = new
BufferedReader(new InputStreamReader(System.in));
. . . 81
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
CalcBurnRate Filter
import java.io.*;
String inputLine = null;
do{
public class CalcNewValues{
inputLine = inputReader.readLine();
if((inputLine != null) &&
public static void
(inputLine.length()
main(String[] args){
> 0)){
//Initialize values
final int GRAVITY
if(inputLine.startsWith("#")){
= 2;
int altitude = 1000;
//This is a status line of text, and
int fuel = 500; //should be passed down the pipeline
int velocity = 70;
System.out.println(inputLine);
int time = 0; }
else if(inputLine.startsWith("%")){
try{ //This is an input burn rate
BufferedReadertry{
inputReader = new
BufferedReader(new
int burnRate
InputStreamReader(System.in));
= Integer.parseInt(inputLine.substring(1));
if(altitude <= 0){
//Print initial values
System.out.println("#The game is over.");
System.out.println("%a"
} + altitude);
System.out.println("%f"
else if(burnRate
+ fuel); > fuel){
System.out.println("%v"
System.out.println("#Sorry,
+ velocity); you don't" +
System.out.println("%t"
"have
+ that
time);much fuel.");
}
82
. . . . . .
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
CalcBurnRate Filter
else{ inputLine = null;
import java.io.*;
String
//Calculate new application state
do{
time = time
public class CalcNewValues{
inputLine + 1;
= inputReader.readLine();
altitude = altitude
if((inputLine - velocity;
!= null) &&
velocity
public static void = ((velocity
(inputLine.length()
main(String[] args){ + GRAVITY) * 10 -
> 0)){
burnRate * 2) / 10;
//Initialize values
fuel
final int GRAVITY ==fuel
2; - burnRate;
if(inputLine.startsWith("#")){
int altitudeif(altitude
= 1000;
//This is <=a 0){
status line of text, and
altitude = 0;
int fuel = 500; //should be passed down the pipeline
int velocity =if(velocity
70; <= 5){
System.out.println(inputLine);
int time = 0; } System.out.println("#You have landed safely.");
}
else if(inputLine.startsWith("%")){
try{ else{
//This is an input burn rate
System.out.println("#You
BufferedReadertry{inputReader = new have crashed.");
}
BufferedReader(new
int burnRate
InputStreamReader(System.in));
= Integer.parseInt(inputLine.substring(1));
} if(altitude <= 0){
}
//Print initial valuesSystem.out.println("#The game is over.");
//Print new
System.out.println("%a"
} values
+ altitude);
System.out.println("%a"
System.out.println("%f" + fuel);+> altitude);
else if(burnRate fuel){
System.out.println("%f"
System.out.println("%v" + fuel);
System.out.println("#Sorry,
+ velocity); you don't" +
System.out.println("%v"
System.out.println("%t" "have+ that
time); + velocity);
much fuel.");
System.out.println("%t"
} + time);
. . . . . .}
catch(NumberFormatException nfe){
} 83
. . .
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
CalcBurnRate Filter
else{ inputLine = null;
import java.io.*;
String
//Calculate new application state
do{
time = time
public class CalcNewValues{
inputLine + 1;
= inputReader.readLine();
altitude = altitude
if((inputLine - velocity;
!= null) &&
velocity
public static void = ((velocity
(inputLine.length()
main(String[] args){ + GRAVITY) * 10 -
> 0)){
burnRate * 2) / 10;
//Initialize values
fuel
final int GRAVITY ==fuel
2; - burnRate;
if(inputLine.startsWith("#")){
int altitudeif(altitude
= 1000;
//This is <=a}0){
status line of text, and
altitude = 0;
int fuel = 500; //should }be passed down the pipeline
int velocity =if(velocity
70; <= 5){
}while((inputLine
System.out.println(inputLine);!= null) && (altitude > 0));
int time = 0; } System.out.println("#You
inputReader.close(); have landed safely.");
}
else }
if(inputLine.startsWith("%")){
try{ else{ catch(IOException
//This is an input burnioe){
rate
System.out.println("#You
BufferedReadertry{ ioe.printStackTrace();
inputReader = new have crashed.");
} int} burnRate
BufferedReader(new InputStreamReader(System.in));
= Integer.parseInt(inputLine.substring(1));
} }
if(altitude <= 0){
} }
//Print initial values
System.out.println("#The game is over.");
//Print new
System.out.println("%a"
} values+ altitude);
System.out.println("%a"
System.out.println("%f" + fuel);+> altitude);
else if(burnRate fuel){
System.out.println("%f"
System.out.println("%v" + fuel);
System.out.println("#Sorry,
+ velocity); you don't" +
System.out.println("%v"
System.out.println("%t" "have + that
time); + velocity);
much fuel.");
System.out.println("%t"
} + time);
. . . . . .}
catch(NumberFormatException nfe){
} 84
. . .
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
85
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
DisplayValues Filter
import java.io.*;
if(inputLine.startsWith("#")){
//This is a status line of text, and
//should be passed down the pipeline with
//the pound-sign stripped off
System.out.println(inputLine.substring(1));
}
. . . 86
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
DisplayValues Filter
else if(inputLine.startsWith("%")){
import java.io.*;//This is a value to display
if(inputLine.length() > 1){
public class DisplayValues{
try{
char valueType = inputLine.charAt(1);
public static void int
main(String[] args){
value = Integer.parseInt(inputLine.substring(2));
try{
BufferedReader switch(valueType){
inputReader = new
BufferedReader(new
case InputStreamReader(System.in));
'a':
System.out.println("Altitude: " + value);
String inputLine = break;
null;
do{ case 'f':
inputLine = inputReader.readLine();
System.out.println("Fuel remaining: " + value);
if((inputLine != break;
null) &&
(inputLine.length()
case 'v':> 0)){
System.out.println("Current Velocity: “ + value);
if(inputLine.startsWith("#")){
break;
//This is acase
status
't':line of text, and
//should be passed down the pipeline with
System.out.println("Time elapsed: " + value);
//the pound-sign stripped
break; off
System.out.println(inputLine.substring(1));
}
} }
catch(NumberFormatException nfe){
. . . }
. . .
87
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
DisplayValues Filter
else if(inputLine.startsWith("%")){
import java.io.*;//This is a value to display
if(inputLine.length() > 1){
public class DisplayValues{
try{
char valueType = inputLine.charAt(1);
public static void int
main(String[] args){
value = Integer.parseInt(inputLine.substring(2));
try{
BufferedReader switch(valueType){
inputReader = new
}
BufferedReader(new InputStreamReader(System.in));
case 'a': }
System.out.println("Altitude:
} " + value);
String inputLine = break;
null;
}while(inputLine != null);
do{ case 'f':
inputReader.close();
inputLine = inputReader.readLine();
System.out.println("Fuel remaining: " + value);
}
if((inputLine != break;
null) &&
catch(IOException ioe){
(inputLine.length()
case 'v':> 0)){
ioe.printStackTrace();
System.out.println("Current
} Velocity: “ + value);
if(inputLine.startsWith("#")){
}break;
//This is acase
status
't':line of text, and
}
//should be passed down the pipeline with
System.out.println("Time elapsed: " + value);
//the pound-sign
break;stripped off
System.out.println(inputLine.substring(1));
}
} }
catch(NumberFormatException nfe){
. . . }
. . .
88
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
89
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
90
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
91
Software Architecture: Foundations, Theory, and Practice
92
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
93
Software Architecture: Foundations, Theory, and Practice
Takeaways
java.io provides a number of useful facilities
Stream objects (System.in, System.out)
Buffering wrappers
OS provides some of the facilities
Pipes
Concurrency support
Note that this version of the application would not work if it
operated in batch-sequential mode
We had other communication mechanisms available, but did not use
them to conform to the P&F style
We had to develop a new (albeit simple) protocol to get the correct
behavior
94
Software Architecture: Foundations, Theory, and Practice
Framework: Lightweight
C2 framework
Each component has its
own thread of control
Components receive
requests or notifications
and respond with new
ones
Message routing follows
C2 rules
This is a real-time, clock-driven version of Lunar Lander
95
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
96
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
import c2.framework.*;
Clock Component
public class Clock extends ComponentThread{
public Clock(){
super.create("clock", FIFOPort.class);
}
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
import c2.framework.*;
Clock Component
public class Clock extends ComponentThread{
public Clock(){
super.create("clock", FIFOPort.class);
}
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Second: GameState
Component
Receives request to update
internal state
Emits notifications of new
game state on request
or when state changes
Does NOT compute new
state
Just a data store
99
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GameState Component
import c2.framework.*;
public GameState(){
super.create("gameState", FIFOPort.class);
}
100
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GameState Component
protected void handle(Request r){
if(r.name().equals("updateGameState")){
//Update the internal game state
if(r.hasParameter("altitude")){
import c2.framework.*;
this.altitude = ((Integer)r.getParameter("altitude")).intValue();
}
public class GameState extends ComponentThread{
if(r.hasParameter("fuel")){
this.fuel = ((Integer)r.getParameter("fuel")).intValue();
public GameState(){
}
super.create("gameState", FIFOPort.class);
} if(r.hasParameter("velocity")){
this.velocity = ((Integer)r.getParameter("velocity")).intValue();
}
//Internal game state and initial values
if(r.hasParameter("time")){
int altitude = 1000;
int fuel this.time
= 500; = ((Integer)r.getParameter("time")).intValue();
}
int velocity = 70;
if(r.hasParameter("burnRate")){
int time = 0;
this.burnRate
int burnRate = 0; = ((Integer)r.getParameter("burnRate")).intValue();
boolean} landedSafely = false;
if(r.hasParameter("landedSafely")){
this.landedSafely = ((Boolean)r.getParameter("landedSafely"))
.booleanValue();
}
//Send out the updated game state
Notification n = createStateNotification();
send(n); 101
}
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GameState Component
protected else
void if(r.name().equals("getGameState")){
//If
handle(Request r){
a component requests the game state
if(r.name().equals("updateGameState")){
//Update//without updating
the internal gameit, send out the state
state
if(r.hasParameter("altitude")){
import c2.framework.*;
Notification
this.altitude n = createStateNotification();
= ((Integer)r.getParameter("altitude")).intValue();
} send(n);
public class GameState extends ComponentThread{
}
if(r.hasParameter("fuel")){
}
this.fuel = ((Integer)r.getParameter("fuel")).intValue();
public GameState(){
}
super.create("gameState", FIFOPort.class);
protected Notification createStateNotification(){
if(r.hasParameter("velocity")){
}
//Create a new
this.velocity notification comprising the
= ((Integer)r.getParameter("velocity")).intValue();
} //current game state
//Internal game state and initial values
if(r.hasParameter("time")){
int altitude = 1000;
Notification
this.time n = new Notification("gameState");
= ((Integer)r.getParameter("time")).intValue();
int fuel = 500;
} n.addParameter("altitude", altitude);
int velocity = 70;
n.addParameter("fuel",
if(r.hasParameter("burnRate")){ fuel);
int time = 0;
n.addParameter("velocity",
this.burnRate velocity);
= ((Integer)r.getParameter("burnRate")).intValue();
int burnRate = 0;
n.addParameter("time", time);
boolean} landedSafely = false;
n.addParameter("burnRate", burnRate);
if(r.hasParameter("landedSafely")){
n.addParameter("landedSafely",
this.landedSafely landedSafely);
= ((Boolean)r.getParameter("landedSafely"))
return n;
.booleanValue();
} }
protected
//Send void
out the handle(Notification
updated game state n){
//This component
Notification does not handle notifications
n = createStateNotification();
}
send(n); 102
} }
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
103
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GameLogic Component
import c2.framework.*;
//Game constants
final int GRAVITY = 2;
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GameLogic Component
protected void handle(Notification n){
if(n.name().equals("gameState")){
import c2.framework.*;
if(n.hasParameter("altitude")){
this.altitude =
public class GameLogic extends ComponentThread{
((Integer)n.getParameter("altitude")).intValue();
public GameLogic(){
}
super.create("gameLogic", FIFOPort.class);
if(n.hasParameter("fuel")){
} this.fuel =
((Integer)n.getParameter("fuel")).intValue();
//Game constants
}
final int GRAVITY = 2;
if(n.hasParameter("velocity")){
this.velocity =
//Internal state values for computation
((Integer)n.getParameter("velocity")).intValue();
int altitude
} = 0;
int fuel = if(n.hasParameter("time")){
0;
int velocity this.time
= 0; =
int time = 0; ((Integer)n.getParameter("time")).intValue();
int burnRate
} = 0;
if(n.hasParameter("burnRate")){
public void start(){
this.burnRate =
super.start();((Integer)n.getParameter("burnRate")).intValue();
Request r} = new Request("getGameState");
send(r);
}
}
105
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GameLogic Component
protected void handle(Notification n){
if(n.name().equals("gameState")){
else
import if(n.name().equals("clockTick")){
if(n.hasParameter("altitude")){
c2.framework.*;
//Calculate new lander= state values
this.altitude
public int
classactualBurnRate
GameLogic = burnRate;
((Integer)n.getParameter("altitude")).intValue();
extends ComponentThread{
if(actualBurnRate
}
public GameLogic(){ > fuel){
//Ensure we don’t burnFIFOPort.class);
more fuel than we have
if(n.hasParameter("fuel")){
super.create("gameLogic",
} actualBurnRate
this.fuel == fuel;
} ((Integer)n.getParameter("fuel")).intValue();
}
//Game constants
finaltime
int =GRAVITY
time + =1;2;
if(n.hasParameter("velocity")){
altitudethis.velocity
= altitude - =velocity;
velocity
//Internal =((Integer)n.getParameter("velocity")).intValue();
state ((velocity
values for+ computation
GRAVITY) * 10 –
actualBurnRate
int altitude } = 0; * 2) / 10;
fuel ==if(n.hasParameter("time")){
int fuel fuel - actualBurnRate;
0;
int velocity this.time
= 0; =
//Determine
int time if we landed (safely)
= 0; ((Integer)n.getParameter("time")).intValue();
boolean
int burnRate } landedSafely
= 0; = false;
if(altitude <= 0){
if(n.hasParameter("burnRate")){
public altitude = 0;
this.burnRate
void start(){ =
if(velocity
super.start(); <= 5){
((Integer)n.getParameter("burnRate")).intValue();
RequestlandedSafely = true;
r} = new Request("getGameState");
} }
send(r);
} }
106
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GameLogic Component
protected void handle(Notification n){
if(n.name().equals("gameState")){
else if(n.name().equals("clockTick")){
if(n.hasParameter("altitude")){
import //Calculate
c2.framework.*; new lander= state values
this.altitude
int actualBurnRate = burnRate;
((Integer)n.getParameter("altitude")).intValue();
public if(actualBurnRate
class }GameLogic extends > fuel){ComponentThread{
public //Ensure
GameLogic(){
Request werdon’t
= newburn
Request("updateGameState");
more fuel than we have
if(n.hasParameter("fuel")){
super.create("gameLogic",
r.addParameter("time",
actualBurnRate
this.fuel == fuel; FIFOPort.class);
time);
} } r.addParameter("altitude", altitude);
((Integer)n.getParameter("fuel")).intValue();
r.addParameter("velocity",
} velocity);
//Game constants
time = r.addParameter("fuel",
time + 1; fuel);
if(n.hasParameter("velocity")){
finalaltitude
int r.addParameter("landedSafely",
GRAVITY = 2;
= altitude
this.velocity - =velocity; landedSafely);
velocitysend(r);
=((Integer)n.getParameter("velocity")).intValue();
((velocity + GRAVITY) * 10 –
//Internal} } state
actualBurnRate values for/ computation
* 2) 10;
int altitude
}
fuel = 0;
=if(n.hasParameter("time")){
fuel - actualBurnRate;
int fuel = 0;this.time =
int velocity
protected
//Determine = ((Integer)n.getParameter("time")).intValue();
0;
void
if wehandle(Request
landed (safely) r){
int time
boolean= }0;landedSafely
//This component does not handle requests
= false;
int burnRate
}
if(altitude = 0;<= 0){
if(n.hasParameter("burnRate")){
} altitude = 0;
this.burnRate =
public if(velocity
void start(){ <= 5){
((Integer)n.getParameter("burnRate")).intValue();
super.start();
landedSafely
} = true;
Request} } r = new Request("getGameState");
send(r);
}
} 107
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
108
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GUI Component
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import c2.framework.*;
109
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GUI Component
System.out.println("Welcome to Lunar Lander");
try{
BufferedReader inputReader = new BufferedReader(
new InputStreamReader(System.in));
import java.io.BufferedReader;
import java.io.IOException;
int burnRate = 0;
import java.io.InputStreamReader;
do{
System.out.println("Enter burn rate or <0 to quit:");
import c2.framework.*;
try{
public class GUI String
extendsburnRateString = inputReader.readLine();
ComponentThread{
public GUI(){ burnRate = Integer.parseInt(burnRateString);
super.create("gui", FIFOPort.class);
} Request r = new Request("updateGameState");
r.addParameter("burnRate", burnRate);
send(r);
public void start(){
}
super.start();
Thread t = catch(NumberFormatException
new Thread(){ nfe){
public voidSystem.out.println("Invalid
run(){ burn rate.");
}
processInput();
} }while(burnRate >= 0);
}; inputReader.close();
}
t.start();
} catch(IOException ioe){
ioe.printStackTrace();
}
} 110
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GUI Component
System.out.println("Welcome to Lunar Lander");
protected try{
void handle(Notification n){
BufferedReader inputReader = new BufferedReader(
if(n.name().equals("gameState")){
import java.io.BufferedReader;
new InputStreamReader(System.in));
System.out.println();
import java.io.IOException; game state:");
System.out.println("New
import java.io.InputStreamReader;
int burnRate = 0;
do{
if(n.hasParameter("altitude")){
import c2.framework.*;
System.out.println("Enter
System.out.println(" Altitude: " burn rate or <0 to quit:");
+ n.getParameter("altitude"));
} try{
public class GUI String
extendsburnRateString
ComponentThread{
if(n.hasParameter("fuel")){ = inputReader.readLine();
publicSystem.out.println("
GUI(){ burnRate = Integer.parseInt(burnRateString);
Fuel: " + n.getParameter("fuel"));
super.create("gui",
} FIFOPort.class);
} if(n.hasParameter("velocity")){
Request r = new Request("updateGameState");
r.addParameter("burnRate",
System.out.println(" burnRate);
Velocity: " + n.getParameter("velocity"));
public
} void start(){
send(r);
super.start();
}
if(n.hasParameter("time")){
Thread t = catch(NumberFormatException
new Thread(){ Time: " + n.getParameter("time"));
System.out.println(" nfe){
}public voidSystem.out.println("Invalid
run(){ burn rate.");
processInput();
}
if(n.hasParameter("burnRate")){
} System.out.println("
}while(burnRate >= 0);rate: " + n.getParameter("burnRate"));
Burn
};
} inputReader.close();
t.start();
}
} catch(IOException ioe){
ioe.printStackTrace();
}
} 111
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
GUI Component
System.out.println("Welcome to Lunar Lander");
try{
protectedif(n.hasParameter("altitude")){
void handle(Notification n){
BufferedReader inputReader = new BufferedReader(
if(n.name().equals("gameState")){
int altitude =
import java.io.BufferedReader;
new InputStreamReader(System.in));
System.out.println();
((Integer)n.getParameter("altitude")).intValue();
import java.io.IOException;
System.out.println("New
if(altitude game state:");
int burnRate<= = 0){
import java.io.InputStreamReader;
0;
boolean landedSafely =
do{
if(n.hasParameter("altitude")){
((Boolean)n.getParameter("landedSafely"))
import c2.framework.*;
System.out.println("Enter burn rate or <0 to quit:");
System.out.println(" Altitude: " + n.getParameter("altitude"));
.booleanValue();
try{
} if(landedSafely){
public class GUI extendsburnRateString
ComponentThread{
String = inputReader.readLine();
if(n.hasParameter("fuel")){
public GUI(){ System.out.println("You have landed safely.");
burnRate = Integer.parseInt(burnRateString);
System.out.println("
}
super.create("gui", Fuel: " +
FIFOPort.class); n.getParameter("fuel"));
} } else{
Request r = new Request("updateGameState");
if(n.hasParameter("velocity")){
System.out.println("You have crashed.");
r.addParameter("burnRate", burnRate);
System.out.println("
} send(r);
public void start(){ Velocity: " + n.getParameter("velocity"));
} System.exit(0);
super.start();
}
if(n.hasParameter("time")){
}
Thread t = catch(NumberFormatException
new Thread(){ nfe){
System.out.println("
} Time: " +
public voidSystem.out.println("Invalid
run(){ n.getParameter("time"));
burn rate.");
} processInput();
} }
if(n.hasParameter("burnRate")){
}} }while(burnRate >= 0);
}; System.out.println("
inputReader.close();
Burn rate: " + n.getParameter("burnRate"));
}protected void handle(Request r){
t.start();
}
} //This component does
catch(IOException not handle requests
ioe){
} ioe.printStackTrace();
} }
} 112
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
113
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
import c2.framework.*;
Main Program
public class LunarLander{
lunarLander.addConnector(bus);
114
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
import c2.framework.*;
Main Program
public class LunarLander{
lunarLander.addConnector(bus);
115
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Takeaways
116
Applied
Architectures
Software Architecture
Lecture 17
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Objectives
118
Software Architecture: Foundations, Theory, and Practice
Outline
REST
Decentralized applications
Peer-to-peer
Web services
Wireless sensors
Flight simulators
119
Software Architecture: Foundations, Theory, and Practice
120
Software Architecture: Foundations, Theory, and Practice
121
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
122
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
And this
123
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
WWW’s Architecture
The application is distributed (actually, decentralized)
hypermedia
Architecture of the Web is wholly separate from the code
There is no single piece of code that implements the
architecture.
There are multiple pieces of code that implement the various
components of the architecture.
E.g., different Web browsers
Stylistic constraints of the Web’s architectural style are not
apparent in the code
The effects of the constraints are evident in the Web
One of the world’s most successful applications is only
understood adequately from an architectural vantage point.
124
Software Architecture: Foundations, Theory, and Practice
REST Principles
[RP1] The key abstraction of information is a resource,
named by an URL. Any information that can be named
can be a resource.
[RP2] The representation of a resource is a sequence of
bytes, plus representation metadata to describe those
bytes. The particular form of the representation can be
negotiated between REST components.
[RP3] All interactions are context-free: each interaction
contains all of the information necessary to understand
the request, independent of any requests that may have
preceded it.
125
Software Architecture: Foundations, Theory, and Practice
126
Software Architecture: Foundations, Theory, and Practice
127
Software Architecture: Foundations, Theory, and Practice
REST Constraints
Client–server A uniform interface separates clients from servers.
This separation of concerns means that, for example, clients are not
concerned with data storage, which remains internal to each server,
so that the portability of client code is improved. Servers are not
concerned with the user interface or user state, so that servers can be
simpler and more scalable. Servers and clients may also be replaced
and developed independently, as long as the interface between them
is not altered.
Stateless The client–server communication is further constrained by
no client context being stored on the server between requests. Each
request from any client contains all of the information necessary to
service the request, and session state is held in the client. Important
to note is that the session state can be transferred by the server to
another service such as a database to maintain a persistent state for a
period of time and allow authentication.
128
Software Architecture: Foundations, Theory, and Practice
REST Constraints
Cacheable As on the World Wide Web, clients can cache
responses. Responses must therefore, implicitly or
explicitly, define themselves as cacheable, or not, to
prevent clients reusing stale or inappropriate data in
response to further requests. Well-managed caching
partially or completely eliminates some client–server
interactions, further improving scalability and
performance.
Layered system A client cannot ordinarily tell whether it
is connected directly to the end server, or to an
intermediary along the way. Intermediary servers may
improve system scalability by enabling load-balancing
and by providing shared caches. They may also enforce
129
security policies.
Software Architecture: Foundations, Theory, and Practice
REST Constraints
Code on demand (optional) Servers can temporarily
extend or customize the functionality of a client by the
transfer of executable code. Examples of this may
include compiled components such as Java applets and
client-side scripts such as JavaScript. "Code on demand"
is the only optional constraint of the REST architecture.
Uniform interface The uniform interface between clients
and servers, discussed below, simplifies and decouples
the architecture, which enables each part to evolve
independently. The four guiding principles of this
interface are detailed below.
130
Software Architecture: Foundations, Theory, and Practice
An Instance of REST
$ $ o rb
h ttp h ttp
h ttp
a
User Agent DNS
b
$ $
h ttp
c Pro xy
DNS $
h ttp wais
131
Software Architecture: Foundations, Theory, and Practice
Resource
Key information abstraction
Resource ID
Representation
Data plus metadata
Representation metadata
Resource metadata
Control data
e.g., specifies action as result of message
132
Software Architecture: Foundations, Theory, and Practice
REST — Connectors
133
Software Architecture: Foundations, Theory, and Practice
REST — Components
User agent
e.g., browser
Origin server
e.g., Apache Server, Microsoft IIS
Proxy
Selected by client
Gateway
Squid, CGI, Reverse proxy
Controlled by server
134
Software Architecture: Foundations, Theory, and Practice
An Instance of REST
$ $ o rb
h ttp h ttp
h ttp
a
User Agent DNS
b
$ $
h ttp
c Pro xy
DNS $
h ttp wais
135
Software Architecture: Foundations, Theory, and Practice
Derivation of REST
137
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
138
Software Architecture: Foundations, Theory, and Practice
Commercial Internet-Scale
Applications
Akamai
Caching to the max
Google
Google distributed file system (GFS)
MapReduce
139
Software Architecture: Foundations, Theory, and Practice
140
Software Architecture: Foundations, Theory, and Practice
141
Applied Architectures,
Part 2
Software Architecture
Lecture 18
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Decentralized Architectures
143
Software Architecture: Foundations, Theory, and Practice
GLOBUS
A commonly used infrastructure
“Standard architecture”
Fabric manages low-level
resources
Connectivity: communication and
authentication
Resource: sharing of a single r.
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
145
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Peer-to-Peer Architectures
Gnutella
146
Software Architecture: Foundations, Theory, and Practice
Peer-to-Peer Style
State and behavior are distributed among peers
which can act as either clients or servers.
Peers: independent components, having their own
state and control thread.
Connectors: Network protocols, often custom.
Data Elements: Network messages
Topology: Network (may have redundant connections
between peers); can vary arbitrarily and dynamically
Supports decentralized computing with flow of
control and resources distributed among peers.
Highly robust in the face of failure of any given node.
Scalable in terms of access to resources and
computing power. But caution on the protocol!
147
Software Architecture: Foundations, Theory, and Practice
Peer-to-Peer LL
148
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
149
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Gnutella (original)
150
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Skype
151
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Web Services
153
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
154
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Mobile Robotics
Manned or partially manned vehicles
Uses
Space exploration
Underwater exploration
Issues
Interface with external sensors & actuators
Response to obstacles
Power failures
Mechanical limitations
Unpredictable events
155
Software Architecture: Foundations, Theory, and Practice
Robotics: Sense-Plan-Act
156
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Robotics Subsumption
Architecture
157
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Robotics: Three-Layer
158
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
159
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Distributed development
Portions of work subcontracted to specialists
Functional Model
Cockpit
Simulation Displays Cockpit
Models Controls
Visual
Air Cueing
Vehicle System
Crew
Motion
Cueing
Environment
System
Audio
Cueing
Instructor/ System
Operator
Station 162
Software Architecture: Foundations, Theory, and Practice
Based on
Integrability
Scalability
163
Software Architecture: Foundations, Theory, and Practice
164
Software Architecture: Foundations, Theory, and Practice
No side-effects of computations
165
Software Architecture: Foundations, Theory, and Practice
Periodic sequencer
Event handler
Synchronizer
Application
Components
Subsystems
Each of the five has
Small API
Encapsulated state
Level–0 Architecture
167
Software Architecture: Foundations, Theory, and Practice
Level–1 Architecture
168
Software Architecture: Foundations, Theory, and Practice
Takeaways
169
Designing for NFPs
Software Architecture
Lecture 19
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
What Is an NFP?
Complexity
Scalability
Heterogeneity
Adaptability
Dependability
2
Software Architecture: Foundations, Theory, and Practice
4
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
7
Software Architecture: Foundations, Theory, and Practice
8
Software Architecture: Foundations, Theory, and Practice
Overarching Objective
Components
Connectors
Configurations
As embodied in architectural style-level design
guidelines
9
Software Architecture: Foundations, Theory, and Practice
Efficiency
11
Software Architecture: Foundations, Theory, and Practice
12
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
13
Software Architecture: Foundations, Theory, and Practice
Distribution Transparency
14
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
15
Software Architecture: Foundations, Theory, and Practice
16
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
NFP Design
Techniques
Software Architecture
Lecture 20
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Complexity
IEEE Definition
Complexity is the degree to which a software
system or one of its components has a design or
implementation that is difficult to understand and
verify
Complexity is a software system’s a property that is
directly proportional to the size of the system, number of
its constituent elements, their internal structure, and the
number and nature of their interdependencies
2
Software Architecture: Foundations, Theory, and Practice
3
Software Architecture: Foundations, Theory, and Practice
4
Software Architecture: Foundations, Theory, and Practice
5
Software Architecture: Foundations, Theory, and Practice
Complexity in Linux
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
7
Software Architecture: Foundations, Theory, and Practice
8
Software Architecture: Foundations, Theory, and Practice
9
Software Architecture: Foundations, Theory, and Practice
10
Software Architecture: Foundations, Theory, and Practice
Adaptability
11
Software Architecture: Foundations, Theory, and Practice
12
Software Architecture: Foundations, Theory, and Practice
13
Software Architecture: Foundations, Theory, and Practice
Composable Connectors
14
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
15
Software Architecture: Foundations, Theory, and Practice
Dependability
Dependability is a collection of system properties that allows
one to rely on a system functioning as required
Reliability is the probability that a system will perform its
intended functionality under specified design limits, without
failure, over a given time period
Availability is the probability that a system is operational at
a particular time
Robustness is a system’s ability to respond adequately to
unanticipated runtime conditions
Fault-tolerant is a system’s ability to respond gracefully to
failures at runtime
Survivability is a system’s ability to resist, recognize,
recover from, and adapt to mission-compromising threats
Safety denotes the ability of a software system to avoid
failures that will result in (1) loss of life, (2) injury, (3)
significant damage to property, or (4) destruction of
property 16
Software Architecture: Foundations, Theory, and Practice
17
Software Architecture: Foundations, Theory, and Practice
18
Software Architecture: Foundations, Theory, and Practice
19
Security and Trust
Software Architecture
Lecture 21
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Outline
Security
Design Principles
Architectural Access Control
Access Control Models
Connector-Centric Architectural Access Control
Trust
Trust Model
Reputation-based Systems
Architectural Approach to Decentralized Trust
Management
2
Software Architecture: Foundations, Theory, and Practice
Security
3
Software Architecture: Foundations, Theory, and Practice
4
Software Architecture: Foundations, Theory, and Practice
5
Software Architecture: Foundations, Theory, and Practice
6
Software Architecture: Foundations, Theory, and Practice
8
Software Architecture: Foundations, Theory, and Practice
Bob: Secret
Alice: Confidential
Tom: Top Secret
Connector-Centric Architectural
Access Control
Decide what subjects the connected components are
executing for
Regulate whether components have sufficient privileges
to communicate through the connectors
Provide secure interaction between insecure components
Propagate privileges in architectural access check
Participate in deciding architectural connections
Route messages according to established policies
Decentralization
12
Software Architecture: Foundations, Theory, and Practice
Decentralized Auctioning
Carol
14
Software Architecture: Foundations, Theory, and Practice
Impersonation
Bob
Alice
“I am Bob”
Mallory
(malicious)
15
Software Architecture: Foundations, Theory, and Practice
Fraudulent Actions
Alice pays
for the items
Marvin does
Marvin “seller”
not ship the items Alice “buyer”
(malicious)
16
Software Architecture: Foundations, Theory, and Practice
Misrepresentation
Bob
Alice
“Bob is unreliable”
Mallory
(malicious)
17
Software Architecture: Foundations, Theory, and Practice
Collusion
Bob
Alice
“Bob is unreliable”
Marvin
(malicious) Mallory
(malicious)
18
Software Architecture: Foundations, Theory, and Practice
Addition of Unknowns
Carol
(new entrant in the system)
Bob Alice
19
Software Architecture: Foundations, Theory, and Practice
Trust
Trust is a particular level of the subjective probability with which
an agent assesses that another agent will perform a particular
action in a context that affects his actions [Gambetta, 1990]
Reputation
Expectation about an entity’s behavior based on past behavior
[Abdul-Rahman, 2000]
May be used to determine trust
Reputation-based
20
Software Architecture: Foundations, Theory, and Practice
Reputation-based
21
Software Architecture: Foundations, Theory, and Practice
22
Software Architecture: Foundations, Theory, and Practice
Approach
23
Software Architecture: Foundations, Theory, and Practice
Key Insights
Trust
Cannot be isolated to one component
25
Software Architecture: Foundations, Theory, and Practice
Design Guidelines
Threats Strategies
Impersonation Digital identities, signature-based
verification
Fraudulent Actions Explicit trust, comparable trust
Misrepresentation Explicit trust, comparable trust,
separation of internal and external data
Collusion Explicit trust, comparable trust,
separation of internal and external data
Addition of unknowns Implicit trust of user
26
Software Architecture: Foundations, Theory, and Practice
27
Software Architecture: Foundations, Theory, and Practice
Functional Units
Communication
Responsible for external interaction with other peers
including data collection and transmission; does not
depend upon data storage or analysis
Information
Store all data including internal beliefs and reported
information
Trust
Responsible for trust computation and managing
credentials; depends upon internal data for computation
Application
Application-specific components including user interface;
Builds upon services provided by the other three
28
Software Architecture: Foundations, Theory, and Practice
Communication
HTTP Sender Custom Protocols Multicast Manager
Layer
Communication
Manager
Signature Manager
Information
Layer
Internal External
Information Information
Credentia
Key Trust
Layer
Layer Trust
l
Manager Manager
Manager
Application
Application Trust Rules
APPLICATION
29
Software Architecture: Foundations, Theory, and Practice
Layer
Communication
HTTP Sender Custom Protocols Multicast Manager
Layer
Multiple protocol Communication Manager
handlers. Translate
internal events into
external messages and Signature Manager
vice-versa
Information
Creates and manages
Layer
Internal External
protocol handlers Information Information
Signs requests and
verifies notifications
Key Credential Trust
Layer
Trust
Manager Manager Manager
Application
Application Trust Rules
Layer
APPLICATION 30
Software Architecture: Foundations, Theory, and Practice
Communication
HTTP Sender Custom Protocols Multicast Manager
Layer
Communication Manager
Separates internal
beliefs from reported Signature Manager
information
Information
Stores internal beliefs
Layer
persistently Internal External
Information Information
Layer
Trust
Manager Manager Manager
Application
Application Trust Rules
Layer
APPLICATION 31
Software Architecture: Foundations, Theory, and Practice
Communication
HTTP Sender Custom Protocols Multicast Manager
Layer
Incorporates different
trust models and Communication Manager
algorithms; can
assign trust values to
Signature Manager
notifications received
Information
Generates unique
public-private key
Layer
Internal External
pairs Information Information
Maintains local cache
of other peers’ Key Credential Trust
Layer
identities; requests
Trust
Manager Manager Manager
public keys from
peers and responds
to revocations
Application
Application Trust Rules
Layer
APPLICATION 32
Software Architecture: Foundations, Theory, and Practice
Multicast Handler
PACE: Application Layer
Communication
HTTP Sender Custom Protocols Multicast Manager
Layer
Communication Manager
Domain-specific
trust rules;
includes context Signature Manager
of trust
Information
User-interface and
Layer
Internal External
application- Information Information
specific
components
Key Credential Trust
Layer
Trust
Manager Manager Manager
Application
Application Trust Rules
Layer
APPLICATION
33
Software Architecture: Foundations, Theory, and Practice
Multicast Handler
Countering Fraudulent Actions
Communication
HTTP Sender Custom Protocols Multicast Manager
Layer
User sends request for
trust information Communication Manager
Others respond
Responses are verified Signature Manager
and tagged with trust
Information
values
Layer
User sees these Internal External
messages and makes an Information Information
informed decision
Post-interaction, user Key Credential Trust
Layer
Trust
can change trust Manager Manager Manager
information
Application
Application Trust Rules
Layer
APPLICATION
34
Software Architecture: Foundations, Theory, and Practice
Carol
Trust-enabled
Trust-enabled entity
entity
Bob
architecture
architecture
Alice
Decentralized Trust-enabled
entity
Auctioning architecture
Mallory
Marvin
(malicious) 35
(malicious)
Deployment and
Mobility
Software Architecture
Lecture 22
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
2
Software Architecture: Foundations, Theory, and Practice
Then Now
Complete Installation Software producers and
procedure for software consumers cooperating
system on CD ROM and negotiating.
Entire software system “Update” of Software
installation Systems
5
Software Architecture: Foundations, Theory, and Practice
6
Software Architecture: Foundations, Theory, and Practice
Deployment Activities
Architecture driven s/w deployment comprises a process
that must be carefully planned, modeled, analyzed, and
executed.
Planning
Modeling
Analysis
Implementation
7
Software Architecture: Foundations, Theory, and Practice
Deployment Planning
How do we find and effect a deployment architecture
that improves multiple QoS dimensions?
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Latency
Schedule
ModifyResourceMap ResourceMonitor
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Durability Latency
Schedule
ModifyResourceMap ResourceMonitor
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Durability Latency
Guiding Insight
System users have
varying QoS preferences
for the system services Allows expression of optimization
they access in terms of a single scalar value 11
Software Architecture: Foundations, Theory, and Practice
Dep 1
A Slightly Larger
20
Dep 2
Dep 3
18
Dep 4
Dep 5
16 Dep 6
Scenario
Dep 7
Durability (hours) x
14 Dep 8
Dep 9
12 Dep 10
Dep 11
Dep 12
10
Dep 13
Dep 14
8 Dep 15
Dep 16
Troop Commander Dispatcher
6 Dep 17
Dep 18
4 Dep 19
Dep 20
80 Dep 21
2
Dep 22
Dep 23
0 Dep 24
0 70 Security 5 10
Durability Latency
15 20 25 Dep 25
Dep 26 Troop, Latency, Exchange Plan
Latency (ms)
Dep 27
Troop, Latency, Schedule
60
Troop, Durability, Exchange Plan
Dep 1
Troop, Durability, Schedule Dep 1
40 50 Exchange Plan Schedule
Dep 2
40
Dep 2
Dep 3
Troop, Security, Exchange Plan Dep 3
Dep 4 35 Dep 4
Utility x
35
Troop, Security, Schedule
40ModifyResourceMap ResourceMonitor Dep 5
Dep 6
Dep 5
Dep 6
30 Dep 7 30 Commander, Latency, Exchange
Dep 7
Dep 8 Plan Dep 8
x
CreatePlan Commander, Latency, Schedule
Dep 9
30 Dep 9
x
25 25
Dep 10 Dep 10
Dep 11
Commander, Durability, Exchange
Dep 11
Plan
Security
Dep 12
Security
20 Dep 12
20
Dep 13
20 Dep 14
Dep 13
Dep 14
Dep 15 15
15 Dep 15
Dep 16 Dep 16
Dep 17
10
10 Dep 18
10 Dep 17
Dep 18
Dep 19
Dep 19
Dep 20
5 Dep 20
5 Dep 21
0 Dep 22
Dep 21
Dep 22
Dep 23 0
0 0% 100% 200% 300% 400% 500% Dep
600%24 700% 0 5 10 15 20 25
Dep 23
Deployment Modelling
13
Software Architecture: Foundations, Theory, and Practice
Deployment Modeling
14
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Deployment Analysis
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
B. Genetic
C. Decentralized
19
Software Architecture: Foundations, Theory, and Practice
Deployment Implementation
Release
Install
Activate
Deactivate
Update
Adapt
Reconfigure
De-install or remove
De-release or retire
20
Software Architecture: Foundations, Theory, and Practice
21
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
22
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Mobility
Mobile computing involves the movement of human
users together with their hosts across different physical
locations
This is also referred to as physical mobility
Mobility Paradigms
Remote evaluation
Re-deploy needed component at runtime from a source
host to a destination host
Install component on the destination host
Ensure that the system’s architectural configuration and
any architectural constraints are preserved
Activate the component
Executed the component to provide the desired service
Possibly de-activate and de-install
Code-on-demand
Same as remote evaluation, but roles of target and
destination hosts are reversed
Mobile agent
Migration of a stateful software component that needs
some remote resources to complete its task 24
Software Architecture: Foundations, Theory, and Practice
25
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Closing Thoughts
26
Intro to Domain-
Specific Software
Engineering
Software Architecture
Lecture 23
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
What is domain-specific software engineering
(DSSE)
The “Three Lampposts” of DSSE: Domain,
Business, and Technology
Domain Specific Software Architectures
Product Lines
Relationship between DSSAs, Product Lines, and
Architectural Styles
Examples of DSSE at work 2
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
What is domain-specific software engineering
(DSSE)
The Three Key Factors of DSSE: Domain,
Business, and Technology
Domain Specific Software Architectures
Product Lines
Relationship between DSSAs, Product Lines, and
Architectural Styles
Examples of DSSE at work 3
Software Architecture: Foundations, Theory, and Practice
Domain-Specific Software
Engineering
The traditional view of software engineering shows us
how to come up with solutions for problems de novo
But starting from scratch every time is infeasible
This will involve re-inventing many wheels
4
Software Architecture: Foundations, Theory, and Practice
Examples of Domains
Compilers for programming languages
Consumer electronics
Electronic commerce system/Web stores
Video game
Business applications
Basic/Standard/“Pro”
Boeing Jets
Boeing 747-400
5
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Architecture-Based Software
Engineering
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Domain-Specific Software
Engineering
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Technology
10
Software Architecture: Foundations, Theory, and Practice
11
Software Architecture: Foundations, Theory, and Practice
Technology
13
Software Architecture: Foundations, Theory, and Practice
Technology
16
Software Architecture: Foundations, Theory, and Practice
Technology
17
Software Architecture: Foundations, Theory, and Practice
18
Software Architecture: Foundations, Theory, and Practice
Domain Model
Domain Model
20
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Domain Model
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Domain Model
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Domain Model
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Domain Model
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
26
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Defines entities
and cardinal
relationships
between them
27
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Defines attributes
and operations on
entities
Closely resembles
class diagram in
UML but may be
more abstract
28
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
30
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
31
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Focuses on
data flow
between
entities
with no
notion of
control
32
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Operational
Model:
Control Flow
Diagram
Focuses on
control flow between
entities separate from
data flow
33
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Focuses on states
of systems and
transitions between
them
Resembles UML
state diagrams
34
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Reference Requirements
Mandatory
Must display the current status of the Lunar Lander (horizontal and
vertical velocities, altitude, remaining fuel)
Must indicate points earned by player based on quality of landing
Optional
May display time elapsed
Variant
May have different levels of difficulty based on pilot experience
(novice, expert, etc)
May have different types of input depending on whether
Auto Navigation is enabled
Auto Throttle is enabled
May have to land on different celestial bodies
Moon
Mars
Jupiter’s moons
Asteroid
35
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Domain-Specific Software
Architecture
Definition: Definition. A domain-specific software
architecture (DSSA) comprises:
a reference architecture, which describes a general
computational framework for a significant domain of
applications;
a component library, which contains reusable chunks
of domain expertise; and
an application configuration method for selecting and
configuring components within the architecture to
meet particular application requirements.
(Hayes-Roth)
36
Software Architecture: Foundations, Theory, and Practice
Reference Architecture
37
Software Architecture: Foundations, Theory, and Practice
Structural view
of Lunar Lander
DSSA
Invariant with
explicit points
of variation
Satellite relay
Sensors
39
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Domain-Specific
Software Architecture
and Product Lines
Software Architecture
Lecture 24
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
What is domain-specific software engineering
(DSSE)
The “Three Lampposts” of DSSE: Domain,
Business, and Technology
Domain Specific Software Architectures
Product Lines
Relationship between DSSAs, Product Lines, and
Architectural Styles
Examples of DSSE at work
2
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
What is domain-specific software engineering
(DSSE)
The “Three Lampposts” of DSSE: Domain,
Business, and Technology
Domain Specific Software Architectures
Product Lines
Relationship between DSSAs, Product Lines, and
Architectural Styles
Examples of DSSE at work
3
Software Architecture: Foundations, Theory, and Practice
Product Lines
Engineering knowledge
Existing product architectures, styles, patterns
Pre-existing software components and connectors
4
Software Architecture: Foundations, Theory, and Practice
Traditional Software
Engineering
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Traditional Software
Engineering
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
A Product-Line Architecture
11
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Helps us
decide
UI Plug-ins Connector
Data Store Connector
whether
creating a
Demo Reminder
Text-based UI
System Clock
product line is
Graphical UI
Game Logic
Data Store
viable or
feasible
Lite X X X X X X
Demo X X X X X X X X X X
Pro X X X X X X
13
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
UI Plug-ins Connector
Data Store Connector
(mostly) orthogonal
features, or features
Demo Reminder
Text-based UI
System Clock
Graphical UI
that would be
Game Logic
Data Store
beneficial in different
products
Core
X X X X X
Elements
Text UI X
Graphical UI X
Time
X X X
Limited 14
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Core Elements
Time Limited
Graphical UI
knowledge to identify which
combinations form feasible
Text UI
or marketable products
that will be constructed
Lunar Lander Lite X X
Lunar Lander Demo X X X
Lunar Lander Pro X X
15
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Koala
xADL 2.0
These ADLs have explicit support for capturing
variation points
16
Software Architecture: Foundations, Theory, and Practice
17
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Selection
Product-line selection is the process of extracting a
single product architecture (or smaller product line) from
an architectural model that contains explicit points of
variation
ADLs such as Koala and xADL 2.0 can do selection
automatically with tools
18
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
19
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
20
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
21
Software Architecture: Foundations, Theory, and Practice
Implementation Issues
Important to partition implementations along variation-
point boundaries
Bad Good
22
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
23
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Families of Styles
26
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Objectives
Concepts
What is domain-specific software engineering
(DSSE)
The “Three Lampposts” of DSSE: Domain,
Business, and Technology
Domain Specific Software Architectures
Product Lines
Relationship between DSSAs, Product Lines, and
Architectural Styles
Examples of DSSE at work
27
Software Architecture: Foundations, Theory, and Practice
Koala
28
Software Architecture: Foundations, Theory, and Practice
29
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.
Software Architecture: Foundations, Theory, and Practice
34