Review — Software Architecture Goals Control inherent software complexity elevate abstraction levels

advertisement
1
Scope of Software Architectures
Review — Software Architecture Goals
■
Control inherent software complexity
❏
❏
elevate abstraction levels
match developers’ mental models
binary
bits
elementary
instructions
lines-of-code
or procedures
lines-of-code
or classes
mathematical
constructs
machine
language
assembly
language
procedural
programming
language
object-oriented
programming
language
(semi)formal
specification
language
■
developer’s
mental
model
Explicitly address a system’s conceptual underpinnings
❏
❏
❏
❏
❏
act on the blueprint instead of the system itself
address complexity
increase reuse and component marketplace potential
reduce development costs
shift development approach to a component-based
philosophy
CS 612: Software Architectures
Scope of Software Architectures
January 26, 1999
2
Review — Focus of Architectures
■
■
■
System structure
System-level properties
Key role in the software lifecycle
❏
❏
❏
❏
❏
❏
a framework for satisfying requirements
technical basis for design
managerial basis for cost estimation & process management
effective basis for reuse
basis for consistency and dependency analysis
basis for implementation
CS 612: Software Architectures
January 26, 1999
3
Scope of Software Architectures
Review — Definitions
■
Perry and Wolf
❏
■
Shaw and Garlan
❏
■
Software Architecture = { Elements, Form, Rationale }
Software architecture [is a level of design that] involves the
description of elements from which systems are built,
interactions among those elements, patterns that guide their
composition, and constraints on these patterns.
Canonical building blocks
❏
❏
❏
component — locus of computation and state
connector — element that models interactions among
components and rules that govern those interactions
configuration — connected graph of components and
connectors which describes architectural structure
CS 612: Software Architectures
January 26, 1999
4
Scope of Software Architectures
Review — Architectural Perspectives
Architectural
View
implementation
process
control flow
data flow
structural
graphical
structural
textual
...
requirements
CS 612: Software Architectures
high level
architecture
design
source
code
Level of
Abstraction
January 26, 1999
5
Scope of Software Architectures
Review — Architectural Domains
■
Classes of problems or areas of concern in architecture
Representation
Design Process Support
Analysis
Evolution
Refinement
Static
Dynamic
Specification-Time
Execution-Time
Traceability
Simulation/Executability
CS 612: Software Architectures
January 26, 1999
6
Scope of Software Architectures
Scope of Software Architectures
■
■
■
Every system has an architecture
Details of the architecture are a reflection of system
requirements and trade-offs that made to satisfy them
Possible decision factors
❏
❏
❏
❏
performance
compatibility with legacy software
planning for reuse
distribution profile
❏
❏
❏
current and future
safety, security, fault tolerance
evolvability
❏
changes to processing algorithms
❏
changes to data representation
❏
modifications to the structure/functionality
CS 612: Software Architectures
January 26, 1999
7
Scope of Software Architectures
Case Study: Key Word In Context
HELLO WORLD
I AM YODA
HELLO WORLD
WORLD HELLO
I AM YODA
AM YODA I
YODA I AM
AM YODA I
HELLO WORLD
I AM YODA
WORLD HELLO
YODA I AM
CS 612: Software Architectures
January 26, 1999
8
Scope of Software Architectures
KWIC Architecture: Shared Data
Master
Control
Input
Characters
Input
Medium
CS 612: Software Architectures
Circular
Shift
Alphabetizer
Index
Output
Alphabetized
Index
Output
Medium
January 26, 1999
9
Scope of Software Architectures
Shared Data Pros and Cons
+ Efficiency
→ shared data
→ efficient data representation
→ sequential data access
+ Intuitive structure
- Changeability
→ data format not abstracted away
→ functional elements dependent on data representation
- Support for reuse
CS 612: Software Architectures
January 26, 1999
10
Scope of Software Architectures
KWIC Architecture: ADT
Master
Control
Characters
Input
Medium
CS 612: Software Architectures
Circular Shift
i th
alph
word
char
setchar
setup
word
Output
char
setchar
Input
Alphabetic
Shifts
Output
Medium
January 26, 1999
11
Scope of Software Architectures
ADT Pros and Cons
+ Intuitive structure
+ Changeability
→ data format abstracted away inside ADTs
→ modification of the processing algorithm isolated to individual
modules
+ Support for reuse
-
→ fewer assumptions about the rest of the system
Expansion of functionality
→ sacrifice either conceptual simplicity or performance
CS 612: Software Architectures
January 26, 1999
12
Scope of Software Architectures
KWIC Architecture: Implicit Invocation
Master
Control
Input
Medium
CS 612: Software Architectures
Lines
Output
i th
delete
Alphabetizer
insert
i th
delete
Circular
Shift
insert
Input
Lines
Output
Medium
January 26, 1999
13
Scope of Software Architectures
Implicit Invocation Pros and Cons
+ Intuitive structure
+ Data format abstracted away and “activated”
+ Changeability
→ functional enhancements easy
→ computation separate from data representation
+ Support for reuse
→ modules rely on events, not other modules
- Processing order
- Efficiency
→ data-driven solution leads to a bigger footprint
CS 612: Software Architectures
January 26, 1999
14
Scope of Software Architectures
KWIC Architecture: Pipe and Filter
Input
Medium
Input
Alphabetizer
CS 612: Software Architectures
Circular
Shift
Output
Output
Medium
January 26, 1999
15
Scope of Software Architectures
Pipe&Filter Pros and Cons
+ Intuitive structure and processing flow
+ Support for reuse
→ filters operate in isolation
→ expect only data of particular format
+ Changeability
→ easy addition of new filters
- Impossible to evolve into an interactive system
- Efficiency
→ each filter copies all data to its output ports
CS 612: Software Architectures
January 26, 1999
16
Scope of Software Architectures
Instrumentation Software
■
■
Oscilloscopes are instrumentation devices that
→ transform electrical signals into visual images
→ perform measurements on signals
→ support multiple user displays
Oscilloscopes are complex
❏
❏
❏
❏
■
perform many measurements
require a lot of storage
interface with other instruments and computer networks
provide a sophisticated UI
Goal: develop a reusable system architecture for
oscilloscopes
❏
❏
❏
develop a common “core” architecture
grow a product line around that core
allow expansion into other domains
CS 612: Software Architectures
January 26, 1999
17
Scope of Software Architectures
Oscilloscope Architecture — OO
Oscilloscope
Object
Waveform
Object
Max-min
Waveform
-
Signal
Object
X-Y
Waveform
...
...
No overall model of how the data types fit together
Problem of partitioning the functionality
CS 612: Software Architectures
January 26, 1999
18
Scope of Software Architectures
Oscilloscope Architecture — Layered
Core
Acquisition
Manipulation
Visualization
UI
+ Intuitively appealing
- Wrong for the application domain
❏
actual oscilloscope functions cross layers
CS 612: Software Architectures
January 26, 1999
19
Scope of Software Architectures
Oscilloscope Architecture — Pipe&Filter
Couple
Signal
Times
Acquire
To-XY
Clip
Trace
Waveform
Trigger
Subsystem
Measure
Measurement
+ Functions not isolated into separate partitions
+ Data flow nature of signal processing is reflected
+ Allows combination and substitution of software and
-
hardware components
Does not enable the user to interact with the system
CS 612: Software Architectures
January 26, 1999
20
Scope of Software Architectures
Oscilloscope Architecture — Modified Pipe&Filter
■
Solution: add control interfaces to filters
Signal
Couple
Times
Trigger
Subsystem
Acquire
To-XY
Clip
Trace
Waveform
Measure
Measurement
+ Explicates modifiable parts of a filter
+ Decouples signal processing functions from the UI
- Poor performance
each filter copies data
❏
slow filters present bottlenecks
→ alleviated by flexible pipes (connectors)
❏
CS 612: Software Architectures
January 26, 1999
21
Scope of Software Architectures
Mobile Robotics
■
■
Manned or partially manned vehicles
Uses
❏
❏
❏
■
space exploration
hazardous waste disposal
underwater exploration
Issues
→ interface with external sensors and actuators
→ real-time response to stimuli
→ response to obstacles
→ sensor input fidelity
→ power failures
→ mechanical limitations
→ unpredictable events
CS 612: Software Architectures
January 26, 1999
22
Scope of Software Architectures
Basic Mobile Robot Architectural Requirements
■
■
■
Accommodate goal accomplishment in the face of
obstacles
Allow for uncertainty resulting from incomplete or
unreliable information
Handle dangers introduced by the environment
❏
❏
❏
■
fault tolerance
safety
performance
Exhibit flexibility
❏
❏
❏
experimentation
reconfiguration
regular modification
CS 612: Software Architectures
January 26, 1999
23
Scope of Software Architectures
Mobile Robot Architecture — Control Loop
Controller
Actuators
Sensors
Environment
- Obstacles
- Uncertainty
+ Dangers
+ Flexibility
CS 612: Software Architectures
January 26, 1999
24
Scope of Software Architectures
Mobile Robot Architecture — Layered
8
7
Supervisor
Global Planning
6
5
Control
- Obstacles
+ Uncertainty
+ Dangers
- Flexibility
Navigation
4 Real-World Modeling
3
2
Sensor Integration
Sensor Interpretation
1
Robot Control
Environment
CS 612: Software Architectures
January 26, 1999
25
Scope of Software Architectures
Mobile Robot Architecture — Implicit Invocation
Task
Task
E
M
Message
Server
WT
DM
Task
■
Task
+ Obstacles
- Uncertainty
+ Dangers
+ Flexibility
Task
Task trees — hierarchies of tasks
tasks temporally interdependent
→ allows specification of selective concurrency
❏
■
Tasks communicate by multicasting messages
❏
a server directs messages to registered tasks
CS 612: Software Architectures
January 26, 1999
26
Scope of Software Architectures
Mobile Robot Architecture — Blackboard
Environment
Monitor
Motor
Controller
Overall
Supervisor
High Level
Path Planner
BLACKBOARD
Raw Input Interpreters
Obstacles
■
Uncertainty
■
Dangers
+ Flexibility
■
CS 612: Software Architectures
January 26, 1999
Scope of Software Architectures
27
Compiler Architecture Revisited
Lexer
Parser
Semantor
Optimizer
Code
Generator
CS 612: Software Architectures
January 26, 1999
Download