Arnaud Giuliani <> - and on twitter: @arnogiu :revnumber: 2.0.0-beta-4

Cover the extended features for koin-core project.

1. Extensions & Experimental features

The koin-core-ext brings extensions & experimental features to Koin.

1.1. Better definition declaration (Experimental)

Koin DSL can be seen as "manual", while you must fill constructors with "get()" function to resolve needed instances. When your definition don’t need any special constructor integration (injection paarameters or special scope Id), we can go with more compact writing style thanks to API below.

Using reflection is not costless. it replaces what you don"t want to write with reflection code (finding primary constructors, injecting parameters…​). Mind it before using it, if you are on performances constraints platform (Android for example)

1.2. Build any instance with create()

The first introduced function is the create() function.

Instead of declaring a definition with instantiating its constructor and retrieving instances with get()

module {
    single { ComponentA(get() ...) }

You can use instead, the create() function to build an instance from its primary constructor, and fill the needed dependencies.

module {
    single { create<ComponentA>() }

1.3. Even more simple definitions

You can also use the more "compact" notation that will use the create() function. Just use the single function without any expression:

module {

If you have an implementation type and want to resolve with a target type, you can use the following singleBy function:

module {

Works for single, factory & scope

If you use custom constructors expression like injection parameters or others, don’t use the reflection API.