Chapter 4 - Styles and Patterns in Architecture - Session II
Chapter 4 - Styles and Patterns in Architecture - Session II
SOFTWARE ARCHITECTURE
SESSION II: DATA-CENTERED, DATA-FLOW, AND DISTRIBUTED SYSTEMS
All copyright information must appear if these slides are posted on a website for student use.
Distributed Systems
Overview
Patterns
Client Server
What’s next…
Distributed systems – Broker Pattern
Interactive Systems
Hierarchical Systems
Data Manager
Data repository
Manages data
Because of the architecture of these systems, they must consider issues with:
Data integrity
Communication protocols between worker and data management
Transactions and recovery (also known as roll-back)
Security
Worker 1 Worker 2
1. Communication Protocol
2. Security
1. Communication Protocol
2. Security
Data Manager
The Blackboard architectural pattern resembles the approach a group of scientists would employ to
solve a complex problem.
Consider a group of scientists at one location using a blackboard (chalkboard, whiteboard, or electronic
blackboard) to solve a complex problem.
Assume that to manage the problem-solving process, a mediator controls access to the blackboard.
Once the mediator (or controller) assigns control to the blackboard, a scientist evaluates the current state of
the problem and if possible, advances its solution before releasing control of the blackboard.
With new knowledge obtained from the previous solution attempt, control is assigned to the next scientist
who can further improve the problems’ state.
This process continues until no more progress can be made, at which point the blackboard system reaches
a solution.
This behavior is prevalent in expert systems, therefore, the Blackboard architectural pattern is a
good choice for depicting the logical architecture of expert systems.
06/08/2020 Software Engineering Design: Theory and Practice 5
BLACKBOARD ARCHITECTURAL PATTERN
Agents cannot
access blackboard The actual blackboard. In this
until access is example, this is the data
granted by repository Controller
controller.
Agent 1
Agent 3 waits for his turn
Controller
Agents
Blackboard
Client requests a
schedule
Client receives an
optimized schedule
Worker components abstract data transformations and processing that need to take place before
forwarding data streams in the system, e.g.,
Encryption and decryption
Compression and decompression
Changing data format, e.g. ,from binary to XML, from raw data to information, etc.
Enhancing, modifying, storing, etc. of the data
Transport components abstract the management and control of the data transport mechanisms, which
could include:
Inter-process communication
Sockets, serial, pipes, etc.
Intra-process communication
Direct function call, etc.
Important:
Not a UML Diagram!
Lexical Analyzer Parser Code Generator Optimizer
Parser
Lexical analyzer
produces parse Generates code, e.g.,
produces tokens Optimizes code
trees machine language
Reused
component
It would be cool to build
an interpreter… I know,
let’s reuse the
components that we
already have!
In this example,
the Pipes are
simply function
calls!
Using the pipes and filters architecture, the logical structure of the system can be modeled as follows:
Important:
Consider what would
happen if a better algorithm
Transformed data containing only the for recognition is
Big video file!
information from detected faces! discovered?
Transformed data containing only the
results from the recognition process,
e.g., a report of identity!
Wanted!
Wanted!
This triggers
Youtube video file found!
and event!
Transport the file to the next
component via the file system.
Notify anyone
registered for
monitoring of
Do work using the data from
this directory
the file, save the results on the
file system so that the process
can repeat again with the
next component / filter.
Identity
determined!
IVideoPipe
Filter Component
Pipe Filter Component
Interface
When modeled this way, there are
implications about the internal
structure of these components!
For example, see below
<<component>>
VideoManager <<delegate>>
<<delegate>> <<component>>
TransportComponent
IVideoPipe IStreamPipe IStreamPipe
Pipe
<<component>>
WorkerComponent
Filter