Update cross links between Aggregate, Selector, and FactoryAggregate docs

This commit is contained in:
Roman Mogylatov 2022-01-09 21:25:52 -05:00
parent 5700826c6a
commit 5b9da9ea5b
3 changed files with 14 additions and 7 deletions

View File

@ -58,14 +58,14 @@ To use non-string keys or string keys with ``.`` and ``-``, provide a dictionary
"key-with-dashes": providers.Factory(...), "key-with-dashes": providers.Factory(...),
}) })
``Aggregate`` provider is a successor of :ref:`factory-aggregate-provider` provider. ``Aggregate`` provider doesn't have .. seealso::
a restriction on the provider type, while ``FactoryAggregate`` can aggregate only ``Factory`` providers. :ref:`selector-provider` to inject selected provider based on a configuration value or other callable.
``Aggregate`` provider is different from the :ref:`selector-provider`. ``Aggregate`` provider doesn't select which provider ``Aggregate`` provider is different from the :ref:`selector-provider`. ``Aggregate`` provider doesn't select which provider
to inject and doesn't have a selector. It is always injected "as is". The rest of the interface of both providers is similar. to inject and doesn't have a selector. It is always injected "as is". The rest of the interface of both providers is similar.
.. note::
``Aggregate`` provider is a successor of :ref:`factory-aggregate-provider` provider. ``Aggregate`` provider doesn't have
a restriction on the provider type, while ``FactoryAggregate`` can aggregate only ``Factory`` providers.
.. disqus:: .. disqus::

View File

@ -152,6 +152,10 @@ Factory aggregate
:py:class:`FactoryAggregate` provider aggregates multiple factories. :py:class:`FactoryAggregate` provider aggregates multiple factories.
.. seealso::
:ref:`aggregate-provider` it's a successor of ``FactoryAggregate`` provider that can aggregate
any type of provider, not only ``Factory``.
The aggregated factories are associated with the string keys. When you call the The aggregated factories are associated with the string keys. When you call the
``FactoryAggregate`` you have to provide one of the these keys as a first argument. ``FactoryAggregate`` you have to provide one of the these keys as a first argument.
``FactoryAggregate`` looks for the factory with a matching key and calls it with the rest of the arguments. ``FactoryAggregate`` looks for the factory with a matching key and calls it with the rest of the arguments.

View File

@ -30,4 +30,7 @@ When a ``Selector`` provider is called, it gets a ``selector`` value and delegat
the provider with a matching name. The ``selector`` callable works as a switch: when the returned the provider with a matching name. The ``selector`` callable works as a switch: when the returned
value is changed the ``Selector`` provider will delegate the work to another provider. value is changed the ``Selector`` provider will delegate the work to another provider.
.. seealso::
:ref:`aggregate-provider` to work with a group of providers.
.. disqus:: .. disqus::