mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-02 21:17:29 +02:00
create TocTree index
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
.idea
|
.idea
|
||||||
/nbproject
|
/nbproject
|
||||||
/vendor/
|
/vendor/
|
||||||
|
_build/
|
||||||
|
@@ -6,35 +6,18 @@ that identify common communication patterns between objects and realize
|
|||||||
these patterns. By doing so, these patterns increase flexibility in
|
these patterns. By doing so, these patterns increase flexibility in
|
||||||
carrying out this communication.
|
carrying out this communication.
|
||||||
|
|
||||||
- `ChainOfResponsibilities <ChainOfResponsibilities>`__
|
.. toctree::
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern>`__
|
:titlesonly:
|
||||||
- `Command <Command>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Command_pattern>`__
|
|
||||||
- `Iterator <Iterator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Iterator_pattern>`__
|
|
||||||
- `Mediator <Mediator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Mediator_pattern>`__
|
|
||||||
- `NullObject <NullObject>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Null_Object_pattern>`__
|
|
||||||
- `Observer <Observer>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Observer_pattern>`__
|
|
||||||
- `Specification <Specification>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Specification_pattern>`__
|
|
||||||
- `State <State>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/State_pattern>`__
|
|
||||||
- `Strategy <Strategy>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Strategy_pattern>`__
|
|
||||||
- `TemplateMethod <TemplateMethod>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Template_method_pattern>`__
|
|
||||||
- `Visitor <Visitor>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Visitor_pattern>`__
|
|
||||||
|
|
||||||
Code
|
ChainOfResponsibilities/index
|
||||||
----
|
Command/index
|
||||||
|
Iterator/index
|
||||||
You can also find these code on `GitHub`_
|
Mediator/index
|
||||||
|
Memento/index
|
||||||
Test
|
NullObject/index
|
||||||
----
|
Observer/index
|
||||||
|
Specification/index
|
||||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Behavioral
|
State/index
|
||||||
|
Strategy/index
|
||||||
|
TemplateMethod/index
|
||||||
|
Visitor/index
|
@@ -5,13 +5,13 @@ Multiton
|
|||||||
MAINTAINABILITY USE DEPENDENCY INJECTION!**
|
MAINTAINABILITY USE DEPENDENCY INJECTION!**
|
||||||
|
|
||||||
Purpose
|
Purpose
|
||||||
=======
|
-------
|
||||||
|
|
||||||
To have only a list of named instances that are used, like a singleton
|
To have only a list of named instances that are used, like a singleton
|
||||||
but with n instances.
|
but with n instances.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
========
|
--------
|
||||||
|
|
||||||
- 2 DB Connectors, e.g. one for MySQL, the other for SQLite
|
- 2 DB Connectors, e.g. one for MySQL, the other for SQLite
|
||||||
- multiple Loggers (one for debug messages, one for errors)
|
- multiple Loggers (one for debug messages, one for errors)
|
||||||
|
@@ -8,29 +8,15 @@ could result in design problems or added complexity to the design.
|
|||||||
Creational design patterns solve this problem by somehow controlling
|
Creational design patterns solve this problem by somehow controlling
|
||||||
this object creation.
|
this object creation.
|
||||||
|
|
||||||
- `AbstractFactory <AbstractFactory>`__
|
.. toctree::
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Abstract_factory_pattern>`__
|
:titlesonly:
|
||||||
- `Builder <Builder>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Builder_pattern>`__
|
|
||||||
- `FactoryMethod <FactoryMethod>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Factory_method_pattern>`__
|
|
||||||
- `Multiton <Multiton>`__ (is considered an anti-pattern! :no\_entry:)
|
|
||||||
- `Pool <Pool>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Object_pool_pattern>`__
|
|
||||||
- `Prototype <Prototype>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Prototype_pattern>`__
|
|
||||||
- `SimpleFactory <SimpleFactory>`__
|
|
||||||
- `Singleton <Singleton>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Singleton_pattern>`__ (is
|
|
||||||
considered an anti-pattern! :no\_entry:)
|
|
||||||
- `StaticFactory <StaticFactory>`__
|
|
||||||
|
|
||||||
Code
|
AbstractFactory/index
|
||||||
----
|
Builder/index
|
||||||
|
FactoryMethod/index
|
||||||
You can also find these code on `GitHub`_
|
Multiton/index
|
||||||
|
Pool/index
|
||||||
Test
|
Prototype/index
|
||||||
----
|
SimpleFactory/index
|
||||||
|
Singleton/index
|
||||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational
|
StaticFactory/index
|
@@ -1,18 +1,9 @@
|
|||||||
More
|
More
|
||||||
====
|
====
|
||||||
|
|
||||||
- `Delegation <Delegation>`__
|
.. toctree::
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Delegation_pattern>`__
|
:titlesonly:
|
||||||
- `ServiceLocator <ServiceLocator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Service_locator_pattern>`__
|
|
||||||
- `Repository <Repository>`__
|
|
||||||
|
|
||||||
Code
|
Delegation/index
|
||||||
----
|
ServiceLocator/index
|
||||||
|
Repository/index
|
||||||
You can also find these code on `GitHub`_
|
|
||||||
|
|
||||||
Test
|
|
||||||
----
|
|
||||||
|
|
||||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More
|
|
@@ -1,3 +1,6 @@
|
|||||||
|
Bridge
|
||||||
|
======
|
||||||
|
|
||||||
Purpose
|
Purpose
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@@ -2,13 +2,13 @@ Composite
|
|||||||
=========
|
=========
|
||||||
|
|
||||||
Purpose
|
Purpose
|
||||||
=======
|
-------
|
||||||
|
|
||||||
To treat a group of objects the same way as a single instance of the
|
To treat a group of objects the same way as a single instance of the
|
||||||
object.
|
object.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
========
|
--------
|
||||||
|
|
||||||
- a form class instance handles all its form elements like a single
|
- a form class instance handles all its form elements like a single
|
||||||
instance of the form, when ``render()`` is called, it subsequently
|
instance of the form, when ``render()`` is called, it subsequently
|
||||||
|
@@ -5,33 +5,16 @@ In Software Engineering, Structural Design Patterns are Design Patterns
|
|||||||
that ease the design by identifying a simple way to realize
|
that ease the design by identifying a simple way to realize
|
||||||
relationships between entities.
|
relationships between entities.
|
||||||
|
|
||||||
- `Adapter <Adapter>`__
|
.. toctree::
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Adapter_pattern>`__
|
:titlesonly:
|
||||||
- `Bridge <Bridge>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Bridge_pattern>`__
|
|
||||||
- `Composite <Composite>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Composite_pattern>`__
|
|
||||||
- `DataMapper <DataMapper>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Data_mapper_pattern>`__
|
|
||||||
- `Decorator <Decorator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Decorator_pattern>`__
|
|
||||||
- `DependencyInjection <DependencyInjection>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Dependency_injection>`__
|
|
||||||
- `Facade <Facade>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Facade_pattern>`__
|
|
||||||
- `FluentInterface <FluentInterface>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Fluent_interface>`__
|
|
||||||
- `Proxy <Proxy>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Proxy_pattern>`__
|
|
||||||
- `Registry <Registry>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Service_locator_pattern>`__
|
|
||||||
|
|
||||||
Code
|
Adapter/index
|
||||||
----
|
Bridge/index
|
||||||
|
Composite/index
|
||||||
You can also find these code on `GitHub`_
|
DataMapper/index
|
||||||
|
Decorator/index
|
||||||
Test
|
DependencyInjection/index
|
||||||
----
|
Facade/index
|
||||||
|
FluentInterface/index
|
||||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural
|
Proxy/index
|
||||||
|
Registry/index
|
2
conf.py
2
conf.py
@@ -108,7 +108,7 @@ todo_include_todos = False
|
|||||||
|
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
html_theme = 'sphinx-rtd-theme'
|
html_theme = 'sphinx_rtd_theme'
|
||||||
|
|
||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
# Theme options are theme-specific and customize the look and feel of a theme
|
||||||
# further. For a list of options available for each theme, see the
|
# further. For a list of options available for each theme, see the
|
||||||
|
87
index.rst
87
index.rst
@@ -21,87 +21,14 @@ Please click on the
|
|||||||
`:notebook: <http://en.wikipedia.org/wiki/Software_design_pattern>`__
|
`:notebook: <http://en.wikipedia.org/wiki/Software_design_pattern>`__
|
||||||
for a full explanation of the pattern on Wikipedia.
|
for a full explanation of the pattern on Wikipedia.
|
||||||
|
|
||||||
`Creational <Creational>`__
|
.. toctree::
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
:titlesonly:
|
||||||
|
:numbered:
|
||||||
|
|
||||||
- `AbstractFactory <Creational/AbstractFactory>`__
|
Creational/index
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Abstract_factory_pattern>`__
|
Structural/index
|
||||||
- `Builder <Creational/Builder>`__
|
Behavioral/index
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Builder_pattern>`__
|
More/index
|
||||||
- `FactoryMethod <Creational/FactoryMethod>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Factory_method_pattern>`__
|
|
||||||
- `Multiton <Creational/Multiton>`__ (is considered an anti-pattern!
|
|
||||||
:no\_entry:)
|
|
||||||
- `Pool <Creational/Pool>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Object_pool_pattern>`__
|
|
||||||
- `Prototype <Creational/Prototype>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Prototype_pattern>`__
|
|
||||||
- `SimpleFactory <Creational/SimpleFactory>`__
|
|
||||||
- `Singleton <Creational/Singleton>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Singleton_pattern>`__ (is
|
|
||||||
considered an anti-pattern! :no\_entry:)
|
|
||||||
- `StaticFactory <Creational/StaticFactory>`__
|
|
||||||
|
|
||||||
`Structural <Structural>`__
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
- `Adapter <Structural/Adapter>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Adapter_pattern>`__
|
|
||||||
- `Bridge <Structural/Bridge>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Bridge_pattern>`__
|
|
||||||
- `Composite <Structural/Composite>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Composite_pattern>`__
|
|
||||||
- `DataMapper <Structural/DataMapper>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Data_mapper_pattern>`__
|
|
||||||
- `Decorator <Structural/Decorator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Decorator_pattern>`__
|
|
||||||
- `DependencyInjection <Structural/DependencyInjection>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Dependency_injection>`__
|
|
||||||
- `Facade <Structural/Facade>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Facade_pattern>`__
|
|
||||||
- `FluentInterface <Structural/FluentInterface>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Fluent_interface>`__
|
|
||||||
- `Proxy <Structural/Proxy>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Proxy_pattern>`__
|
|
||||||
- `Registry <Structural/Registry>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Service_locator_pattern>`__
|
|
||||||
|
|
||||||
`Behavioral <Behavioral>`__
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
- `ChainOfResponsibilities <Behavioral/ChainOfResponsibilities>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern>`__
|
|
||||||
- `Command <Behavioral/Command>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Command_pattern>`__
|
|
||||||
- `Iterator <Behavioral/Iterator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Iterator_pattern>`__
|
|
||||||
- `Mediator <Behavioral/Mediator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Mediator_pattern>`__
|
|
||||||
- `Memento <Behavioral/Memento>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Memento_pattern>`__
|
|
||||||
- `NullObject <Behavioral/NullObject>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Null_Object_pattern>`__
|
|
||||||
- `Observer <Behavioral/Observer>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Observer_pattern>`__
|
|
||||||
- `Specification <Behavioral/Specification>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Specification_pattern>`__
|
|
||||||
- `State <Behavioral/State>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/State_pattern>`__
|
|
||||||
- `Strategy <Behavioral/Strategy>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Strategy_pattern>`__
|
|
||||||
- `TemplateMethod <Behavioral/TemplateMethod>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Template_method_pattern>`__
|
|
||||||
- `Visitor <Behavioral/Visitor>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Visitor_pattern>`__
|
|
||||||
|
|
||||||
`More <More>`__
|
|
||||||
~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
- `Delegation <More/Delegation>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Delegation_pattern>`__
|
|
||||||
- `ServiceLocator <More/ServiceLocator>`__
|
|
||||||
`:notebook: <http://en.wikipedia.org/wiki/Service_locator_pattern>`__
|
|
||||||
- `Repository <More/Repository>`__
|
|
||||||
|
|
||||||
Contribute
|
Contribute
|
||||||
----------
|
----------
|
||||||
|
Reference in New Issue
Block a user