Documentation
Warning
Current implementation is under development, consider to avoid using it in production until 1.0.0
Note
Do not confuse md.di.configuration
component with md.di.Configuration
class
which is part of md.di
component
Overview
md.di.configuration component is designed to process container configuration.
Architecture overview
Installation
Usage example
Resolve definition arguments
md.di.configuration.ResolveProcessor
component designed
to resolve parameter_map
and definition_map
of md.di.Configuration
.
For example, typical code within dependency injection container would look like:
Service may take as static as parameterized argument value.
To configure definition with referencing to a parameter,
use parameter interpolation syntax with parameter name enclosed into
curly parentheses (e.g. {domain.some-parameter-key}
), for example:
Modify container configuration
todo ...
service definition: create, update, delete, collect
Registry service
import md.di
import md.di.configuration
class UpdateProcessor(md.di.configuration.ProcessorInterface):
def process(self, configuration: md.di.Configuration) -> None:
for id_, definition in configuration.definition_map.items():
Validate container configuration
todo ...