# DI And Inversion Of Control

> Constructor injection, Inversion of Control and the startSharedApp composition root on Android and iOS.

- URL: https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-01-di-basics
- Course: [Mobile Action Pro](https://dantech.academy/en/courses/kotlin-accelerator.md)
- Module: Dependency Injection with Koin
- Duration: 25 min
- Difficulty: intermediate
- Access: Enrolled students
- Tiếng Việt: https://dantech.academy/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-01-di-basics.md

## Objectives

- Write a class that receives its dependencies through the constructor and test it with fakes, without Koin
- Explain Inversion of Control: the power to create objects moves to the composition root
- Read startSharedApp and the two composition roots App.onCreate and doInitApp, along with their startup order

## In this lesson

1. Lesson Goal
2. Part 1: A Class That Creates Its Own Dependencies
3. Part 2: Constructor Injection
4. Part 3: Inversion Of Control
5. Part 4: Who Builds The Graph In The Repo
6. Part 5: DI Doesn't Require A Framework
7. Practice Exercise
8. Code Reading Path
9. Signs To Avoid
10. References
11. Key Points

## Study with an AI agent

The full lesson is for students of this course. Students open the lesson on the web and press **Markdown** to copy all of it, then paste it into Claude, ChatGPT, Cursor or whichever agent you use. Faster: mint a token at `/profile/ai-agents` and your agent reads lessons over MCP.

- [Join the course](https://dantech.academy/en/kotlin-accelerator/checkout)

---

- Previous lesson: [Best Practices And Anti-Patterns](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/06-clean-architecture/lesson-12-best-practices.md)
- Next lesson: [Koin Overview (Multiplatform)](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-03-koin-overview.md)
