I'm creating the architecture for a new embedded project. The system has some inputs that go to wildly different outputs. The whiteboard pattern is very useful for this (see Listeners Considered Harmful: The "Whiteboard" Pattern), as it decouples the input component from the output components (a 1-to-N relationship).
However, I'm struggling with the N-to-1 relationship (where one output gets data from wildly different inputs). Should I use the whiteboard pattern there? And what about the 1-to-1 relationship?
Advantages that I see of the whiteboard pattern:
- separate deployment and testing of sources and listeners.
- the whiteboard (EventAdmin in the OSGi world) can be monitored separately.
- there is no build-time dependency.
Disadvantages that I see:
- there is no compile-time check on the events (if someone makes a typo in the event topic or the data, you're screwed).
- overhead of the whiteboard (I've done measurements, and it's significant on our platform).
I'm not quite sure how to balance these trade-offs.