Design Patterns: Dependency Inversion Principle Explained Practically in C# (The D in SOLID)

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ค. 2024
  • When you are writing code, are you doing it right? That is a question that worries a lot of people, and it should probably at least be something every developer thinks through. Design patterns are best-practice concepts that we can implement into our code to make it better in some way. Think of them as guardrails that keep our code safe. In this video, we are going to look at the fifth entry in the famous SOLID principle. The D stands for Dependency Inversion Principle. This is not the same thing as Dependency Injection, but it is what powers it.
    - Newsletter signup (with exclusive discounts): signup.iamtimcorey.com/ (your email will be kept safe and you will not be spammed).
    - Source Code: leadmagnets.app/?Resource=DIn...
    0:00 - Intro
    1:43 - Demo code walk-through
    4:40 - Dependency Inversion Principle: DI Explained
    7:42 - Implementing DI: Demo code refactoring
    26:15 - Benefits of DI: Changing the code
    27:18 - Benefits of DI: Modular code
    29:10 - Benefits of DI: Dependency injection
    33:03 - Benefits of DI: Unit testing
    37:32 - Summary and concluding remarks

ความคิดเห็น • 768

  • @JamCram00
    @JamCram00 6 ปีที่แล้ว +330

    These are the best series on SOLID in youtube. Thanks a lot.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +24

      I appreciate the kind words.

    • @aaen9417
      @aaen9417 5 ปีที่แล้ว +5

      It's true. These are the videos with the best and simplest explanations.

    • @ChengZhangWhyNot
      @ChengZhangWhyNot 5 ปีที่แล้ว +3

      It's true!

  • @shawnmofid7131
    @shawnmofid7131 5 ปีที่แล้ว +99

    There is no replacement for video content and this type of platform. You get to watch it any time, any where, and as many times as you want to and you can. So glad to be alive in this time and age. Thanks for the content Tim. I leaned a lot.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +4

      You are most welcome. Thanks for watching.

  • @liferide2002
    @liferide2002 6 ปีที่แล้ว +64

    Dependency inversion is the principle; dependency injection is one way of making the principle work. - I love you man 5*****

  • @nytofteAS
    @nytofteAS 6 ปีที่แล้ว +100

    I have been taught here and there about the SOLID principles for over a year now. This seems to be the first time that I have really grasped these concepts completely and now also know how to use them. Thank you and great material in general.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +8

      Awesome! I'm glad it finally clicked. Using these principles can really improve your code.

    • @mihowbogucki4928
      @mihowbogucki4928 5 ปีที่แล้ว +1

      Alexander Markussen totally agree. Thanks Tim Corey

  • @brendonanderson8673
    @brendonanderson8673 3 ปีที่แล้ว +15

    I actually finally understand abstract classes, interfaces and their purpose. This SOLID series helped me a lot!

  • @femloh
    @femloh 5 ปีที่แล้ว +48

    By far the best explanation I have seen on dependency inversion. Thank you.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +1

      You are most welcome. Thanks for watching.

  • @johnpintocarvajal9991
    @johnpintocarvajal9991 3 ปีที่แล้ว +3

    Tim, at first when I saw the length of any of your videos, I thought "oh man...."; but now I know for sure that those 40-60 min are enough to get away with the concept and how it looks in real life/in real code... instead of spending that same hour (probably a lot more) going the hard way: digging on the internet trying to clarify any given concept.
    Just go straight ahead to Tim's channel and enjoy the explanation of such a wonderful teacher.
    Thanks for all the awesome and comprehensive content you make!

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      I am glad you found them valuable (and stuck with them to figure that out).

  • @nickfotopoulos5323
    @nickfotopoulos5323 5 ปีที่แล้ว +4

    I learned more from this short video than I did in weeks of browsing and reading on the topic.

  • @DepressionAlgorithm
    @DepressionAlgorithm 6 ปีที่แล้ว +9

    Finished the whole SOLID series.
    Great series of vids! I really feel like I understand what SOLID is all about and you did a goo job of *showing* why you should use SOLID.
    Can't wait to see that video about Dependency Injection now.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +1

      Excellent! I'm glad this series helped you get a grasp on the why of SOLID.

  • @Funkfreed
    @Funkfreed 3 ปีที่แล้ว +1

    My eyes lit up while watching this! 3 years ago a small company on a conglomerate project we had went live. They were using an automation approval tool that didn't allow much programming but had all the tools i.e. API call, SQL, WS, message builder etc. They were so dependent on this that the business logic was built into each approval flows. We had to do a lot of code changes every time the approval level change. I eventually had to implement a matrix table where all the approval flows adhere to. It made the application dynamic and they can control it however they want as long as they follow certain rules(like the interface).
    It's funny how this principle can be implemented on many other platforms. I think ServiceMesh also has the same concept. You have a lot of containers and they all follow a certain set of rules and all reports back to the command center.
    Thanks Tim for this wonderful lesson! As always you untangle the complication of many programming concepts. God bless you!

  • @mralex6543
    @mralex6543 2 ปีที่แล้ว +5

    Man, I watched these videos as an experienced developer, I almost didn't learn something new.
    BUT I'm so amazed at your skills to explain things in such an interesting and ordered manner. I couldn't stop watching you.
    I'm so amazed that such quality content is available for free here.
    Thanks, man, you're doing a gorgeous job, hope more people will see these vids.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Awesome! Thanks for the kind words.

  • @KamilKubiak96
    @KamilKubiak96 4 ปีที่แล้ว +4

    Thank you Tim. Your detailed yet practical explanation of all the concepts in this series is truly worth its weight in gold. I'll personally recommend this to everyone who is learning SOLID!

  • @MonteMusicChannel
    @MonteMusicChannel 3 ปีที่แล้ว

    Absolutely one of the best SOLID youtube series, well done ! I was struggling refactoring my highly dependant codebase and now i'm refactoring all of my apps one by one, making it more modular/extendable. Big thanks !

  • @faizalvasaya2998
    @faizalvasaya2998 4 ปีที่แล้ว +1

    3 shots to the approach for explaining Dependency Inversion. It goes and sits into our heads and stays there for a long time.
    Keep up to good work Tim.
    You are really making it easy to learn software development.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I appreciate the kind words.

  • @mondem211
    @mondem211 3 ปีที่แล้ว +3

    Thank you, Tim. This series has been eye-opening! I might have to go over Liskov Substitution principle once more but I look forward to it. You have a fascinating skill in articulating what some would find difficulty in explaining. Thank you so much!

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      I am glad my content has been helpful.

  • @konekoshoujo
    @konekoshoujo 6 ปีที่แล้ว +2

    The best SOLID explanation I have found so far! Even better than my Uni- Professor. Thanks a lot and keep up the good work!

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      I am glad you found it valuable.

  • @BeLKa4444
    @BeLKa4444 5 ปีที่แล้ว

    I spent +/- 4 hours (with breaks and by making a lot of notes) to finish your video. You know what? It is definitely worth your time.
    Thank you for sharing this knowledge with people!

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +1

      I am glad you got a lot of value out of this video. Good job going beyond listening to actually studying what you watched.

  • @SuperPizdolizac
    @SuperPizdolizac 6 ปีที่แล้ว +12

    finally, I understand this principle...thank you Tim, as always!

  • @adamlasry5225
    @adamlasry5225 2 ปีที่แล้ว +1

    The best C# teacher in the world! And I really mean it. Thank you so much, sir! Brilliant teacher!

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I appreciate the kind words.

  • @SupersnakeGames
    @SupersnakeGames 3 ปีที่แล้ว +1

    Really enjoyed watching this SOLID series. Learned alot and some things I was fuzzy on have now clicked. Thanks for taking the time to put all of this together!

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      I am glad it was helpful.

  • @eCoderIE
    @eCoderIE 3 ปีที่แล้ว +1

    You're awesome, years in the industry and i always thought Dependency Injection was same as Dependency Inversion. Thank you.

  • @rajnhard
    @rajnhard 5 ปีที่แล้ว +1

    One of the most useful C# channel out there. Thank you for your will to share the knowledge with us Tim!

  • @alexgonzalez2338
    @alexgonzalez2338 2 ปีที่แล้ว

    I’ve been coding for more than 15 years and I thought I knew all of this stuff , until I started interviewing recently for new jobs and I couldn’t really explain it. Now I can. And also , the code at my current company is a mess. These videos are great! Thanks

  • @n9434178
    @n9434178 6 ปีที่แล้ว +2

    Thank you Tim! I really learned a lot from the SOLID series and looking forward to what's up next.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +2

      Excellent. I'm going to cover a couple of one-off topics next but I will be returning to add more to the design patterns series. I'm glad you've enjoyed it so far.

  • @STUPIDYOUTUBE_HIDINGMSGS
    @STUPIDYOUTUBE_HIDINGMSGS 4 ปีที่แล้ว +2

    Thank you for this, that differentiates (or clears the distinction) with dependency inversion vs. injection. You're awesome, Tim!

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      Glad it was helpful!

  • @jaminbenjamin6360
    @jaminbenjamin6360 5 ปีที่แล้ว +3

    Finished with your SOLID videos and a few others about interfaces and generics. The way you SHOW the reasons to use SOLID and the fact that your examples are very similar to real life situations....it makes the content very easy to understand and retain in my mind. Can't thank you enough, I'm gonna watch ALL of your videos!

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +1

      Awesome! I'm glad you are getting so much out of the content.

  • @colinmikolajczak2058
    @colinmikolajczak2058 4 ปีที่แล้ว +6

    Hey, you're videos are amazing. I am actually a computer scientist and know all this but i love to watch your videos since they're of really high quality. I'm sure you're helping a lot of people with this kind of content and the way you're presenting it.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I appreciate the kind words.

  • @mjbarge
    @mjbarge 3 ปีที่แล้ว +1

    Thanks to this, finally I get Dependency Injection - such a relief, thank you so much Tim!

  • @frotes
    @frotes 6 ปีที่แล้ว

    Tim, I just want to say your series and topics are the best. So much clear and easy to follow than any other tutorials I’ve seen so far
    Keep up the good work, can’t wait to see your future ones

  • @princeonukwili996
    @princeonukwili996 ปีที่แล้ว +3

    Thank you Mr.Tim. You're like a father and a mentor to most developers out there, and a grandpa to newbies😂. I really learnt a lot. What brought me here is your tutorial on Dapper and minimal APIs where I asked why you created interfaces for each of the classes, and you replied because of Dependency injection. Since then I've been curious and I'm glad I finally got an answer. Thank you again sir. May God bless you in Jesus Christ name. Amen😌.

  • @XDBjoernXD
    @XDBjoernXD 4 ปีที่แล้ว

    I like that you explain it in the bigger picture. That's a way I can easily understand through your great video. I am very glad that you take your time for this great YT channel. Have a good day!

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I appreciate the kind words.

  • @Velreine
    @Velreine 6 ปีที่แล้ว +3

    I just started looking at Design Patterns not more than a few weeks ago, even bought a course on Udemy.
    What are the odds that the best guy to explain complex principles comes in to rescue the day, just as I'm about to learn all this stuff.
    Thanks for these videos they are great.

  • @thesophisticatedvelocirapt7320
    @thesophisticatedvelocirapt7320 3 ปีที่แล้ว

    If I watch all of Tim Corey's videos, I'm pretty sure I can get 2 or 3 promotions at once. Seriously, these are the best videos I have ever seen.

  • @x12624
    @x12624 3 ปีที่แล้ว +2

    Hi Tim, Thank you very much for this wonderful session. Here's my summary and understanding after practicing the demo project:
    Dependency inversion states that the higher-level modules should not depend on the lower-level module, but rather both should depend on abstraction, and those abstraction should not depend on details. Basically, what this means is, higher-level modules should not create objects of the lower-level modules (classes). This responsibility should be assigned to new class (this class (Factory.cs) takes care of the object creation). The higher-level module classes should implement interface to seperate the implementation. The advantage of this is - if a new class (texter.cs) is addedd in the future to the project, the change is only done at the Factory.cs and does not impact the other files (classes).
    The abstraction should not depend on the details.. the interfaces and Factory.cs does not depend on detail, the implementation is done by the classes that implement these interfaces, Factory.cs only job is to create the objects.
    I hope this understanding is correct?

  • @Calex23
    @Calex23 6 ปีที่แล้ว +5

    These are so helpful and clear. Thank you for taking the time to make these. It's greatly appreciated

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +1

      Awesome! I'm glad they are clear and helpful.

  • @samuelcramphorn3874
    @samuelcramphorn3874 5 ปีที่แล้ว

    Thanks Tim,
    looked online for a lot of examples, glad you actually went through the code and explained it clearly!

  • @Napkinholdin
    @Napkinholdin ปีที่แล้ว +2

    OMG I watched only this one in the SOLID series and my mind is -blown-
    This is exactly how I always thought programming was supposed to be like but my formal education did not go over SOLID, I didn't even know it existed... Thank you so much!!

  • @dvalmont07
    @dvalmont07 5 ปีที่แล้ว

    I Finally understood the 'DI'. This is wonderful. Thank again, Tim!

  • @tomarik
    @tomarik 2 ปีที่แล้ว +2

    Thank you for making these videos. Watching them SOLID in practice has been immensely helpful.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      I am glad my content has been helpful.

  • @mhady
    @mhady 5 ปีที่แล้ว

    This is by far the best tutorial about Dependency Inversion principle, it's the first time i really think i understand the concept. great work Tim

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      Awesome! I'm glad it finally clicked for you.

  • @paulroos8517
    @paulroos8517 4 ปีที่แล้ว +1

    Wow! I have years of experience and I think your tutorial is very useful. What I like is, you get to the point. I am going to look at more of your tutorials. Thank you very much.

  • @mijaved
    @mijaved 3 ปีที่แล้ว

    After watching tons of videos, this practical tutorial made the DIP concept crystal clear, thanks a lot!

  • @anass9487
    @anass9487 5 ปีที่แล้ว +15

    I genuinely loved this video. Thank you!

  • @dancelmarkyosef
    @dancelmarkyosef 5 ปีที่แล้ว +8

    "At some point, you have to new up an instance " this cleared my confusion

  • @dannylaza1326
    @dannylaza1326 6 หลายเดือนก่อน

    These videos really helped me. I always thought I was a good programmer. When I actually got a real job, I see my company implements all this stuff and I was confused on why I kept seeing all these interfaces everywhere. It's mind blowing I didn't know this sooner. This last video is especially amazing. Thanks Tim.

    • @IAmTimCorey
      @IAmTimCorey  6 หลายเดือนก่อน

      I am glad it was helpful.

  • @xcyron
    @xcyron 2 ปีที่แล้ว +1

    This part was probably the most eye opening video of the series. I didn't really get why i should do this implementation at first, but after some time it clicked and became obvious why this is so powerful.
    Should i ever persue a career in c# programming, i will make sure to return the favor.
    Stay awesome Tim.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I am glad it was so helpful.

  • @vartikagupta8816
    @vartikagupta8816 3 ปีที่แล้ว +1

    The best explanation of SOLID principles I have ever seen/read. Tim, you should also do a series on the various design patterns like Factory, Observer etc.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      That is in the works.

  • @subashbarik
    @subashbarik 2 ปีที่แล้ว +1

    It is so nicely explained that it is impossible not to understand. Great Video, I wish I would have watched these SOLID videos before.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I am glad they were so helpful.

  • @alinapostol2230
    @alinapostol2230 3 ปีที่แล้ว

    Indeed as many comments state, THIS IS THE BEST SOLID-SERIES ON TH-cam. Thank you for taking the time to explain these concepts in an easy-to-understand way & using accurate examples. I've read about SOLID and watched many YT videos about them, but YOUR videos are the one who made see through and clearly understand why they exist and how they make our life so much easier... Thank you for all the effort, you deserve MORE SUBS!!

  • @secretsquirrel5566
    @secretsquirrel5566 3 ปีที่แล้ว

    Wow is this good. I know I have to watch it like three more times to completely get it all, but did I ever learn a lot from this. THANK YOU TIM

  • @321zipzapzoom
    @321zipzapzoom 4 ปีที่แล้ว

    Truely awesome explanation of concepts Mr. Corey ..I feel now confident enough to recommend this SOLID series to folks in my circle to extend the ongoing Chain of Viewers.

  • @JohanVergeer
    @JohanVergeer 5 ปีที่แล้ว

    Just like all other videos I've seen from you so far. Amazing. This is the first time for me everything comes together and makes sense as a whole. Thank you for that.
    I have heard and read about the SOLID principles a couple of times now, and when dealing with just (C#) code, it starts to make a lot of sense. Where I'm still struggling at this point is how these principles apply to IO. Like in databases or on screen. (Users these days don't really know how to work with a console.)
    As an example, what I would be really interested in seeing is how you would persist the models you created in the last two video's (employee and library) and what this would look like with MS Entity Framework. This would also apply for Java Spring, or other ORM's, but as you say, this channel focuses on C#.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      If you stay tuned to my current series (the TimCo Retail Manager), you will see DI being used in a WebAPI and probably the WPF app too.

  • @alexvershinin8759
    @alexvershinin8759 ปีที่แล้ว

    Finally the good explanation of DIP after several videos and articles. Thanks a lot!

  • @Billbillbillhahagdvdve
    @Billbillbillhahagdvdve 4 ปีที่แล้ว +2

    Bigup to Tim ! Love your channel - your pace is perfect and your emphasis on the key parts is amazing (e.g. We are looking to great rid of "new" is such a great way to describe dependency inversion) - Shared, Liked and Subscribed !

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +1

      I am glad you are enjoying the content.

  • @MichalSmola8
    @MichalSmola8 5 ปีที่แล้ว

    This is gold! Finally I can say I understand DI - thank you. And in case you don't overuse mouse only to make it easier for us to follow what you are doing (like when you were replacing commas with semicolons) - by pressing Ctrl+Left/Right you can move cursor through code much faster.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      Awesome! And thanks for the tip.

  • @paulofernandoee
    @paulofernandoee 2 ปีที่แล้ว

    These are the best series on SOLID in youtube.(2)
    Great job!

  • @srinivaschaitanya3305
    @srinivaschaitanya3305 ปีที่แล้ว

    For the first time in my life , dependency inversion actually made sense. Thanks a lot!!

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      Awesome! I am glad it was helpful.

  • @kwe4117
    @kwe4117 7 หลายเดือนก่อน

    Somethings on this earth are timeless, this my friend is one of those things. Thank you.

    • @IAmTimCorey
      @IAmTimCorey  7 หลายเดือนก่อน

      You are welcome.

  • @longuinni
    @longuinni 6 ปีที่แล้ว +1

    Great video Tim. I learned a lot from you. I finally understood interfaces in C#.

  • @yatishbhavsar
    @yatishbhavsar 5 ปีที่แล้ว +2

    As always simple & elegant. Thank you for the video.

  • @Tibiafy
    @Tibiafy 4 ปีที่แล้ว

    Tim, you are a great teacher. In fact, I think you are the best teacher I have ever seen. Congratulations and thank you very much for these explanations! I finally got everything i need to know about dependency inversion! :D

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I appreciate the kind words.

  • @atul121984
    @atul121984 6 ปีที่แล้ว +1

    Best description of Dependency Inversion...Thanks a lot Tim...

  • @pedroreisbr
    @pedroreisbr 3 ปีที่แล้ว

    Very good explanation of the SOLID principle, thanks Tim, you are the best!

  • @ko-jiro5971
    @ko-jiro5971 3 ปีที่แล้ว +1

    The clearest explanation or how to explain an absratc concept clearly and simply !!
    Thanks a lot Mr Corey !

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      You're very welcome!

  • @papillonx101
    @papillonx101 6 ปีที่แล้ว +1

    Tim, your SOLID principle explenation is far better and superior to any other tutorial on SOLID so far.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +1

      I'm glad you think so. Thanks!

  • @maydinunlu
    @maydinunlu 3 ปีที่แล้ว

    The best explanation and implementation tutorial about Dependency Inversion Principle and Dependency Injection. I can imagine clearly what is "DI Container" and the other DI structures.

  • @casualoverwatcher2283
    @casualoverwatcher2283 2 ปีที่แล้ว +1

    Even with your clear and beautiful diction recorded in this video, I needed a subtitle because English is my second language. I can't stop laughing at the auto-generated subtitle "nude up" when you said "new'd up". Yes, I'm still childish 🤣

  • @RalfsBalodis
    @RalfsBalodis 3 ปีที่แล้ว +10

    0:00 - Intro
    1:43 - Demo code walk through
    4:40 - Dependency Inversion Principle: DI Explained
    7:42 - Implementing DI: Demo code refactoring
    26:15 - Benefits of DI: Changing the code
    27:18 - Benefits of DI: Modular code
    29:10 - Benefits of DI: Dependency injection
    33:03 - Benefits of DI: Unit testing
    37:32 - Summary and concluding remarks

  • @luizyoung226
    @luizyoung226 2 ปีที่แล้ว +1

    Thanks for these amazing SOLID classes, Tim.
    I'm reading Clean Architecture by Uncle Bob and your videos helped me a lot in terms of seeing things working on the real world.

  • @kbtravels
    @kbtravels ปีที่แล้ว

    Best explanation on DI I've found on TH-cam. Thanks!

  • @gaxkiller
    @gaxkiller 6 ปีที่แล้ว

    Awsome work man, I never hit the bell but after this 5 video on SOLID design patterns I had too.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      Excellent! I'm glad you enjoyed them so much.

  • @muhamadhanifsafwanabrazak551
    @muhamadhanifsafwanabrazak551 5 ปีที่แล้ว

    i learned at my university what is interface, abstract and so on... but have no idea how and when to use them in my development (im a noob obviously), but after watch your SOLID videos, i finally have a strong understanding on how to use them. Thank you so much

  • @TuncTurel
    @TuncTurel 2 ปีที่แล้ว

    Love it! Succinct and thorough. I read five different sources but your video is what made it crystal clear for me.

  • @sodarocketstudios
    @sodarocketstudios 4 ปีที่แล้ว +1

    This series was great! I now realize I have some changes to make in my current project... Wish I had known about this sooner.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I am glad it was helpful.

  • @tin3089
    @tin3089 5 หลายเดือนก่อน

    Thank you so much for your content, this helped me A LOT with one of my more difficult courses in college. I've watched all 5 of your SOLID videos, and I'm continuing :D.

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      You're very welcome!

  • @pierreplourde
    @pierreplourde 2 ปีที่แล้ว

    Now I get why I got confused in the I video; things from SOLI are much clearer for having watched the D!! Great videos.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I am glad it all fell into place.

  • @heinzeckner3655
    @heinzeckner3655 4 ปีที่แล้ว +1

    After numerous videos and blogs, I understood for the first time how easy a factory method can be and where it can be placed. Most authors can or just want to explain it abstractly and academically - but you got to the point. Thanks a lot! ... An open question for me is whether the factory class from your specific example now violates the SRP principle... That's where it's going to be confusing to me all the time in OOP (coming from 15 years of procedural languages). Though I am firmly convinced and excited about the superiority of OOP - sometimes all that conventions/patterns seems to a large extent being busy clearing a lot of stuff from the living room into the kitchen and the hallway - only to conclude that at the end I am mostly in the living room and need most of the things right there :-)

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      Yeah, you have to be careful how you do OOP that you don't just do it because you should. I try to be very pragmatic about what I do so that the patterns and systems work for me rather than against me. Now to answer your question specifically about the factory pattern, no, I don't think it violates SRP because it is doing one thing - instantiating classes. Now, it does have more than one reason to change in some ways but not if you look at it as the reason to change is when a class is added or changed. Ideally, you use a dependency injection system to make this even cleaner and easier to work with.

  • @michaelreynolds4816
    @michaelreynolds4816 4 ปีที่แล้ว

    I concur with JamCram00's comment below. I have also been a Pluralsight subscriber for more than 5 years and I find these videos to be at least as good and as thorough. Please keep them coming, Tim and I will support you with a donation as soon as I find the link to do so.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I appreciate the kind words.

  • @kanha12297
    @kanha12297 9 หลายเดือนก่อน

    Best explanation, after struggling to understand dependency inversion and watching tons of youtube videos which just describe what the principle definition is, found this amazing channel ❤

    • @IAmTimCorey
      @IAmTimCorey  9 หลายเดือนก่อน +1

      I am glad it was helpful.

  • @nedbog
    @nedbog 6 ปีที่แล้ว +1

    Just wow. One of the best! The gang of four: Tim Corey, Mosh Hamedani, Colt Steele and Brad Traversy.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      Thank you very much!

  • @kostaspolitis1871
    @kostaspolitis1871 2 ปีที่แล้ว

    After multiple attempts during the past year, as a new programmer, I was failing to grasp it. Now I have a good picture thanks to you!

  • @LONGLACA
    @LONGLACA 5 ปีที่แล้ว +1

    Thank you, Tim, your examples are very easy to understand the principles

  • @kopilkaiser8991
    @kopilkaiser8991 9 หลายเดือนก่อน

    Thanks Tim. You are the best. I found this video very helpful and informative. You have a talent to explain concepts simply and easy to understand. At times, I struggle to understand these concepts from other sources because they over complicate the concept. But, you on the other hand cover all spots but still being able to make sure the viewer understands most of the explanation! At least I understood almost most of the part, it is just I have to review it couple of times to make sure it all makes sense.

  • @abdelghanidraoui781
    @abdelghanidraoui781 ปีที่แล้ว

    Thanks a Lot Tim for the free invaluable content ! God bless you.

  •  6 ปีที่แล้ว

    Wooow Tim, this video blows my mind!
    Thanks a lot for this videos, i appreciate it a lot!

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +1

      Awesome! I'm glad you enjoyed it.

  • @gravytrain1547
    @gravytrain1547 5 ปีที่แล้ว +2

    You are a great teacher! Thank you so much.

  • @argelpamintuango1956
    @argelpamintuango1956 5 ปีที่แล้ว +1

    I caught the thought! Thanks Mr. Tim!

  • @abhaynath5833
    @abhaynath5833 2 ปีที่แล้ว

    This is hands down the best explanation of dependency inversion. Thanks a lot 🙏🙏🙏

  • @pankajjnumca05
    @pankajjnumca05 6 ปีที่แล้ว

    SOLID can't be explained better than this :) Thanks a lot.

  • @AnanndDhamane
    @AnanndDhamane 4 ปีที่แล้ว +1

    You are really making Coding Simple. Thanks a lot Tim.

  • @giridharamadhavan2200
    @giridharamadhavan2200 3 ปีที่แล้ว

    The best SOLID explanation. Thanks a ton Tim! :)

  • @ricardovalle8360
    @ricardovalle8360 5 ปีที่แล้ว

    Excellent video! very clear and easy to follow. Thanks Tim!

  • @FrudTV
    @FrudTV 5 ปีที่แล้ว +1

    You got a new subscriber. This was an excellent explanation. Thank you!

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      Thank you and welcome aboard!

  • @pierrebertin4364
    @pierrebertin4364 2 ปีที่แล้ว

    As always Tim, huge content, very well explained. Do thank you for that! I did like the fact that you insist on differences between DInj and DInv.

  • @everettbuddenberg7729
    @everettbuddenberg7729 6 ปีที่แล้ว

    Tim. Much appreciated. This complex principle was made easy to understand.

  • @VaderFaderVader
    @VaderFaderVader 6 ปีที่แล้ว

    When i started learning to program, the first thing i focused on was syntax and semantics. I thought that once I understood that, programming would be easy.
    But then I realized that understanding how to structure and design an application is equally important to learning the particulars of the language, if I wanted to progress past simple "Hello World"'s.
    That's when I understood the benefit of - and necessity of learning - design principles.
    Your series on SOLID is pure gold for someone like me struggling to cram all this stuff into my tiny, little brain.
    It also seems to me that studying SOLID is a more productive path than the GOF Design Pattterns; it relates better to the real and actual situation of writing and thinking code.
    I'm really looking forward to the follow ups on DI and IOC, and have one request for when you do:
    If possible, I would prefer to not deal with external frameworks, but rather focus on implementing DI/IOC direclty in plain C#.
    The reason is that I feel that frameworks can sometimes become an obstacle, when I'd prefer to just focus on the raw implementation.
    Thanks for this excellent series!

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      Yep. I tell people that the syntax is 10% of what you need to know. The other 90% is the logic of how to put it together. People often get stuck on learning the 10% but forget to learn the 90% (which is mostly learned through practice). As for doing DI/IoC without a framework, I'm not sure I'll do that right out of the gate. There is so much to learn if you roll your own. I will probably do that at some point but it is the difference between teaching ADO and Dapper. Sure, ADO is closer to the bare metal but Dapper gets you there so much faster. I'm working hard to teach it in a very clear manner that can provide you with more benefits than drawbacks. Still working through the scenario.

  • @SmartTechFarsi
    @SmartTechFarsi 5 ปีที่แล้ว +2

    Excellent Explanation. Thank you very much Tim. :)

  • @mahaswamy
    @mahaswamy 4 ปีที่แล้ว

    SOLID simplified in the right way, great refresher course...

  • @thePavuk
    @thePavuk 3 ปีที่แล้ว

    This is very important part of SOLID. It completely changes way how to solve problem with class dependency.

  • @parko1965
    @parko1965 4 ปีที่แล้ว

    Brilliant, I didn't realise the power of interfaces until now.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I am glad it was helpful.