# Dependency Injection with Koin | raywenderlich.com

**URL:** <https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378>\
**Category:** 🎓 Courses & Articles\
**Created:** [January 21, 2020, 9:35pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378 "2020-01-21T21:35:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevindmoore](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kevindmoore/32/109046_2.png) [@kevindmoore](https://forums.kodeco.com/u/kevindmoore)\
**Post date:** [January 21, 2020, 9:35pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/1 "2020-01-21T21:35:40Z")

</div>

Learn how to get started with the Dependency Injection framework Koin and how it can make developing CLEAN code and testing easier.

* * *
This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/7042416-dependency-injection-with-koin](https://www.raywenderlich.com/7042416-dependency-injection-with-koin)

---

<div class="post-metadata">

**Author:** ![pilotdown](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pilotdown/32/81494_2.png) [@pilotdown](https://forums.kodeco.com/u/pilotdown)\
**Post date:** [January 22, 2020, 12:29pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/2 "2020-01-22T12:29:09Z")

</div>

Hello @kevindmoore,  
thanks for great tutorial but I have a small remark video number 10 is the same as number 9. 😉

---

<div class="post-metadata">

**Author:** ![kevindmoore](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kevindmoore/32/109046_2.png) [@kevindmoore](https://forums.kodeco.com/u/kevindmoore)\
**Post date:** [January 22, 2020, 4:41pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/3 "2020-01-22T16:41:55Z")

</div>

Thanks for letting us know. It’s now been fixed.

---

<div class="post-metadata">

**Author:** ![nasim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/nasim/32/105896_2.png) [@nasim](https://forums.kodeco.com/u/nasim)\
**Post date:** [July 6, 2020, 6:27pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/5 "2020-07-06T18:27:06Z")

</div>

i can not download any course material or starter project or i dont seen one

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 7, 2020, 4:04am UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/6 "2020-07-07T04:04:51Z")

</div>

@nasim Please use the **Download Materials** button to download the sample project for each episode. I hope it helps!

---

<div class="post-metadata">

**Author:** ![aliceresponde](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aliceresponde/32/93654_2.png) [@aliceresponde](https://forums.kodeco.com/u/aliceresponde)\
**Post date:** [January 5, 2021, 11:48pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/7 "2021-01-05T23:48:03Z")

</div>

Hi, I want to create 2 concrete clases, that implement an interface that has generic parameters

```
interface BaseDataToDomainMapper<out DomainModel, in DataModel> {
    fun toItem(item: DataModel): DomainModel
    fun toItems(dataList: List<DataModel>): List<DomainModel> { return emptyList() }
}

```

I want go provide 2 difference mappers that implement that interface, but koin do not let me  
use generics to provide.

How can I do it to provide a MapperA, MapperB that implement BaseDataToDomainMapper ?  
single(named(“GrowerEntityWithProductLocationDomainMapper”)){  
GrowerEntityWithProductLocationDomainMapper( get())  
}  
Should I use qualifiers named ? should I use the interface after the single ??  
single\<BaseDataToDomainMapper\<GrowerEntityWithProductLocationItem, ProductLocationDao.GrowerEntityWithProductLocation\>\>(named(“GrowerEntityWithProductLocationDomainMapper”)){  
GrowerEntityWithProductLocationDomainMapper( get())  
}

---

<div class="post-metadata">

**Author:** ![kevindmoore](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kevindmoore/32/109046_2.png) [@kevindmoore](https://forums.kodeco.com/u/kevindmoore)\
**Post date:** [January 6, 2021, 8:14pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/8 "2021-01-06T20:14:38Z")

</div>

Yes, I would use named items. Here is an example from my code:  
val coroutines = module {  
single (named(“Background”)) { Dispatchers.Default}  
single (named(“IO”)) { [Dispatchers.IO](http://Dispatchers.IO)}  
single (named(“UI”)) { Dispatchers.Main}  
}

Then you can inject them with that named value you want

---

<div class="post-metadata">

**Author:** ![jeancorzo92](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jeancorzo92/32/81494_2.png) [@jeancorzo92](https://forums.kodeco.com/u/jeancorzo92)\
**Post date:** [March 4, 2021, 7:53pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/9 "2021-03-04T19:53:53Z")

</div>

I can’t find the button to download the material ☹

---

<div class="post-metadata">

**Author:** ![kevindmoore](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kevindmoore/32/109046_2.png) [@kevindmoore](https://forums.kodeco.com/u/kevindmoore)\
**Post date:** [March 4, 2021, 8:36pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/10 "2021-03-04T20:36:13Z")

</div>

![Screen Shot 2021-03-04 at 12.34.51 PM](https://files.chunter.kodeco.com/original/3X/8/b/8bd2fae1a9ff28bce35781615540056df997e85c.png)

---

<div class="post-metadata">

**Author:** ![zsoltkiss](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/zsoltkiss/32/100152_2.png) [@zsoltkiss](https://forums.kodeco.com/u/zsoltkiss)\
**Post date:** [October 23, 2021, 6:18pm UTC](https://forums.kodeco.com/t/dependency-injection-with-koin-raywenderlich-com/95378/11 "2021-10-23T18:18:51Z")

</div>

Awesome course. So far I have always bounced back on DI but it just set me on the path. Grateful thanks for it.
