You are on page 1of 21

Software Architecture

Architecture Styles
Software Architecture
„ Good software engineers make use of architectural
principles when designing complex software
„ First able to recognize and understand high
First, high--level
relationships among systems so that new systems can
be built as variations on old systems.
„ Second, getting the right architecture is often crucial to
the success of a software system design; the wrong one
can lead to disastrous results.
„ Third, detailed understanding of software architectures
allows the engineer to make principled choices among
g alternatives.
design
„ Fourth, an architectural system representation is often
essential to the analysis and description of the high level
properties of a complex system.
system
Programming Languages to
Software Architecture
„ High Level Programming Languages
„ Abstract Data Types
„ Iff you get the data structures right then
development be easier.
„ L d to
Leads t understanding
d t di off s/w / structures,
t t
specifications, language issues etc.
„ S ft
Software A
Architecture
hit t
Common Architectural Styles
y
„ Common Framework is required to understand
differences between styles
„ Framework: A specific system is a collection of
components (computational) together with a
description of the interactions between these
components (connectors).
„ It is like a Graph.
„ Nodes represent components
„ Arcs represent connectors (interaction)
„ St l Defines
Style: D fi a ffamily
il off such
h systems
t iin terms
t
of a pattern of structural organization.
„ Determines vocabulary and set of constraints.
Questions to understand a Style
Q y

„ What is the structural pattern


pattern——the components,
connectors, and constraints?
„ What is the underlying
y g computational
p model?
„ What are the essential invariants of the style?
„ What are some common examples of its use?
„ What are the advantages and disadvantages of
using
g that style?
y
„ What are some of the common specializations?
Pipes
p and Filters
„ Each component has a set of inputs and set of outputs.
„ Components are filters (independent entities)
„ Connectors are pipes
„ Examples: Compilers, Unix Shell Programs
Advantages
g
„ First, they allow the designer to understand the overall
input/output behavior of a system as a simple
composition of the behaviors of the individual filters.
filters
„ Second, they support reuse: any two filters can be
hooked together, provided they agree on the data that is
being transmitted between them.
them
„ Third, systems can be easily maintained and enhanced:
new filters can be added to existing systems and old
filters can be replaced by improved ones.
„ Fourth, they permit certain kinds of specialized analysis,
such as throughput
g p and deadlock analysis.
y
„ Finally, they naturally support concurrent execution.
Each filter can be implemented as a separate task and
potentially executed in parallel with other filters
Disadvantages
g
„ First, pipe and filter systems often lead to
a batch organization
g of processing
p g
„ Not good at handling interactive operations
„ Second,, theyy mayy be hampered
p byy having
g
to maintain correspondences between two
separate, but related streams
„ Third, depending on the implementation,
they may force a lowest common
denominator on data transmission
„ Loss of performance, increased complexity
Data Abstraction & OO Organization
„ Data representation and operations are
encapsulated
p in object
j (components)
( p )
„ Objects interact through functions and
procedure calls.
p
Advantages
g
„ Because an object hides its representation
from its clients, it is possible to change the
implementation without affecting those
clients.
„ Additionally, the bundling of a set of
accessing routines with the data they
manipulate allows designers to decompose
problems into collections of interacting
agents.
Disadvantages
g
„ The most significant is that in order for
one object to interact with another (via
procedure call) it must know the identity
of that other object.
„ Further there can be side effect problems:
if A uses object B and C also uses BB, then
C's effects on B look like unexpected side
effects to A
A, and vice versa
versa.
Event Based, Implicit
p invocation
„ Explicit invocation
„ Implicit invocation
„ Also called as: Reactive integration, Selective
broadcast
„ Example: Editors and variable monitors
register with debugger’s
debugger s.
Advantages
g and Disadvantages
g
„ Advantages
„ Strong
g support
pp for reuse
„ Easy system evolution
„ Disadvantages
„ Relinquish control over the computation performed by
the system
„ No idea what other components respond to the event
„ Cannot rely on the order in which they are invoked.
„ Don’t know when the invocation is completed.
„ Exchange of data
Layered
y Systems
y
„ A layered system is organized
hierarchically
Advantages
g and Disadvantages
g
„ Advantages
„ First,, theyy support
pp design
g based on increasing
g
levels of abstraction.
„ Second, they support enhancement.
„ Third, they support reuse.

„ Disadvantages
„ Not all systems are easily structured in a
layered fashion
„ Difficult to define system-independent layers
Repositories
p
„ Two kinds of components:
„ a central data structure represents the current state,
„ and a collection of independent components operate
on the central data store.
„ Traditional database: Types of transactions in an
i
input
t stream
t off ttransaction
ti ttrigger
i selection
l ti off
processes to execute.
„ Blackboard: Current state of the database is the
main trigger of selecting the processes to
execute
„ Knowledge sources,
sources blackboard data structure,
structure
Control
„ Examples: Signal processing, such as speech and
pattern recognition
Table Driven Interpreters
p
„ A virtual machine is produced in s/w
„ Interpreter includes
„ Psuedo
Psuedo-
d -program being
b interpreted
d
„ Interpretation engine
„ Commonly used to build virtual machines.
Other Architectures
„ Distributed processes
„ For Multi Process Systems
„ Examples:
p Ring
g or Star Topologies
p g
„ Client Server
„ Main program/subroutine organizations
„ Mirrors programming language in which the system is written
„ Domain specific s/w architectures
„ Provide an organizational structure tailored to a family of
applications
„ E
Examples:
l avionics,
i i command
d and
d control,
t l or vehicle
hi l managementt
systems.
„ State Transition systems
„ Common organization for many reactive systems.
systems
„ Process control systems
„ Systems intended to provide dynamic control of a physical
environment
Heterogeneous
g Architectures
„ Most systems typically involve a combinations of
several styles
„ One way of combining architectural styles is
Hierarchy
„ Example: Unix pipeline
„ A second way for styles to be combined is to
permit a single component to use a mixture of
architectural connectors.
„ Example: Accessing data
„ A third way for styles to be combined is to
completely
l t l elaborate
l b t one level
l l off architectural
hit t l
description in a completely different architectural
style.
Case Studies
„ Key word in context
„ Main p
program/subroutine
g / with shared data
„ Abstract data types
„ Implicit
p Invocation
„ Pipes and filters
„ Instrumentation software
„ OO style
„ Layered
y style
y
„ Pipe and filter style
„ Modified pipe and filter style
Case Studies
„ Compiler
„ Traditional compiler model
„ Traditional compiler model with shared data
„ Modern canonical compiler

You might also like