From 580b31ba13ebd50906916076203769a8418d4133 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Thu, 27 Aug 2020 22:11:18 -0400 Subject: [PATCH] Update providers index page --- docs/providers/index.rst | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/providers/index.rst b/docs/providers/index.rst index f2a0160b..bd5a4745 100644 --- a/docs/providers/index.rst +++ b/docs/providers/index.rst @@ -3,18 +3,32 @@ Providers ========= -Providers help you to define how objects are created. They manage objects lifetime and their -dependencies. +Providers help to assemble the objects. They create objects and inject the dependencies. Each provider is a callable. You call the provider like a function when you need to create an -object or call a function. Provider calls all dependent providers to retrieve the dependencies -and injects them. +object. Provider retrieves the underlying dependencies and inject them into the created object. +It causes the cascade effect that helps to assemble object graphs. -Any of the providers can be overridden by another provider. When provider is overridden it calls -to the overriding provider. This helps in testing or overriding API clients with stubs for dev or -stage environment. +.. code-block:: bash -Providers package API docs - :py:mod:`dependency_injector.providers` + provider1() + │ + ├──> provider2() + │ + ├──> provider3() + │ │ + │ └──> provider4() + │ + └──> provider5() + │ + └──> provider6() + +Another providers feature is an overriding. Any of the providers can be overridden by another +provider. When provider is overridden it calls to the overriding provider instead of providing +the object by its own. This helps in testing. This also helps in overriding API clients with +stubs for the development or staging environment. + +Providers module API docs - :py:mod:`dependency_injector.providers` .. toctree:: :maxdepth: 2