Skip to content
Osama Raddad edited this page Jun 21, 2022 · 1 revision

Introduction

Warehouse is a lightweight Kotlin DSL dependency injection library; this library has a significantly faster learning curve and more human-friendly logs, unlike dagger, and is more explicit; unlike koin, it has graph nesting and multi-module support.

  • Every warehouse has a scope and accessibility modifier as optional properties, and it has * number of modules
  • Every module has an optional scope property, and it has * number of factories
  • Every factory has contract, name, creationPattern, and injectsIn as optional properties, and it has one constructor

each warehouse nested in another warehouse if the warehouse accessibility was open or local and in case the warehouse accessibility was local, the dependences will be only accessible to the first parent warehouses.

The access modifier (private, local, public) on your class determines the object accessibility in the graph in other words, by default, if you can have the type, you can have the object.

Using the contract property, you can store your dependence in the graph by its Interface (this is good for hiding your implementation).

You can store multiple dependencies with the same type if you use the name property.

You can use the scope property to make a subset of your graph access specific modules in the graph.

You can specify where the dependency should be injected by using injectsIn property.

Clone this wiki locally