Update providers index page

This commit is contained in:
Roman Mogylatov 2020-09-02 21:15:06 -04:00
parent dd2ded7321
commit c2426d2a09
3 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,5 @@
.. _create-provider:
Creating a custom providers
===========================

View File

@ -7,7 +7,8 @@ Providers help to assemble the objects. They create objects and inject the depen
Each provider is a callable. You call the provider like a function when you need to create an
object. Provider retrieves the underlying dependencies and inject them into the created object.
It causes the cascade effect that helps to assemble object graphs.
It causes the cascade effect that helps to assemble object graphs. See ``Factory``, ``Singleton``,
``Callable`` and other provider docs below.
.. code-block:: bash
@ -23,10 +24,13 @@ It causes the cascade effect that helps to assemble object graphs.
└──> 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. See the example at :ref:`provider-overriding`.
Another providers feature is an overriding. You can override any provider by another provider.
This helps in testing. This also helps in overriding API clients with stubs for the development
or staging environment. See the example at :ref:`provider-overriding`.
If you need to inject not the whole object but the parts see :ref:`provided-instance`.
To create a new provider see :ref:`create-provider`.
Providers module API docs - :py:mod:`dependency_injector.providers`

View File

@ -1,3 +1,5 @@
.. _provided-instance:
Injecting provided object attributes, items, or call its methods
================================================================