Files
DesignPatternsPHP/Structural/Bridge
MathiasReker 6ec696d00b Final public method for abstract class
All public methods of abstract classes should be final. Enforce API encapsulation in an inheritance architecture. If you want to override a method, use the Template method pattern.
2022-06-16 21:09:49 +02:00
..
2021-10-01 10:26:04 -03:00
2021-10-01 10:26:04 -03:00
2021-10-01 10:26:04 -03:00
2021-10-01 10:26:04 -03:00
2021-10-01 10:26:04 -03:00
2021-10-01 10:26:04 -03:00
2020-06-20 11:27:02 -03:00

`Bridge`__
==========

Purpose
-------

Decouple an abstraction from its implementation so that the two can vary
independently.

UML Diagram
-----------

.. image:: uml/uml.png
   :alt: Alt Bridge UML Diagram
   :align: center

Code
----

You can also find this code on `GitHub`_

Formatter.php

.. literalinclude:: Formatter.php
   :language: php
   :linenos:

PlainTextFormatter.php

.. literalinclude:: PlainTextFormatter.php
   :language: php
   :linenos:

HtmlFormatter.php

.. literalinclude:: HtmlFormatter.php
   :language: php
   :linenos:

Service.php

.. literalinclude:: Service.php
   :language: php
   :linenos:

HelloWorldService.php

.. literalinclude:: HelloWorldService.php
   :language: php
   :linenos:

PingService.php

.. literalinclude:: PingService.php
   :language: php
   :linenos:

Test
----

Tests/BridgeTest.php

.. literalinclude:: Tests/BridgeTest.php
   :language: php
   :linenos:

.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Bridge
.. __: http://en.wikipedia.org/wiki/Bridge_pattern