New version!A new version of this website is available at architectural-patterns.net. Blackboard
Picture a number of students are all writing on a blackboard at the same time, trying to solve a problem. You think they will? What if we add a teacher who first asks each student what he wants to write on the blackboard and decides which student has the best idea. And when the student is finished, the process is repeated. This is the idea behind the blackboard architecture. The students are called Knowledge Sources. The teacher is called the Scheduler. The Blackboard is the common datastructure of the Knowledge Sources. The blackboard is able to represent all states of some problem space. The blackboard contains several levels of description with respect to the problem space. These levels may have several relationships with each other, like is-part-of. Levels are parts of the same datastructure. If separate datastructures are needed, the blackboard is divided into panels. Each panel in turn may contain several levels. The Knowledge Source is a component that adds to the solution of the problem. It may be anything that reads from some level of the blackboard and suggests some change to parts of the blackboard. Its most common form is the production rule. Knowledge Sources are completely unconnected to other Knowledge Sources. The Scheduler determines which Knowledge Source gets the chance to change the blackboard. Every execution cycle, it notices changes to the blackboard, activates the appropriate Knowledge Sources, selects one of these and executes it. The blackboard is a specialisation of the Repository architecture. Examples
Where does it come from?The blackboard is developed in the early 1970's for Hearsay-II. Its purpose was to interpret spoken sentences, in order to query a database. The speech signal was interpreted in several levels ranging from acoustic signal parameters to complete sentences. The architecture is an extension of the Production System. In Production Systems there is also a common data structure, called working memory. It contains production rules, rules that execute any number of actions, when their preconditions are fulfilled. These rules fire directly. The blackboard architecture adds a controller to this system and allows for more flexible ways to change the common datastructure. When should you use it?
How does it work?Running the program having this architecture, entails continually executing the execution cycle (control, cycle). These are the steps that are continuously executed during the cycle:
Problems
Common implementation techniques
Links |