Supriya Ghosh (Editor)

Blackboard (design pattern)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Blackboard (design pattern)

In software engineering, the blackboard pattern is a behavioral design pattern that provides a computational framework for the design and implementation of systems that used to integrate large and diverse specialised modules. It also implements complex, non deterministic control strategies.

Contents

This pattern has been identified by the members of the HEARSAY-II project and first applied for speech recognition.

Structure

The blackboard model defines three main components:

  • blackboard - a structured global memory containing objects from the solution space
  • knowledge sources - highly specialized modules with their own representation
  • control component - selects, configures and execute knowledge sources.
  • Implementation

    First step is to design the solution space (i.e. various solutions) that leads to the definition of blackboard structure. Then, knowledge source are to be identified. These two activities are very related.

    The next step is to specify the control component that is generally in the form of a complex scheduler that makes use of a set of domain-specific heuristics to rate the relevance of executable knowledge sources.

    Known Uses

    Some usage-domains are:

  • speech recognition
  • vehicle identification and tracking
  • identification of the structure of protein molecules
  • sonar signals interpretation.
  • Consequences

    The blackboard pattern provides effective solutions for designing and implementing complex systems where heterogeneous modules have to be dynamically combined to solve a problem. This provides properties such as:

  • reusability
  • changeability
  • robustness.
  • Blackboard pattern allows multiple processes to work closer together on separate threads, polling, and reacting, if it is needed.

    Example

    Sample radar defense system is provided as an example (in CSharp).

    Code for MainWindow.xaml:

    Code for item container for positioning

    Code for Item (ItemTemplate defines the object, an Image and TextBoxes):

    Code behind the Blackboard component in MVVM ViewModel implementation:

    Code behind the Controller:

    Code for the base class IObject:

    Code in the radar module:

    Code to handle incoming object:

    Code for knowledge source interface:

    implementation for signal processor:

    code segments for copying between writablebitmaps:

    Code for comparing pixel in image recognition:

    Code for plane identification:

    Code for the war machine:

    References

    Blackboard (design pattern) Wikipedia