From 0df57272fd3191033952848fcdf72794793a3b84 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Thu, 31 Mar 2016 21:00:48 +0300 Subject: [PATCH] Add document about libraries structure --- docs/main/introduction/introduction_.rst | 45 ------------------------ docs/main/introduction/structure.rst | 40 +++++++++++++++++++++ 2 files changed, 40 insertions(+), 45 deletions(-) delete mode 100644 docs/main/introduction/introduction_.rst diff --git a/docs/main/introduction/introduction_.rst b/docs/main/introduction/introduction_.rst deleted file mode 100644 index 74dc00d8..00000000 --- a/docs/main/introduction/introduction_.rst +++ /dev/null @@ -1,45 +0,0 @@ -Key features ------------- - -*Dependency Injector* is a dependency injection framework for Python projects. -It was designed to be unified, developer's friendly tool for managing any kind -of Python objects and their dependencies in formal, pretty way. - -Below is a list of some key features and points of *Dependency Injector* -framework: - -- Easy, smart, pythonic style. -- Obvious, clear structure. -- Memory efficiency. -- Semantic versioning. - -Main idea of *Dependency Injector* is to keep dependencies under control. - -Main entities -------------- - -Current section describes *Dependency Injector* main entities and their -interaction with each other. - -.. image:: /images/internals.png - :width: 100% - :align: center - -There are 3 main entities: - -- Providers. Providers are strategies of accesing objects. For example, - :py:class:`dependency_injector.providers.Factory` creates new instance of - provided class every time it is called. - :py:class:`dependency_injector.providers.Singleton` creates provided - instance once and returns it on every next call. Providers could be - overridden by another providers. Base class is - - :py:class:`dependency_injector.providers.Provider`. -- Injections. Injections are instructions for making dependency injections - (there are several ways how they could be done). Injections are used mostly - by :py:class:`dependency_injector.providers.Factory` and - :py:class:`dependency_injector.providers.Singleton` providers, but - these are not only cases. Base class is - - :py:class:`dependency_injector.injections.Injection`. -- Catalogs. Catalogs are collections of providers. They are used for grouping - of providers by some principles. Base class is - - :py:class:`dependency_injector.catalogs.DeclarativeCatalog`. diff --git a/docs/main/introduction/structure.rst b/docs/main/introduction/structure.rst index e6472be5..d9a55f72 100644 --- a/docs/main/introduction/structure.rst +++ b/docs/main/introduction/structure.rst @@ -1,2 +1,42 @@ Structure of Dependency Injector -------------------------------- + +Current section describes *Dependency Injector* main entities and their +interaction between each other. + +.. image:: /images/internals.png + :width: 100% + :align: center + +There are 3 main entities: + +.. glossary:: + + Providers + Providers are strategies of accesing objects. For example, + :py:class:`dependency_injector.providers.Factory` creates new instance + of provided class every time it is called. + :py:class:`dependency_injector.providers.Singleton` creates provided + instance once and returns it on every next call. Providers could be + injected into each other. Providers could be overridden by another + providers. Base class is - + :py:class:`dependency_injector.providers.Provider`. + + Injections + Injections are instructions for making dependency injections + (there are several ways how they could be done). Injections are used + mostly by :py:class:`dependency_injector.providers.Factory` and + :py:class:`dependency_injector.providers.Singleton` providers, but + these are not only cases. Base class is - + :py:class:`dependency_injector.injections.Injection`. + + Catalogs + Catalogs are collections of providers. They are used for grouping + of providers by some principles. Base class is - + :py:class:`dependency_injector.catalogs.DeclarativeCatalog`. + +Some general principles about *Dependency Injector* entities: + ++ All of the entities could be used in composition with each other or + separatelly. ++ Each of the entities could be extended via specialization.