2020-07-18 07:40:14 +03:00
|
|
|
Key features
|
|
|
|
------------
|
2016-03-31 00:40:49 +03:00
|
|
|
|
2016-04-11 23:16:46 +03:00
|
|
|
.. meta::
|
2016-04-23 15:00:06 +03:00
|
|
|
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control
|
2016-04-11 23:16:46 +03:00
|
|
|
:description: This article describes key features of "Dependency Injector"
|
|
|
|
framework. It also provides some cases and recommendations
|
|
|
|
about usage of "Dependency Injector" framework.
|
|
|
|
|
2016-03-31 00:40:49 +03:00
|
|
|
|
2020-07-18 07:40:14 +03:00
|
|
|
``Dependency Injector`` is a dependency injection framework for Python.
|
|
|
|
It was designed to be a unified and developer-friendly tool that helps
|
|
|
|
implement a dependency injection design pattern in a formal, pretty, and
|
|
|
|
Pythonic way.
|
2016-03-31 00:40:49 +03:00
|
|
|
|
2020-07-18 07:40:14 +03:00
|
|
|
The key features of the ``Dependency Injector`` framework are:
|
|
|
|
|
|
|
|
+ Easy, smart, and Pythonic style.
|
|
|
|
+ Does NOT pollute client code.
|
2020-01-27 03:53:06 +03:00
|
|
|
+ Obvious and clear structure.
|
2016-03-31 00:40:49 +03:00
|
|
|
+ Extensibility and flexibility.
|
2020-01-27 03:53:06 +03:00
|
|
|
+ High performance.
|
2016-03-31 00:40:49 +03:00
|
|
|
+ Memory efficiency.
|
|
|
|
+ Thread safety.
|
2020-01-27 03:53:06 +03:00
|
|
|
+ Documented.
|
|
|
|
+ Semantically versioned.
|
2020-07-18 07:40:14 +03:00
|
|
|
+ Distributed as pre-compiled wheels.
|
|
|
|
|
|
|
|
``Dependency Injector`` containers and providers are implemented as C extension
|
|
|
|
types using ``Cython``.
|
2016-03-31 00:40:49 +03:00
|
|
|
|
2020-07-18 07:40:14 +03:00
|
|
|
``Dependency Injector`` framework can be used in the different application types:
|
2016-03-31 00:40:49 +03:00
|
|
|
|
2020-07-18 07:40:14 +03:00
|
|
|
+ Web applications based on the ``Flask``, ``Django`` or any other web framework.
|
|
|
|
+ Asynchronous applications ``asyncio``, ``aiohttp``, ``Tornado``, or ``Twisted``.
|
2016-03-31 00:40:49 +03:00
|
|
|
+ Standalone frameworks and libraries.
|
|
|
|
+ GUI applications.
|
|
|
|
|
2020-07-18 07:40:14 +03:00
|
|
|
``Dependency Injector`` framework can be integrated on the different project
|
2016-03-31 00:40:49 +03:00
|
|
|
stages:
|
|
|
|
|
2020-07-18 07:40:14 +03:00
|
|
|
+ It can be used in the beginning of the development of a new application.
|
|
|
|
+ It can be integrated into application that is on its active development stage.
|
|
|
|
+ It can be used for refactoring of legacy application.
|
2016-03-31 00:40:49 +03:00
|
|
|
|
2020-07-18 07:40:14 +03:00
|
|
|
Components of ``Dependency Injector`` framework could be used:
|
2016-03-31 00:40:49 +03:00
|
|
|
|
|
|
|
+ In composition with each other.
|
2020-07-18 07:40:14 +03:00
|
|
|
+ Independently from each other.
|
2017-02-28 23:00:08 +03:00
|
|
|
|
|
|
|
.. disqus::
|