Dependency Injection in C#  A Hands-On Guide to Boosting Code Flexibility and Testability

Dependency Injection in C# A Hands-On Guide to Boosting Code Flexibility and Testability

Skill Foundry

8 месяцев назад

14,398 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@JanKowalski-ld4ec
@JanKowalski-ld4ec - 28.01.2024 01:21

I'd been lookin for good interface explanation until I found your channel. And you did best of what you could. Explained interfaces and DI at once, on working example. Fantastic job! Great content, great teaching approach, wide perspective filled with necessary details without overhelming the learner and topic. All the best for you and your channel!

Ответить
@justHeisen
@justHeisen - 24.01.2024 09:17

You have the perfect pace for teaching.

Ответить
@waynegreen7970
@waynegreen7970 - 10.01.2024 22:22

Good content!

Ответить
@CHURUTEInternational
@CHURUTEInternational - 05.01.2024 00:15

2 questions. are you in your bath tub? and does this work the same if I want to use dependency injection in xamarin forms or MAUI?

Ответить
@julieyeaeun
@julieyeaeun - 10.12.2023 06:31

Eric you are an AMAZING teacher!
Sincerely, a former teacher turned programmer :)

Ответить
@randallholmes4282
@randallholmes4282 - 17.11.2023 22:19

Beautiful! Thank you!

Ответить
@gracicot42
@gracicot42 - 09.11.2023 17:38

Hi! I'm the creator of the kangaru dependency injection library for C++. What I love about that tutorial is that you teach beginners to do it without a framework. A dependency injection library is only there to automate boilerplate that happens in the wiring code, and not essential for dependency injection.

Another point (for more advanced programmers) is that technically, dependency injection don't require interfaces to work. union (sum types) or enums can also do the trick when you want your component to let users choose its behaviour, but have a closed set of possible behaviour. This still enable testing without introducing virtual function calls when unneeded.

In my case, which might be a C++ only thing, adding virtual functions (any overridable function) strictly only for the purpose of testing is smelly code. I try to keep behaviour choices as closed as possible and thus do my DI with concrete types when possible with the choice of behaviour being values inside those concrete types.

Ответить
@hiwashi707
@hiwashi707 - 04.11.2023 14:55

What an amazing explanation for a very confusing topic to beginners like myself, you even added the testing example that so many people mention but never show! Great work, will definitely follow your channel for more content.

Ответить
@ninjask8ter
@ninjask8ter - 24.09.2023 17:20

This video was a great refresher especially after being away from it for so many years! Is there any available code so I can save?

Ответить
@SeraphixD3
@SeraphixD3 - 30.08.2023 16:26

Nicely explained

Ответить
@Salvotation
@Salvotation - 30.08.2023 11:48

I’m learning programming as a hobbyist and to make my work life easier. I am at the stage where I have learnt the basic C# syntax and solving individual problems. Now trying to start learning OOP, this is a really helpful approach to start understanding it’s uses!

Ответить
@guavavodka
@guavavodka - 28.08.2023 00:08

If anyone is curious why it's called dependency inversion, it is because instead of the class depending on lower level details (where the choices come from), it now depends on a HIGHER level abstraction (the interface), thus the dependencies were inverted

Ответить
@mitkram99
@mitkram99 - 27.08.2023 05:20

This is exactly the approach we took in our project. OOP in C# is not complete if not done with DI. Dependency Injection was intimidating at first but once you fully understood its principles, you'll get addicted to using it in your OOP implementation.

Ответить
@Speak4Yourself2
@Speak4Yourself2 - 26.08.2023 10:39

NIce tutorial! Thanks a lot! Promising channel.

Ответить
@KnightMirkoYo
@KnightMirkoYo - 26.08.2023 01:42

Wow, really cool. I've been doing it a lot in my code, but didn't have a complete understanding of how powerful it is

Ответить
@mahmoudmohammed9287
@mahmoudmohammed9287 - 25.08.2023 16:08

Nice explanation keep it up❤

Ответить
@Mamika_AFK
@Mamika_AFK - 24.08.2023 18:22

Another great video! Keep it up! 😄👍

Ответить