mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-30 05:23:59 +03:00
6eff213a68
* 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
22 lines
673 B
ReStructuredText
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::
|