34 lines
982 B
Markdown
Raw Permalink Normal View History

2017-04-16 06:51:10 +01:00
---
layout: pattern
title: Data Bus
folder: data-bus
permalink: /patterns/data-bus/
categories: Architectural
language: en
2017-04-16 06:51:10 +01:00
tags:
- Decoupling
2017-03-05 12:15:59 +00:00
---
## Intent
Allows send of messages/events between components of an application
without them needing to know about each other. They only need to know
about the type of the message/event being sent.
## Class diagram
![data bus pattern uml diagram](./etc/data-bus.urm.png "Data Bus pattern")
2017-03-05 12:15:59 +00:00
## Applicability
Use Data Bus pattern when
2017-03-05 12:15:59 +00:00
* you want your components to decide themselves which messages/events they want to receive
* you want to have many-to-many communication
* you want your components to know nothing about each other
2017-03-05 12:15:59 +00:00
## Related Patterns
Data Bus is similar to
2017-03-05 12:15:59 +00:00
* Mediator pattern with Data Bus Members deciding for themselves if they want to accept any given message
* Observer pattern but supporting many-to-many communication
* Publish/Subscribe pattern with the Data Bus decoupling the publisher and the subscriber