The blackboard pattern is arguably the least known among our first group.  This is a pattern that is not common because it is best used with some specialized tasks.  However, you may be familiar with it if you work in speech recognition, vehicle tracking, sonar signals interpretation, or similar open-ended forms of searching and matching.

The Blackboard Pattern Defined

Three appears to be the magic number for parts of an architectural pattern.  Likewise, this pattern again has three concepts that make it up.  There is the blackboard, the knowledge source, and the control.  These parts work together to match data to a solution.

The Blackboard pattern uses the idea of a blackboard as a place to hold global data.  We can inspect or update the blackboard.  A knowledge source can update the blackboard, and we can have multiples of these.  Then, the control works with multiple sources and interacts with the sources and the blackboard.  The control effectively loops through sources looking for a solution and then posts that solution once found.  Thus, this approach allows us to quickly match known solutions or expand available solutions when a new one is needed.

Challenges

We can simplify the blackboard pattern to a form of complex pattern matching.  We are looking through data and determining whether it is new or matches a known solution.  Therefore, the whole pattern is rather loose in its definition.  We can use this to group things like socks of the same color shades or audio of various musical instruments.  Thus, we are doing complex work, typically in the control component.  Likewise, we have an open-ended solution set that can sometimes take substantial time to build out.  The pattern is simple in design.  However, the implementation can be very complex.

Rob Broadhead

Rob is a founder of, and frequent contributor to, Develpreneur. This includes the Building Better Developers podcast. He is also a lifetime learner as a developer, designer, and manager of software solutions. Rob is the founder of RB Consulting and has managed to author a book about his family experiences and a few about becoming a better developer. In his free time, he stays busy raising five children (although they have grown into adults). When he has a chance to breathe, he is on the ice playing hockey to relax or working on his ballroom dance skills.

Leave a Reply