Dependency INVERSION vs Dependency INJECTION in Python

Veröffentlicht am: 14 May 2021
auf dem Kanal: ArjanCodes
160,686
5.1k

💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.

What's the difference between dependency inversion and dependency injection? Dependency injection is a design pattern that splits creation of objects from their usage. Dependency inversion is a design principle that promotes using abstract classes and interfaces to better separate code. Watch this video to see a few practical examples in Python, and how these concepts help you write nice code that's easy to test.

The code I worked on in this example is available here: https://github.com/ArjanCodes/2021-de....

🎓 ArjanCodes Courses: https://www.arjancodes.com/courses/

🔖 Chapters:
0:00 Intro
0:20 What is a dependency?
1:10 Dependency injection
1:36 Dependency inversion
2:03 Example code
3:22 Example unit tests
5:32 Issues with testing
6:37 Applying dependency injection
8:35 Writing the unit tests
11:20 Applying dependency inversion
12:51 Coverage reports and abstract classes
14:16 The power of dependency inversion
14:49 Adding another authorizer
15:44 Adding tests for the Robot authorizer
17:10 Summary

#arjancodes #softwaredesign #python


Auf dieser Seite können Sie das Online-Video Dependency INVERSION vs Dependency INJECTION in Python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer ArjanCodes 14 May 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 160,686 Mal angesehen und es wurde von 5.1 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!