๐Ÿ  Home

Week 5

Data Centered Architecture

Chapter 6

Instructor: Baber Sheikh (Visiting Faculty)

Agenda

  • 6. Introduction to Data Centered Architecture
  • 6.1 Building blocks of data centered architecture
  • 6.2 Repository architectural style
  • 6.2.1 Overview
  • 6.2.2 Benefits & limitations
  • 6.2.3 Applicable domains
  • 6.3 Blackboard architectural style
  • 6.3.1 Overview
  • 6.3.2 Benefits & limitations
  • 6.3.3 Applicable domains

๐Ÿ”„ Week 4 Recap: What is Data Flow Architecture?

Core Idea

Data Flow Architecture views the entire software system as a series of transformations on successive sets of data.

Data moves from one component to the next โ†’ each component transforms the data โ†’ passes it forward.

๐Ÿ• Easy Example: Pizza Assembly Line

Think of a pizza shop where each station does one job:

Dough Station โ†’ makes the base โ†’ Sauce Station โ†’ adds sauce โ†’ Topping Station โ†’ adds toppings โ†’ Oven โ†’ bakes it โ†’ Boxing โ†’ ready!

Each station doesn't care WHO is before or after it. It just takes input, transforms it, and passes output. That's Data Flow Architecture!

๐Ÿ”‘ Independence

Components don't know each other โ€” only input/output matters.

โš™๏ธ 3 Subcategories

1. Batch Sequential
2. Pipe & Filter
3. Process Control

๐Ÿ“‚ Best For

Compilers, data processing, multimedia streaming, embedded systems.

๐Ÿ”„ Week 4 Recap: Batch Sequential & Pipe and Filter

๐Ÿ“ฆ Batch Sequential

Traditional step-by-step processing (1950sโ€“1970s). Each subsystem must complete fully before the next one starts.

Flow: Validate โ†’ Sort โ†’ Update โ†’ Report

๐Ÿฆ Easy Example

Bank processes month-end salaries:

Step 1: Collect ALL salary requests โ†’ Step 2: Validate ALL โ†’ Step 3: Process ALL โ†’ Step 4: Generate report.

โš ๏ธ Step 2 can't start until Step 1 finishes everything.

๐Ÿ”ง Pipe & Filter

Components (Filters) process data simultaneously. Connected by Pipes (FIFO buffers). Incremental โ€” no waiting for full batch.

Unix: who | sort | wc -l

๐Ÿš— Easy Example: Car Wash

Station 1: Soap โ†’ Station 2: Rinse โ†’ Station 3: Dry

Car A is being rinsed while Car B enters soap station โ€” they work at the same time!

โœ… Unlike Batch: doesn't wait for ALL cars to finish soap first.

Key Difference: Batch Sequential = "Finish everything, then move." | Pipe & Filter = "Start passing immediately, everyone works together."

๐Ÿ”„ Week 4 Recap: Process Control Architecture

Closed-Loop Feedback System

Maintains a variable (Temperature, Speed, Altitude) at a specific level by continuously measuring and adjusting.

โ„๏ธ Easy Example: AC in Your Room

You set: 22ยฐC (Set Point)

Sensor reads: 28ยฐC (Input Variable)

Controller calculates: Error = 28 - 22 = 6ยฐC too hot!

Executor: Turns compressor ON full blast

Once temp reaches 22ยฐC โ†’ compressor slows down. Goes below 22ยฐC โ†’ it stops. This loop runs forever.

๐Ÿ“Š The 4 Variables

  • Controlled Variable: What we maintain (Temperature)
  • Set Point: The goal value (22ยฐC)
  • Input Variable: Sensor reading (28ยฐC)
  • Manipulated Variable: What we adjust (Fan speed)

๐Ÿง  Two Main Units

Controller (The Brain):

Calculates: Error = Set Point โˆ’ Current Value

Decides how much to adjust.

Executor (The Muscle):

Physically changes the system (Engine, Heater, Motor, Compressor).

๐Ÿ“‹ Week 4 Crux: Data Flow Comparison Table

Feature Batch Sequential Pipe & Filter Process Control
How Data Moves Whole batch at once Continuous stream (incremental) Variable updates via feedback loop
Concurrency โŒ None โ€” Step A finishes, then B starts โœ… High โ€” All filters work simultaneously โšก Real-time continuous loop
Control Explicit (Script drives order) Implicit (Data drives flow) Loop (Sensors drive actions)
Latency ๐Ÿข High (wait for full batch) ๐Ÿ‡ Low (start immediately) โšก Near-zero (real-time)
Interactive? โŒ No user interaction โŒ No user interaction โœ… Yes (user sets target)
Easy Example ๐Ÿฆ Bank: Process ALL salaries โ†’ then report ๐Ÿš— Car Wash: Soap โ†’ Rinse โ†’ Dry (all at once) โ„๏ธ AC: Measure temp โ†’ adjust cooling โ†’ repeat
Best For Tape/File processing, Billing Compilers, Multimedia, Unix CLI Embedded systems, IoT, Robotics
๐ŸŽ“ One-Liner "Finish everything, then move." "Everyone works at the same time." "Measure, adjust, repeat forever."

๐ŸŽ“ Crux: Choose Batch for simplicity, Pipes for speed, and Control for physical feedback systems.

6. What is Data-Centered Architecture?

The Big Idea

One central data store sits in the middle. All software components (called agents) connect to it. Agents never talk to each other directly โ€” everything goes through the data store.

๐Ÿ“ฑ Easy Example: WhatsApp Group

Imagine your class WhatsApp group:

  • Group Chat = Data Store (center)
  • Members = Agents (around it)
  • Nobody DMs each other for class notes โ€” everyone posts & reads from the group

โœ… That's Data-Centered Architecture! One shared place, everyone accesses it.

WhatsApp Group = Data-Centered Architecture

6.1 Two Building Blocks

The system has only 2 major parts:

๐Ÿ—„๏ธ

1. Data Store

The central hub โ€” stores all shared data. Provides: Insert, Delete, Update, and Retrieve operations.

Think: Database / Shared Folder / Cloud Drive

โš™๏ธ

2. Independent Agents

Software components that work independently. Each reads/writes data to the store without knowing about other agents.

Think: Apps / Modules / Services

Data-Centered Architecture - Central Data Store with Agents

6.1 How Communication Works

๐Ÿšซ Agents DON'T Talk Directly

In pure data-centered architecture, Component A never calls Component B. All communication passes through the shared data store.

๐Ÿ“ Easy Example: Google Drive

You upload a presentation to Google Drive.

Your friend opens Drive, sees the file, edits it.

Another friend opens Drive, sees updates, adds comments.

Nobody emailed the file โ†’ everyone went to the shared drive (data store). That's data-centered!

๐Ÿ”— Two Types of Connections

1. Data Link (Solid Lines โ”€)

Bidirectional โ€” agents get data from the store and put data into the store.

2. Control Link (Dashed Lines - -)

Bidirectional โ€” either the data store controls agents OR agents control the data store.

๐Ÿ’ก Key Insight

Who controls whom? That's what separates Repository from Blackboard!

6.1 The Two Categories

Data-centered has 2 sub-types, separated by one question: "Who is the boss?"

๐Ÿ—‚๏ธ Repository

Data Store = Passive (Lazy) ๐Ÿ˜ด

Agents = Active (Hardworking) ๐Ÿ’ช

The agents decide when to read/write data. The data store just sits there waiting.

๐Ÿช Like a Library: Books (data) sit quietly on shelves. You walk in, pick a book, return it. The library doesn't chase you!

๐Ÿ“‹ Blackboard

Data Store = Active (Boss) ๐Ÿซก

Agents = Passive (Waiting) โณ

The data store triggers events. When data changes, it notifies agents to wake up & act.

๐Ÿ“ข Like a Classroom: Teacher writes on the blackboard โ†’ students react to what they see. The board drives the action!

Repository (Passive) vs Blackboard (Active)

6.1 Repository Architecture

๐Ÿ—‚๏ธ How It Works

Agents (clients) actively request data from a passive data store. They can access it interactively (real-time queries) or via batch transactions (bulk operations). The data store never initiates contact.

๐Ÿ’ป Easy Example: VS Code (Your IDE)

Your project folder = Data Store (passive, just sits there with files)

  • Code Editor โ†’ reads files to show code
  • IntelliSense โ†’ reads files to suggest autocomplete
  • Debugger โ†’ reads files to set breakpoints
  • Git Extension โ†’ reads files to show changes

The folder (data store) never says "Hey! Read me!" โ€” the tools (agents) pull from it when they need to.

๐Ÿ—ƒ๏ธ DBMS

MySQL, PostgreSQL โ€” Clients query, DB returns data.

๐Ÿ› ๏ธ CASE Tools

Rational Rose, Visual Paradigm โ€” Tools share project models.

๐Ÿ”ง Compilers

Lexer, Parser, Code Gen โ€” all share the symbol table.

6.1 Blackboard Architecture

๐Ÿ“‹ How It Works

The data store is active โ€” it triggers events when data changes. Agents (called Knowledge Sources / Subscribers) are passive โ€” they wait for notifications, then react. This chain continues until a goal is reached.

๐Ÿ“ท Easy Example: Instagram Notifications

You post a photo on Instagram:

  • Instagram Server (Data Store) detects: "New photo uploaded!"
  • โ†’ Notification Agent wakes up: sends push notification to followers
  • โ†’ Feed Agent wakes up: adds photo to followers' feeds
  • โ†’ AI Agent wakes up: scans photo for content moderation
  • โ†’ Analytics Agent wakes up: starts counting views & likes

The server (data store) pushed the event, and agents reacted. Nobody asked โ€” the data triggered everything!

๐Ÿค– AI Systems

Knowledge-based expert systems โ€” data triggers reasoning.

๐ŸŽค Voice Recognition

Siri/Google โ€” audio data triggers processing agents.

๐Ÿ”’ Security Systems

Intrusion detected โ†’ agents respond in chain.

6.2 Repository Architecture Style

What Makes Repository Special?

Repository is a data-centered architecture that supports user interaction for data processing. The agents (clients) control computation and flow of logic โ€” NOT the data store. The data store is passive.

๐ŸŽฌ Easy Example: Netflix

Netflix Database = Repository (passive, stores all movies/shows)

  • Mobile App โ†’ queries DB to show you movies
  • Smart TV App โ†’ queries DB to play content
  • Recommendation Engine โ†’ queries DB to suggest shows
  • Admin Dashboard โ†’ queries DB to manage content

The database never says "Hey, watch this!" โ€” apps pull data when they need it. That's Repository!

Repository Architecture

Figure 6.1: Repository Architecture

๐Ÿ“Œ Key Properties

  • Data Store: Passive โ€” just stores data
  • Agents: Active โ€” they control logic flow
  • Access: Interactive query or Batch connection
  • Interfaces: Different clients can have different interfaces & privileges

๐Ÿ“ฑ Google Docs Example

Multiple people typing in the same document.

User A types "Hello" โ†’ Docs Engine saves to DB โ†’ User B sees "Hello".

Repository Control Flow

Figure 6.2: Control Flow (Agents control the Data Store)

6.2 Repository Example: Student Management

A simple class diagram showing how Repository Architecture works in code

๐Ÿ“ฆ Three Parts Working Together

1. Student Class (Data Bean)

Holds one student's data: SSN + Name. Has getters & setters.

2. Students Collection

An ArrayList/Vector holding many Student objects. add(), remove(), next(), first().

3. Students Table (Database)

Physical DB table with rows: (SSN, Name). Connected via JDBC.

๐Ÿ“ฑ Easy Analogy: Contacts App

Think of your phone contacts:

  • One Contact = Student object (has name, number)
  • Contact List = Students collection (ArrayList)
  • Cloud Backup = Database table (Google/iCloud sync)

When you add a new contact โ†’ it goes into your list โ†’ AND saves to the cloud database. That's exactly what this class diagram shows!

Student Class Diagram

Figure 6.3: Student Management Class Diagram

Dynamic View

Figure 6.4: Dynamic View of Client Interaction

6.2 Java Code: Student Data Bean

The Student class โ€” one object = one row in the database table

public class Student implements Serializable {
    String SSN;
    String Name;

    // Default Constructor
    public Student() {
        SSN = "";
        Name = "";
    }

    public Student(String ssn, String name) {
        SSN = ssn;
        Name = name;
    }

    // Getters & Setters
    public void setSSN(String ssn) { SSN = ssn; }
    public String getSSN() { return SSN; }
    public void setName(String name) { Name = name; }
    public String getName() { return Name; }
}

๐Ÿง What's Happening?

  • Serializable โ†’ Object can be saved/sent over network
  • Two attributes: SSN + Name (matches DB columns)
  • Default Constructor: Empty student
  • Custom Constructor: Student with values
  • Getters/Setters: Read & write each field

๐Ÿ” Easy Analogy

Student class = Order Form at a restaurant

It has fields (dish name, quantity) and methods (fill in, read back). One form = one order = one DB row.

6.2 Java Code: JDBC Database Access

How agents (clients) connect to the Repository (database)

Step 1: Connect to Database

try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection =
        DriverManager.getConnection(
            "jdbc:odbc:students");
} catch(Exception e) { ... }

Step 2: Read All Students

ArrayList studentList = new ArrayList();
Statement stmt = connection.createStatement();
ResultSet results =
    stmt.executeQuery("SELECT * FROM students");
Student student = new Student();
while (results.next()) {
    student.setSsn(results.getString(1));
    student.setName(results.getString(2));
    studentList.add(student);
}

๐Ÿ” Step-by-Step Breakdown

1. Load Driver

JDBC driver = the "bridge" between Java and the DB

2. Get Connection

Open a "road" to the students database

3. Execute SQL

SELECT * = "Give me everything from students table"

4. Loop & Fill

Read each row โ†’ create Student object โ†’ add to list

Repository Pattern: Client (this code) actively pulls data from the passive DB. The DB never pushes data to the client!

6.2 Dynamic View: Multiple Clients Sharing Data

One Data Store, Many Clients

Multiple clients can Read (R) and Write (W) the same data object. Each client may use a different interface: CLI, GUI, API, RPC, or RMI.

๐Ÿ“ฑ Easy Example: Google Docs

One Google Doc = shared data object

  • Client 1 (Laptop): Opens doc, edits text (Write)
  • Client 2 (Phone): Opens same doc, reads it (Read)
  • Client 3 (Tablet): Adds comments (Write)

All 3 clients access the same document stored in Google's repository. They Read & Write independently!

๐Ÿ–ฅ๏ธ Different Access Interfaces

Interface Example
CLI MySQL Terminal
GUI phpMyAdmin, DBeaver
Program API JDBC, REST API
RPC / RMI Remote method calls

6.2 Domain 1: Database Systems (DBMS)

The relational DBMS is the most common repository architecture. The data store maintains schema (metadata), data tables, and index files. Many tools can access it.

๐Ÿซ Easy Example: University Portal

Oracle Database = Repository (stores everything)

  • ๐ŸŽ“ Student Portal โ†’ queries grades, courses
  • ๐Ÿ‘จโ€๐Ÿซ Faculty Portal โ†’ uploads marks, attendance
  • ๐Ÿข Admin Panel โ†’ manages admissions, fees
  • ๐Ÿ“Š Analytics Tool โ†’ generates reports
  • ๐Ÿ’ฐ Finance Module โ†’ handles billing

All these tools (agents) pull/push data to the same central database!

๐Ÿ—„๏ธ What's Inside the Repository?

Schema (Metadata)

Table definitions, column types, constraints

Data Tables

Actual rows of data (students, courses, grades)

Index Files

Speed up searches (like a book's index)

DBMS Architecture

Figure 6.5: Database Management System

6.2 Domain 2: CASE Tools

Computer Aided Software Engineering (CASE) systems are a perfect repository example. Multiple tools share one centralized data store containing design blueprints, code, and documentation.

๐Ÿ› ๏ธ How CASE Tools Work

  • ๐Ÿ“ UML Editor โ†’ draws class/sequence diagrams
  • ๐Ÿ’ป Code Generator โ†’ converts UML โ†’ Java/C++ code
  • ๐Ÿ”„ Reverse Engineering โ†’ converts code โ†’ UML diagrams
  • ๐Ÿ“ Documentation Tool โ†’ generates docs from models
  • ๐Ÿ”€ Format Converter โ†’ Booch โ†” Rumbaugh โ†” Jacobson

๐Ÿ’ก Biggest Advantage: One centralized data set โ†’ many tools โ†’ different products for different purposes!

CASE Tools

Figure 6.6: CASE Tools & Repository (Code, Designs, Docs)

6.2 Domain 3: Compiler System

Every compiler has a shared data repository (symbol table, syntax tree, constant table) accessed by all compilation phases. Data flows through phases but is stored centrally.

โš™๏ธ Compilation Phases as Agents

1. Scanner (Lexical Analyzer)

Reads source code โ†’ breaks into tokens โ†’ fills symbol table

2. Parser (Syntax Analyzer)

Reads symbol table โ†’ builds syntax/parse tree

3. Semantics Analyzer

Checks type correctness on the syntax tree

4. Code Generator

Reads syntax tree โ†’ produces target binary code

๐Ÿณ Easy Analogy: Restaurant Kitchen

Your Java code = customer order

  • Scanner = Waiter writes order on the shared board
  • Parser = Chef reads board, organizes recipe steps
  • Semantics = Quality check: "Does this recipe make sense?"
  • Code Gen = Cook prepares the final dish (binary code)

Everyone reads/writes on the same shared board (repository). Nobody passes notes directly!

๐Ÿ“ Example from Book

Input: int x, y; x = y + 1;
Scanner tokenizes โ†’ Parser builds tree โ†’ Code Gen outputs: mov ax, [y]; add ax, 1; mov [x], ax

6.2 Repository Variants

Two important variations of the standard repository

๐ŸชŸ Virtual Repository

Built on top of multiple physical repositories. Uses database views to create virtual tables.

Benefits:

  • Simplifies complex DB structure
  • Security management (limit who sees what)
  • Different views for different users

๐Ÿ“ฑ Example: University DB โ†’ Students see "My Grades" view, Faculty sees "All Students" view, Admin sees everything. Same data, different views!

๐ŸŒ Distributed Repository

Data spread across multiple sites linked by network. Data is replicated for reliability.

Challenges:

  • Data partitioning (vertical/horizontal)
  • Synchronization of duplicated data
  • Network transmission cost
  • Two-phase commit for transactions

๐Ÿฆ Example: Bank with branches in Karachi, Lahore, Islamabad โ€” each branch has local DB, all synced together!

Virtual vs Distributed Repository

6.2 Repository: Benefits & Limitations

โœ… Benefits

๐Ÿ”’ Data Integrity

Easy to backup & restore โ€” all data in one place

๐Ÿ“ˆ Scalability

Easy to add new agents โ€” they don't communicate with each other

โšก Less Overhead

No transient data passing between components directly

โŒ Limitations

๐Ÿ’ฅ Single Point of Failure

If the centralized DB goes down โ†’ everything stops

๐Ÿ”— High Dependency

Data structure changes โ†’ all agents must be updated!

๐Ÿ’ธ Network Cost

If distributed โ†’ moving data across network is expensive

๐ŸŽฏ Best For

Large, complex info systems where many agents need data access. Requires data transactions to drive control flow.

๐Ÿ”— Related Architectures

Layered, Multi-tier, and MVC architectures often incorporate repository patterns inside them.

6.3 Blackboard Architecture Style

Solving Non-Deterministic Problems

Blackboard systems are designed for problems where there is no single correct algorithm to find the answer (e.g., Speech Recognition, AI). Instead, many experts collaborate to build a partial solution.

๐Ÿซ Easy Analogy: The Classroom

Imagine a difficult math problem on a Blackboard.

  • Teacher & Students = Knowledge Sources (Agents)
  • Blackboard = Shared Data Store

1. Teacher writes the problem.
2. Student A writes a partial formula.
3. Student B sees it, gets an idea, and adds a calculation.
4. Student C sees that, and solves the final step.

They worked independently and opportunistically (when they saw something they understood).

๐Ÿ“œ Origins & History

  • Origin: 1970s for Speech Recognition
  • First System: Hearsay-II (Speech to Text)
  • Other Examples:
    • CRYSTALIS (Molecular structure)
    • HASP (Sonar signal interpretation)

Key Concept: The solution is built incrementally. No single agent knows how to solve the whole problem!

6.3 The Three Major Partitions

The specialized components that make Blackboard work

1. The Blackboard

๐Ÿ—„๏ธ

Data Store

  • Stores facts and hypotheses.
  • Central repository for all partial solutions.
  • Hierarchy: Data often organized in levels (e.g., Signal โ†’ Phonics โ†’ Word โ†’ Sentence).

2. Knowledge Sources

๐Ÿง 

Specialist Agents

  • Domain-specific experts (e.g., "Verb Finder", "Noun Finder").
  • Independent: They don't talk to each other.
  • Condition-Action: "If I see X on the board, I will do Y."

3. The Controller

๐Ÿ‘ฎ

Supervisor

  • Bootstraps the system.
  • Monitors changes on the blackboard.
  • Decides who goes next if multiple agents want to work.

The Blackboard is Passive (mostly) โ€” The Agents are Active but triggered by data changes.

6.3 Conceptual Diagram (Fig 6.8)

Solid Lines = Data Flow (Read/Write)
Dashed Lines = Control Flow (Triggering)

Blackboard Architecture Conceptual Diagram

Figure 6.8: Blackboard Architecture Block Diagram

6.3 Connections & Interactions

How do agents know when to work? They don't talk to each other. They use Implicit Invocation via the Blackboard.

๐Ÿ“ข Publish / Subscribe Mode

The mechanism for collaboration:

  1. Register: Knowledge Sources (KS) subscribe to events.
  2. Event: Data changes on the BB.
  3. Notify: BB triggers the KS via event listener.
  4. Action: KS processes and updates.
Publish Subscribe

Figure 6.11: Publish/Subscribe Relationship

6.3 Example: Knowledge-Based System

Using Forward Reasoning to identify an animal

๐Ÿ“œ Rules (Knowledge Source)

  • R1: IF gives milk THEN is Mammal
  • R2: IF eats meat THEN is Carnivore
  • R3: IF Mammal AND Carnivore AND Tawny AND Stripes THEN is TIGER

๐Ÿงฉ Facts (Blackboard)

  • F1: eats meat
  • F2: gives milk
  • F3: black stripes
  • F4: tawny color

โฉ Forward Reasoning Steps

1. Scan: F1 "eats meat" matches R2.

โ†’ Add "Carnivore" to Blackboard.

2. Scan: F2 "gives milk" matches R1.

โ†’ Add "Mammal" to Blackboard.

3. Scan: Now we have Mammal + Carnivore + F3 + F4.

โ†’ Matches R3.

๐Ÿฏ Conclusion: It's a TIGER!

6.3 Class Diagram (Fig 6.9 Pattern)

The structural view showing the 1-to-many relationship between Blackboard and Knowledge Sources.

Blackboard Class Diagram

Figure 6.9: Blackboard Class Diagram

6.3 Dynamic Interaction (Sequence)

The lifecycle of a Blackboard system: Initiate โ†’ Loop (Inspect โ†’ Match โ†’ Update) โ†’ Terminate.

๐Ÿ”„ The Execution Loop

1. Initiation: Controller starts BB and KS.

2. Event Trigger: Initial data placed on BB.

3. Match: KS inspects BB.

4. Execute: KS runs its logic.

5. Update: KS writes new result to BB.

6. Repeat until solution found.

Sequence Diagram

Figure 6.10: Sequence Diagram

6.3 Application: Smart Travel System

Figure 6.12 illustrates a blackboard for travel planning

๐Ÿš— Car Agent
๐ŸŽก Fun Agent
Travel Agent Blackboard Architecture

Figure 6.12: Smart Travel Agent Problem

๐Ÿค How they Collaborate

1. Controller posts request to Blackboard.

2. Air Agent sees "Paris" โ†’ searches flights โ†’ writes "Flight $800".

3. Budget updates on Blackboard: "$2200 remaining".

4. Hotel Agent sees "$2200 left" + "Paris" โ†’ searches hotels โ†’ writes "Hotel $1000".

5. Billing Agent waits for final "OK" to charge card.

Advantage: The Hotel Agent didn't need to ask the Air Agent directly. The Blackboard mediated the budget constraints automatically!

6.3 Applicable Domains

Where do we use Blackboard?

Best for Open-Ended, Complex, and Ill-Defined problems where no deterministic solution exists (you can't just write a simple "if/else" program).

๐ŸŽฏ Primary Use Cases

  • AI & Expert Systems: Medical diagnosis, fault recognition.
  • Speech Recognition: Decomposing sound waves into words (Hearsay-II).
  • Pattern Recognition: Image analysis, fingerprint matching, handwriting ID.
  • Security: Intrusion detection (correlating separate suspicious events).

๐Ÿšง Why here?

Because these problems involve Partial Knowledge.

Example: In speech, "I scream" and "Ice cream" sound the same. You need context (Sentence Expert) and Grammar (Syntax Expert) to act as separate agents to figure out the truth!

6.3 Blackboard: Benefits & Limitations

โœ… Benefits

๐Ÿงฉ Scalability

Easy to add new experts (KS) without changing others.

โšก Concurrency

Experts can work in parallel on different parts of the problem.

๐Ÿงช Experimentation

Supports multiple hypotheses (trying different paths).

โŒ Limitations

๐Ÿ•ธ๏ธ Structural Dependency

If Blackboard format changes, ALL agents break.

๐Ÿ Termination?

Hard to decide when to stop (Is the answer "good enough"?).

๐Ÿ› Difficult Debugging

With many agents firing randomly, it's hard to trace logic.

6.4 Repo vs Blackboard: Active vs Passive

Repository (Passive)

๐Ÿ—„๏ธ
  • The Data Store waits.
  • It does nothing until an Agent asks.
  • Analogy: A Library. Books don't jump off the shelf at you.

Blackboard (Active)

๐Ÿ””
  • The Data Store notifies.
  • It triggers agents when data changes.
  • Analogy: An Alarm Clock. It wakes you up!

6.4 Comparisons: Control Flow

Who is driving the bus? The User/Script or the Data?

Repository Flow

User โ†’ Logic โ†’ Data

The logic flow is determined by the Client Agents. The database is just a tool they use.

Blackboard Flow

Data Change โ†’ Logic โ†’ Data Change

The logic flow is determined by the Current State of Data. The Blackboard tells agents what to do.

6.4 Connection Mechanisms

Explicit vs Implicit Invocation

๐Ÿ”Œ Explicit (Repository)

// Agent explicitly calls DB
db.query("SELECT * FROM users");

The agent knows exactly what it wants and when it wants it.

๐Ÿ“ก Implicit (Blackboard)

// Agent subscribes to event
blackboard.on("NEW_DATA", runAnalysis);

The agent waits for a signal. It doesn't know when it will be called.

6.4 The Analogy Battle

๐Ÿ›’

Repository = Supermarket

You (Agent) walk in. The milk (Data) sits there. You grab it when you need it. The milk doesn't jump in your cart.

๐Ÿš‘

Blackboard = Emergency Room

Patient (Data) status changes (Heart rate drops!). Monitor beeps (Event). Doctor (Expert Agent) rushes in immediately.

6.4 Why Expert Systems?

Blackboard is the "Brain" architecture.

Typical Domains

  • Pattern Recognition: Fingerprints, Faces.
  • Speech Recognition: "Hey Siri..."
  • Military: Sonar detection.

Why not Repository?

Because in these fields, we don't know the query!

We don't say "SELECT * FROM sounds WHERE word='hello'".

We say "Here is a sound wave. Does anyone recognize it?"

Summary: Data-Centered Architectures

Data centered repository architecture may be one of the most popular software architectures since most software applications require a data repository. Repositories are often used in layered architecture, client-server architecture, data tier in multi-tier architecture, and many other designs.

Agents of the data store in repository architecture control the logic flow. The data store is passive, and agents trigger operations.

Blackboard architecture is a knowledge-based architecture where the status of the data controls and triggers operations. The data store is active. The connection is implicit (instead of explicit invocation).

Common in: Pattern recognition, speech recognition, and expert systems.

6.5 Self-Review Questions (1-5)

1. Which is NOT a benefit of repository architecture?
a. Independent agents    b. Reusable agents    c. Concurrency    d. Loose coupling


2. Which is a typical domain of blackboard architecture?
a. AI system    b. Business Info System    c. Compilers    d. Virtual machine


3. The Yellow Page of web service is an example of repository design.
a. True    b. False


4. Implicit notification is often used in blackboard architecture.
a. True    b. False


5. Repository architecture design must also be object-oriented design.
a. True    b. False

6.5 Self-Review Questions (6-10)

6. Agents in repository architecture normally do not talk with each other directly, except through the data store.
a. True    b. False


7. Loose coupling is used between repository agents.
a. True    b. False


8. There is tight dependency of agents on the data store in the repository architecture.
a. True    b. False


9. Rule-based knowledge is installed in the blackboard component of the blackboard architecture.
a. True    b. False


10. The facts or hypotheses are stored in the knowledge source component of a blackboard system.
a. True    b. False

6.5 Answers to Self-Review

1 - 5

1. c (Concurrency)

2. a (AI System)

3. a (True)

4. a (True)

5. b (False)

6 - 10

6. a (True)

7. a (True)

8. a (True)

9. b (False - in Knowledge Source)

10. b (False - in Blackboard)

Week 5 Crux: Data-Centered Arch

Feature Repository Blackboard
Control Flow Agents (User Logic) Data State (Triggers)
Data Store Passive (Wait for query) Active (Notify agents)
Connection Explicit Invocation (Call) Implicit Invocation (Pub/Sub)
Best For DBMS, Business Apps, CASE AI, Speech/Pattern Recognition
Data Stability Stable (defined schema) Evolving (hypotheses)