Change index.rst to README.rst

remove all pattern's README.md
This commit is contained in:
Faust
2015-04-05 06:05:24 +02:00
parent 818c221c78
commit ff327e3a0c
77 changed files with 45 additions and 647 deletions

View File

@@ -0,0 +1,50 @@
`Singleton`_
============
**THIS IS CONSIDERED TO BE AN ANTI-PATTERN! FOR BETTER TESTABILITY AND
MAINTAINABILITY USE DEPENDENCY INJECTION!**
Purpose
-------
To have only one instance of this object in the application that will
handle all calls.
Examples
--------
- DB Connector
- Logger (may also be a Multiton if there are many log files for
several purposes)
- Lock file for the application (there is only one in the filesystem
...)
UML Diagram
-----------
.. image:: uml/uml.png
:alt: Alt Singleton UML Diagram
:align: center
Code
----
You can also find these code on `GitHub`_
Singleton.php
.. literalinclude:: Singleton.php
:language: php
:linenos:
Test
----
Tests/SingletonTest.php
.. literalinclude:: Tests/SingletonTest.php
:language: php
:linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Singleton
.. _`Singleton`: http://en.wikipedia.org/wiki/Singleton_pattern