mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-13 02:14:04 +02:00
Change index.rst to README.rst
remove all pattern's README.md
This commit is contained in:
44
Structural/Proxy/README.rst
Normal file
44
Structural/Proxy/README.rst
Normal file
@@ -0,0 +1,44 @@
|
||||
`Proxy`_
|
||||
========
|
||||
|
||||
Purpose
|
||||
-------
|
||||
|
||||
To interface to anything that is expensive or impossible to duplicate.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
- Doctrine2 uses proxies to implement framework magic (e.g. lazy
|
||||
initialization) in them, while the user still works with his own
|
||||
entity classes and will never use nor touch the proxies
|
||||
|
||||
UML Diagram
|
||||
-----------
|
||||
|
||||
.. image:: uml/uml.png
|
||||
:alt: Alt Proxy UML Diagram
|
||||
:align: center
|
||||
|
||||
Code
|
||||
----
|
||||
|
||||
You can also find these code on `GitHub`_
|
||||
|
||||
RecordProxy.php
|
||||
|
||||
.. literalinclude:: RecordProxy.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
Record.php
|
||||
|
||||
.. literalinclude:: Record.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
Test
|
||||
----
|
||||
|
||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Proxy
|
||||
.. _`Proxy`: http://en.wikipedia.org/wiki/Proxy_pattern
|
Reference in New Issue
Block a user