python-dependency-injector/docs/examples-other/chained_factories.rst
Roman Mogylatov bf978601ba
Refactor services miniapps (#291)
* Refactor services mini app with single container

* Make few little fixes to single container app

* Update requirements.txt for single container example

* Refactor multiple containers example

* Add single container docs page

* Create multiple containers page
2020-09-04 23:19:32 -04:00

22 lines
673 B
ReStructuredText

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