11

Is there room for a practical modern application in Java of the Blackboard Pattern detailed in "The Pragmatic Programmer"? Is there any particular library that attempts to assist in the implementation of this concept? What is the general consensus on this pattern in the present software community (especially Java)?

Though the idea is intriguing, I have a feeling that this portion of the book may be outdated.

In case you are not familiar with this concept: http://flylib.com/books/en/1.315.1.55/1/

3

3 Answers 3

6

My opinion is that a lot of the modern Dependency Injection frameworks are more-or-less an implementation of the whiteboard pattern for application architecture. Google Guice in particular allows you to get particular instances of an object from the "Injector" (or whiteboard as you might like to call it) by annotating the objects it creates in a number of ways (including by name using the @Named annotation). It also allows different modules to collaborate in contributing services to the Injector (whiteboard).

Spring is similar, each context XML file (for example) can contribute to and use objects from the Spring context (whiteboard).

OSGi and its service registry is another example of a whiteboard implementation. Here is a description of how OSGi uses and supports the whiteboard pattern for its inversion of control of event handling in OSGi based systems

Here is a tutorial paper on the relationship between Spring dynamic modules, OSGi and the whiteboard pattern (page 51).

My experience is that Guice in particular is also very powerful for supporting your own implementation of the whiteboard pattern. If most of your objects are being injected from the Guice Injector (whiteboard) then its easy to inject them with any other whiteboard a particular class needs. So you can bootstrap a specific white board (e.g. one containing facts about your domain) using the Guice application architecture white board. (You can do similar with Spring, OSGi or many of the others too although maybe not as directly).

1
  • 3
    In case anyone else is wondering about this, Whiteboards and blackboards seem to be interchangeable terms. Whiteboards are what Barbara Liskov called them, but this term seems to have gotten (mostly) out of use, in favor of blackboards.
    – Wouter
    Commented Apr 5, 2017 at 9:49
2

Well, design patterns are exactly that; conceptual patterns for the development of algorithms, not necessarily implementations of said pattern that work in the general case. As such, libraries that provide "built-in" functionality may use a particular pattern, and may even be shining examples of the use of said pattern, but they aren't THE pattern. You don't need a StrategyProvider class that can be configured to meet any need, you just define a set of classes and structure them to follow the Strategy pattern.

The idea is intriguing. It looks like it would work well for document organization, flow-charting, social networks, etc etc. However, its implementation in each of those scenarios would be quite different, and while there's overlap it may be impossible to create one implementation that meets the requirements of all these scenarios, without exhibiting "inner-platform effect" (an object/library/application so complex and configurable that it basically becomes a reimplementation of the IDE used to build it).

3
  • 1
    I think the retaggers got a little overzealous. I would consider this more of an architectural pattern than a design pattern. More in line with SOA than the Factory Pattern. Maybe I shouldn't have used the word 'pattern'
    – smp7d
    Commented Feb 2, 2012 at 20:08
  • I think my answer stands; Blackboard is a "pattern" used to create requirements-specific implementations, and the pattern itself is not intended to have a general-case implementation. Your example of SOA is still just a concept; you can't build a meaningful "SOA engine" without knowing what the intended use will be (Microsoft's WCF might be thought of as a "SOA engine", but really it's a proxy architecture that can be applied to a SOA design to simplify communications details; it's useless without your implementation and borders on inner-platform, but it's .NET so we expect that).
    – KeithS
    Commented Feb 2, 2012 at 20:18
  • Your answer is definitely not without merit. However, there can be technologies that assist in the use of this pattern. Just because there is no unified implementation of web service functionality to satisfy all requirements, doesn't mean that there aren't libraries and packages in Java to help in this area. Nevertheless, I will edit my question to make that more clear. Thanks.
    – smp7d
    Commented Feb 7, 2012 at 14:56
0

OpeBBS (Open BlackBoard System) looks like a Java implementation to support usage of the Blackboard pattern.

From their website:

OpenBBS is an open and extensible blackboard system for the development of flexible workflows. The flexibility is achieved through adoption of the blackboard pattern. OpenBBS is modular and embeddable which makes it a lightwheight solution for workflows.

The source, jar, and javadoc can be found on Sourceforge. The Javadoc seems to mention much of the classes you would expect (Blackboard, BlackboardControl, ControlPlan, KnowledgeSource, ...).

The only downside is that it the latest (and only?) release seems to be from 2007.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.