File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ Chained Factories pattern
2
+ =========================
3
+
4
+ This example demonstrate implementation of "Chained Factories" pattern.
5
+ Main idea of this pattern is about wrapping `Factory ` into other `Factory `
6
+ that mix additional arguments or keyword arguments to a wrapped one.
7
+
8
+ Listing of ``data.py ``, demonstrates sample classes structure:
9
+
10
+ .. literalinclude :: ../../examples/miniapps/factory_patterns/data.py
11
+ :language: python
12
+ :linenos:
13
+
14
+ Listing of ``chained_factories.py ``, demonstrates "Chained Factories"
15
+ pattern and provide some explanation:
16
+
17
+ .. literalinclude :: ../../examples/miniapps/factory_patterns/chained_factories.py
18
+ :language: python
19
+ :linenos:
20
+
21
+
22
+ .. disqus ::
Original file line number Diff line number Diff line change
1
+ Factory of Factories pattern
2
+ ============================
3
+
4
+ This example demonstrate implementation of "Factory of Factories" pattern.
5
+ Main idea of this pattern is about creation of a :py:class: `Factory ` that
6
+ creates another :py:class: `Factory ` and mix additional arguments to it.
7
+
8
+ Listing of ``data.py ``, demonstrates sample classes structure:
9
+
10
+ .. literalinclude :: ../../examples/miniapps/factory_patterns/data.py
11
+ :language: python
12
+ :linenos:
13
+
14
+ Listing of ``factory_of_factories.py ``, demonstrates "Chained Factories"
15
+ pattern and provide some explanation:
16
+
17
+ .. literalinclude :: ../../examples/miniapps/factory_patterns/factory_of_factories.py
18
+ :language: python
19
+ :linenos:
20
+
21
+
22
+ .. disqus ::
Original file line number Diff line number Diff line change @@ -21,3 +21,5 @@ and powered by *Dependency Injector* framework.
21
21
bundles_miniapp
22
22
use_cases_miniapp
23
23
password_hashing_miniapp
24
+ chained_factories
25
+ factory_of_factories
You can’t perform that action at this time.
0 commit comments