architectural styles 2
TRANSCRIPT
ARCHITECTURAL STYLES - 2
An architectural style defines a family of Systems in terms of a pattern of structural Organization. It determines:
– The vocabulary of components and connectors– A set of constraints on how they can be combined.
Dr Reeja S RProfessorCSE DeptSJEC Vamanjoor, Mangalore
ARCHITECTURAL STYLES - 2
Layered systemsRepositoriesinterpreters
Layered Systems
Layered Systems
Components – layers Connectors – procedure calls
Each layer acts as a Server: service provider to layer “above” Client: service consumer of the layer “below”
Examples
Networking protocolsOperating System
Layered pattern - variant
Closed architecture Open architecture
Advantages
Support design based on increasing levels of
abstraction – thereby partitioning a complex problem into a sequence of incremental steps
Supports enhancement since changes to one layer affects at the most 2 adjacent layer
Supports reuse - since different implementations (with identical interfaces) of the same layer can be used interchangeably
Disadvantages
All systems cannot be structured in a layered fashion
It is quite difficult to get the right level of
abstraction.
The system may suffer lower performance
REPOSITORIES
Repositories
Repositories Architectural Style
Components A central data structure representing the current
state of the system. A collection of independent components that operate
on the central data structure.
Connectors Procedure calls or direct memory accesses.
Variants
1. Type of transactions in an input stream trigger selection of process to execute
2. Current state of the central data structure is the main trigger for selecting processes to execute.
Ex: Blackboard
BlackboardTypically used for AI systems and in applications requiring
complex interpretations of signal processing, such as speech and pattern recognition.
Distance
Object Location
…
Visual Process
or
Motion Syste
m
Voice Synthesi
zer
Blackboard
Object Location
…
o1 L1o2 L2
Distance
Object Location
…
o1 L1o2 L2
10
Visual Process
or
Motion Syste
m
Voice Synthesi
zer
Blackboard
If(dist >=3)
Distance
Object Location
…
o1 L1o2 L2
8
Visual Process
or
Motion Syste
m
Voice Synthesi
zer
Blackboard
If(dist >=3)
Distance
Object Location
…
o1 L1o2 L2
6
Visual Process
or
Motion Syste
m
Voice Synthesi
zer
Blackboard
If(dist >=3)
Distance
Object Location
…
o1 L1o2 L2
4
Visual Process
or
Motion Syste
m
Voice Synthesi
zer
Blackboard
If(dist >=3)
Distance
Object Location
…
o1 L1o2 L2
2
Visual Process
or
Motion Syste
m
Voice Synthesi
zer
Blackboard
If(dist < 3)
Repositories Advantages
Efficient way to store large amounts of data. Centralized management for backup, security and
concurrency control
Disadvantages Must agree on a data model a priori. Data evolution is expensive
INTERPRETERSSuitable for applications in which the most appropriate language or machine for executing the solution is not directly available
Interpreter
An interpreter takes a program written in one language and interprets it to another language
Interpreter
Interpreter
An interpreter has 4 Components: “Program” being executed and its data Interpretation engine and its state
Connectors procedure calls and shared state.
Interpreter Examples
Programming Language Compilers: Java, Smalltalk
Rule Based Systems: Prolog, Coral Scripting Languages: Awk, Perl