maslosoft/embedi Embedded Dependency Injection container

Embedi Logo Maslosoft Embe Di

  1. Reusable adapter
  2. Embedded dependency injection
  3. Resources

Embedded Dependency Injection container

Latest Stable Version License

<img src="https://scrutinizer-ci.com/g/Maslosoft/EmbeDi/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"/>

<img src="https://scrutinizer-ci.com/g/Maslosoft/EmbeDi/badges/coverage.png?b=master" alt="Code Coverage" />

Quick Install
composer require maslosoft/embedi
Documentation

Full Embedi Documentation

Configuring external PHP libraries

When developing project targeted at specific framework it is usually easy to allow developer using our library to configure it to his needs.

Each framework comes with some sort of configuration files, let it be YAML, or plain PHP config files. But each has a different format of this configuration, and different means to access this configuration in our library.

So when developing framework independent library - it usually comes with it own configuration scheme. So to allow it to be used with some framework it is required to add some kind of adapter - for each library and for each framework:

Without EmbeDi

Reusable adapter

EmbeDi aims to be reusable configuration adapter allowing dependency injection between frameworks, You project and other libraries.

The idea is that when developing reusable library - make it load configuration using EmbeDi - Embedded Dependency Injection.

Then use existing EmbeDi adapter to connect it to the framework, or our own project. Even if there are no adapter for specified framework or project, generic array adapter can be used.

With EmbeDi

Embedded dependency injection

Dependency injection allows us to build plug-in architecture without direct connections between components. This approach usually requires used libraries to be aware of used dependency injection (DI) container.

So DI container should be also dynamically configured?

EmbeDi allows You to include Dependency Injection container directly in your library.

It is kind of configuring dependency injection from bottom to top of our application. So each library has its own DI container, uses it to configure itself. Then on top of project we only instruct EmbeDi where configuration is stored.

Resources

0 0
1 follower
6 866 downloads
Yii Version: Unknown
License: (not set)
Category: Others
Developed by: pmaselkowski
Created on: Jul 22, 2018
Last updated: (not set)
Packagist Profile
Github Repository

Related Extensions