10000 Observer instead of Mediator pattern by ruff3d · Pull Request #9912 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Observer instead of Mediator pattern #9912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Mention that the component implements both patterns
  • Loading branch information
javiereguiluz authored Jun 25, 2018
commit a844c4df4d8ae945137c7622376258c1c7a1162a
7 changes: 4 additions & 3 deletions components/event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ before or after a method is executed, without interfering with other plugins.
This is not an easy problem to solve with single inheritance, and even if
multiple inheritance was possible with PHP, it comes with its own drawbacks.

The Symfony EventDispatcher component implements the `Observer`_ pattern
in a simple and effective way to make all these things possible and to make
your projects truly extensible.
The Symfony EventDispatcher component implements the `Mediator`_ and `Observer`_
design patterns to make all these things possible and to make your projects
truly extensible.

Take a simple example from :doc:`the HttpKernel component </components/http_kernel>`.
Once a ``Response`` object has been created, it may be useful to allow other
Expand Down Expand Up @@ -516,6 +516,7 @@ Learn More
* :ref:`The kernel.event_listener tag <dic-tags-kernel-event-listener>`
* :ref:`The kernel.event_subscriber tag <dic-tags-kernel-event-subscriber>`

.. _Mediator: https://en.wikipedia.org/wiki/Mediator_pattern
.. _Observer: https://en.wikipedia.org/wiki/Observer_pattern
.. _Closures: https://php.net/manual/en/functions.anonymous.php
.. _PHP callable: https://php.net/manual/en/language.pseudo-types.php#language.types.callback
Expand Down
0