2017-03-05 12:15:59 +00:00
|
|
|
--- # this is so called 'Yaml Front Matter', read up on it here: http://jekyllrb.com/docs/frontmatter/
|
|
|
|
layout: pattern # layout must allways be pattern
|
|
|
|
title: Data Bus # the properly formatted title
|
|
|
|
folder: data-bus # the folder name in which this pattern lies
|
|
|
|
permalink: /patterns/data-bus/ # the permalink to the pattern, to keep this uniform please stick to /patterns/FOLDER/
|
|
|
|
|
|
|
|
# both categories and tags are Yaml Lists
|
|
|
|
# you can either just pick one or write a list with '-'s
|
|
|
|
# usable categories and tags are listed here: https://github.com/iluwatar/java-design-patterns/blob/gh-pages/_config.yml
|
2017-03-05 19:43:57 +00:00
|
|
|
categories: Architectural # categories of the pattern
|
2017-03-05 12:15:59 +00:00
|
|
|
tags: # tags of the pattern
|
2017-03-05 19:43:57 +00:00
|
|
|
- Java
|
|
|
|
- Difficulty-Intermediate
|
2017-03-05 12:15:59 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
## Intent
|
|
|
|
|
2017-03-05 19:43:57 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|

|
2017-03-05 12:15:59 +00:00
|
|
|
|
|
|
|
## Applicability
|
2017-03-05 19:43:57 +00:00
|
|
|
Use Data Bus pattern when
|
2017-03-05 12:15:59 +00:00
|
|
|
|
2017-03-05 19:43:57 +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
|
|
|
|
2017-03-05 19:43:57 +00:00
|
|
|
## Related Patterns
|
|
|
|
Data Bus is similar to
|
2017-03-05 12:15:59 +00:00
|
|
|
|
2017-03-05 19:43:57 +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
|