Dependency Injection Explained Like You’re 5 (with FastAPI Examples)

  Рет қаралды 1,035

Eric Roby

Eric Roby

Күн бұрын

Learning dependency injection can be hard. In this simple FastAPI tutorial we will go over dependency injection and that Depends Keyword.
💻 Repository: www.codingwith...
Want more free repositories? www.codingwith...
🎥 React + FastAPI: • How to build a React +...
🎥 AWS Lambda + FastAPI: • Deploy FastAPI on AWS ...
🎥 MongoDB + FastAPI: • Unlocking the Power of...
🎥 MySQL + FastAPI: • How to build a FastAPI...
🎥 PostgreSQL + FastAPI: • How to build a FastAPI...
🎓 Courses can be found:
FastAPI Beginner & Advanced: www.udemy.com/...
Learn Chatbot Development: www.udemy.com/...
👨‍💻 Hi, I am Eric!👨‍💻
Hey! I’m a seasoned developer and Cloud enthusiast. I love sharing my knowledge and helping others to discover the exciting world of programming and cloud technologies. For more tutorials, tips, and tech magic, don’t forget to hit that subscribe button and ring the bell for notifications!
🙏 Support The Channel 🙏
If you found this tutorial helpful, please give it a thumbs up 👍, comment, and share it with your network 🌍
#fastapi #dependencyinjection #python

Пікірлер: 15
@codingwithroby
@codingwithroby Күн бұрын
There it is folks, dependency injection. What’s your biggest challenge as a developer right now?
@CodePythonPro
@CodePythonPro 21 сағат бұрын
Great video Eric, I hope to built videos like this soon (to help python community in Spanish), thanks for sharing your knowledge.
@codingwithroby
@codingwithroby 20 сағат бұрын
You can do it 🙂 Just be ready for a ton of work and a lot of trial and error.
@moinundin1221
@moinundin1221 Күн бұрын
easy concept for spring boot dev
@codingwithroby
@codingwithroby Күн бұрын
Dependency injection is all over the place in Spring Boot!
@Wolfci
@Wolfci Күн бұрын
More of these please lol just subbed great explanation
@codingwithroby
@codingwithroby 20 сағат бұрын
You bet! I got you
@wait4015
@wait4015 Күн бұрын
Could you make a video on how to use dependency injection without fastapi?
@codingwithroby
@codingwithroby 20 сағат бұрын
Fairly similar - easy way is to initialize the object you will need in the class and then call directly. class FrameworkClass(): def __init__(self, func): self.func = func def do_the_job(self): # some stuff self.func() def my_func(): # do whatever here
@krishnaagarwal7934
@krishnaagarwal7934 Күн бұрын
I love love love ur videoss❤❤❤
@codingwithroby
@codingwithroby Күн бұрын
Aww thank you so much 😊
@ankitmoura1467
@ankitmoura1467 15 сағат бұрын
ok so whole point is to save resources and not create new instance on every api call ryt? but like when we create a new function which returns the new instance for us won't that fn be called on every api call and return a new instance i might be wrong but it feels like we r doing same thing with extra steps help?. also great content
@yashasmn245
@yashasmn245 3 сағат бұрын
Point was modular codebase, if you don't keep seperate function you would copy paste it every where . Makes easy to understand for everyone.
@shafiq_ramli
@shafiq_ramli Күн бұрын
For once I thought DI is a security vulnerability like sqli 😅
@codingwithroby
@codingwithroby Күн бұрын
ohhhh no!!! lol
Coupling and Cohesion Explained
11:43
Gui Ferreira
Рет қаралды 4,8 М.
How Strong is Tin Foil? 💪
00:26
Preston
Рет қаралды 86 МЛН
JavaScript Tutorial Full Course - Beginner to Pro (2024)
22:15:57
SuperSimpleDev
Рет қаралды 1,9 МЛН
Should You Use Dependency Injection Frameworks?
14:43
ArjanCodes
Рет қаралды 43 М.
The Only Database Abstraction You Need | Prime Reacts
21:42
ThePrimeTime
Рет қаралды 209 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 65 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 158 М.
DRY principle is why your codebase sucks?
8:02
CodeOpinion
Рет қаралды 8 М.
I Feel Bad For New Programmers
19:12
ThePrimeTime
Рет қаралды 448 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 818 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 226 М.