python-dependency-injector/docs/examples/factory_of_factories.rst
Roman Mogylatov 6eff213a68
Migrate to alabaster (#264)
* Add bootstrap and remove created at from ghnav-flask app

* Update readme

* Add logo to the docs

* Update key features description

* Update README

* Change headers of API docs

* Add alabaster theme config

* Update docs index

* Add tutorials section

* Update what is DI page

* Update DI in Python page

* Update tutorials index page

* Update provider docs

* Update container docs

* Update examples docs
2020-07-18 00:40:14 -04:00

21 lines
668 B
ReStructuredText

Factory of Factories pattern
============================
This example demonstrate implementation of "Factory of Factories" pattern.
Main idea of this pattern is about creation of a :py:class:`Factory` that
creates another :py:class:`Factory` and mix additional arguments to it.
Listing of ``data.py``, demonstrates sample classes structure:
.. literalinclude:: ../../examples/miniapps/factory_patterns/data.py
:language: python
Listing of ``factory_of_factories.py``, demonstrates "Chained Factories"
pattern and provide some explanation:
.. literalinclude:: ../../examples/miniapps/factory_patterns/factory_of_factories.py
:language: python
.. disqus::