Skip to content

Herbs Container DI for applications #26

@maikvortx

Description

@maikvortx

Describe the solution you'd like

The purpose of this tool is to make it more scalable and make service dependency management easier in your applications that uses gotu usecases and services and take advantage of the inversion of control pattern to loosely couple the components of your application and make them easier to test and maintain

This library can resolve services using Proxy to lazy loading services requesting and register multiples services types like:

  • Function
  • Class
  • Single Value

Describe alternatives you've considered

Additional context

This library can be found in herbs-di and a example of express middleware

container
    .addAsFunction(userRepository)
    .addAsClass(UserService)
    .addAsValue('cache', cache)
    .addAsFunction(getUsersUseCase);

const useCase = container.factoryContainer().getUsersUseCase;
var output = await useCase.run({ name: 'Kenedy' });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    More discussion is needed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions