8000 minor #9912 Observer instead of Mediator pattern (ruff3d, javiereguiluz) · symfony/symfony-docs@ecef059 · GitHub
[go: up one dir, main page]

Skip to content

Commit ecef059

Browse files
committed
minor #9912 Observer instead of Mediator pattern (ruff3d, javiereguiluz)
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #9912). Discussion ---------- Observer instead of Mediator pattern Actually Event Dispatcher component implements Observer pattern (GoF) but not a Mediator. I think we should change this description so as not to confuse users in the future. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 21ed3d2 Mention that the component implements both patterns 44e1e45 Update event_dispatcher.rst f1b41ca Update event_dispatcher.rst 31a2315 Observer instead of Mediator pattern
2 parents ad83012 + 21ed3d2 commit ecef059

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/event_dispatcher.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ before or after a method is executed, without interfering with other plugins.
2525
This is not an easy problem to solve with single inheritance, and even if
2626
multiple inheritance was possible with PHP, it comes with its own drawbacks.
2727

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

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

525525
.. _Mediator: https://en.wikipedia.org/wiki/Mediator_pattern
526+
.. _Observer: https://en.wikipedia.org/wiki/Observer_pattern
526527
.. _Closures: https://php.net/manual/en/functions.anonymous.php
527528
.. _PHP callable: https://php.net/manual/en/language.pseudo-types.php#language.types.callback
528529
.. _Packagist: https://packagist.org/packages/symfony/event-dispatcher

0 commit comments

Comments
 (0)
0