Dependency Injection using Microsoft Unity Application block ( DI IOC) - 30 minutes training

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

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

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

    Do not miss our Interview Question video series
    30 Important C# Interview Questions : th-cam.com/video/BKynEBPqiIM/w-d-xo.html
    25 Important ASP.NET Interview Questions : th-cam.com/video/pXmMdmJUC0g/w-d-xo.html
    25 Angular Interview Questions : th-cam.com/video/-jeoyDJDsSM/w-d-xo.html
    5 MSBI Interview Questions : th-cam.com/video/5E815aXAwYQ/w-d-xo.html

  • @CevicheChessSalsa
    @CevicheChessSalsa 9 ปีที่แล้ว +26

    This is the best video about dependency injection I have found out there.
    Your videos are very educational and keep up the good work. Congratulations !!!

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

      Benny Blanco

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

    it took a lot time to learn IOC & DI but no one could better but finally your videos

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

    This is the best video to explain Dependency Injection. You Sir deserves a cookie.

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

    Great...many vidoes just gives theoretical knowledge...u gave practical knowledge

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

    🙏 No words to thank you. Good teacher can make better generations. you are one among them. Thanks Sir. God bless you

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

    Regular subscriber of yours by now. I've been actively watching your videos and one reason is I learn really well from your lecture, practical example and of course you have a brilliant talent overall to teach complicated ideas. I had been looking everywhere to learn DI and nowhere I could understand better the topic more better than I did here. Thank you for all the effort you had given to teach us fellow beginners. My best wishes for your best success.

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

    Wow Wow Wowwww... thankkkkk youuuuuu sooooooooooooo much sir.... I went on depression for last two days to understand this thing.. all other channels are explaining same examples again and again .. this one is lit... whatever questions i had you just explained everything... You're like a god to me now.. Thanks much again.

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

      I feel you brother. I had been feeling the same with understanding Dependency Injection. But now, I am feeling much better.

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

    Just FYI ... unity container now has been moved to a different namespace, called 'Unity' , so while searching nuget you will have to look for that, and microsoft.practices and all other dll wont show up in references, they all will be residing under the 'Unity' itself

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

    This helped me understand Unity and Dependency Injection better than most of the explanations found on the web. Simple and straight to the point.
    Thank you.

  • @mahreenafzal87
    @mahreenafzal87 8 ปีที่แล้ว

    It is one of the best video, I have ever seen on Unity framework. Simple and to the point.

  • @shayakdutta8878
    @shayakdutta8878 9 ปีที่แล้ว +62

    So why did it decide to inject OracleDal and not SQLServerDal?

    • @baartho
      @baartho 8 ปีที่แล้ว +12

      +Shayak Dutta Because the OracleDal was the last one defined.

    • @janjansen7957
      @janjansen7957 8 ปีที่แล้ว +1

      +Bartholomaus Bernsmann ok, can I define then SQLServerDal for injection without changing order of registration?

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

      Pretty sure it injects the last item registered. Switch SQL and Oracle so SQL is last and SQL gets injected.

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

      Can I assume that if OracleDal cause an exception, it will use SQLServerDal instead?

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

      When registering the same interface multiple times however, the ordering does matter; in that case, each subsequent call to RegisterType will overwrite the previous registration for that interface.

  • @SenPradip
    @SenPradip 9 ปีที่แล้ว

    Guruji, you made it so simple than others. That's the key for major attraction on you and your way of teaching. Thanks a ton SIR !!

  • @josemarinno
    @josemarinno 9 ปีที่แล้ว +16

    Hi, very good video, but you said you will show other way to configuration in the second part of the video but i can't find the second part. Could you please show me the link. Thanks you so much.

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

    Very well explained, looking forward to part 2, thanks.

  • @seldom89
    @seldom89 8 ปีที่แล้ว

    Simple explanation yet very concise. Good job sir.

  • @srinivasubhuyya351
    @srinivasubhuyya351 9 ปีที่แล้ว +1

    Thanks Good video.i searched a lot in Google .but finally i got a clear idea about dependency injection......

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

    Nice video.
    Basically you need to 1) nuget unity, 2) register types somewhere at your startup and 3) use Resolve instead of new()... and that´s it

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

    One of the best video on DI.

  • @AS-dc7hb
    @AS-dc7hb 10 ปีที่แล้ว +17

    it used the orace data layer by default. how we can use the sqldata layer in this example.

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

      no it is not by default I guess. It is because the last class associated by IDAL is ORACLE DAL

  • @SushrutKanetkar
    @SushrutKanetkar 8 ปีที่แล้ว +1

    Amazing lecture! One of the best teachers ever ! Kudos Shiv !

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

    Dependency Injection Lay Man Terms. A charging adapter with usb port has inverse dependency with pendrive. Direct dependency means only a pendrive can be plugged into the charging adapter. Usb (universal serial bus technology is called the interface) . The company that made the adapter exposed an interface. Pendrive making company injected the dependency which is the pendrive device. Since the charging adapter has reversed or inversed the dependency you can now plugin a mouse or a keyboard or anything to this adapter. Thats it

  • @DheerajKumarWebDetails
    @DheerajKumarWebDetails 7 ปีที่แล้ว

    and finally you explained polymorphism in this video, It is same as in polymorphism

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

    Sir i have seen your video on ioc which is the finest video on this topic because other blogs and tutorials are making it too difficult to understand🙏🙏🙏

  • @ramachandraaddala
    @ramachandraaddala 9 ปีที่แล้ว

    Hey Man, I gone through not less 5 videos to understand DI, but you are awesome in explanation and any dumb person like me can understand. I have posted in my LinkedInn and wishing you to keep good work continue.

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

    Its very informative and liked the way u explained..

  • @rohitash4122
    @rohitash4122 9 ปีที่แล้ว +1

    Excellent video. Clarified several doubts.

  • @GladiatorSenthil
    @GladiatorSenthil 8 ปีที่แล้ว

    IOC explained elegantly.

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

    Dear Sir.. Please share the second video to configure through XML.

  • @zagroti
    @zagroti 8 ปีที่แล้ว

    Thank you for taking the time to explain the dependency injection.

  • @dnfvideo
    @dnfvideo  10 ปีที่แล้ว +9

    @Abhishek here is the IOC video facebook.com/video.php?v=690253231015623

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

    excellent video.Thanks so much.
    Where i can find next video ?I could not see after tried to search on youtube.

  • @simtri8264
    @simtri8264 7 ปีที่แล้ว

    Question -
    at 26:20 mins -- instead hwy not it create a customer object without constructor ?- why it automaticlly created with constrcuor and that to with OracleDal- we disn't called any injection for the constructor param wight ?

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

    Thanks for sharing this knowledge. You simplified the things and it helps us to understand it.
    Waiting for second part of it where will use XML file for configuration of objects and also answer that why OracleDal object is injected during resolve of customer class.

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

    Good explanation of Dependency Inject using Microsoft Unity block. However you did not answer your last question, why it inserted ORACLE DAL and not SQL Server DAL in your code?

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

    Best explanation out there. Probably forgot to upload second part maybe because this video is very clear, why to create an other video😊😊

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

    No words to appreciate bro.. thank you so much...

  • @gallieon8718
    @gallieon8718 9 ปีที่แล้ว

    Hi. Very grateful for your efforts. I can say I understood right from the first video. Please consider doing the next installment. it would be very helpful for a lot of us. Thanks again.

  • @mdgosoddin192
    @mdgosoddin192 8 ปีที่แล้ว

    Greate Explination Shiv sir Really u decreases my Lot of pressure im ur Big Fan

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

    Wow this video is an exact copy of Programming - What is... Inversion of Control

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

    Very Good video explaining dependency injection. Great work!

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

    Hi, Your explained very simply. Video was very good. I was very much involved in it. Thank you.

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

    Very nicely explained. Can you please share the link for SOLID principle video. thanks.

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

    how did resolve method inject OracleDal along with Customer ?

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

    Hi,
    Here you can you use a simple Conditionnal Resolution via Unity, related to the example of the above nice Video:
    IUnityContainer objContainer= new UnityContainer();
    objContainer.RegisterType();
    objContainer.RegisterType("sql");
    objContainer.RegisterType("oracle");
    var Sql = objContainer.Resolve("sql");
    var cust= objContainer.Resolve (new DependencyOverride(typeof(Idal), Sql));
    cust.CustomerName = "inject Dependances";
    cust.add();

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

    I could follow the concept, but how does the Resolve know that it should return the Oracle object? It would be helpful if u can show where this config is performed in Unity. Other wise the class is excellent. This is like a factory pattern that I worked long time back when I worked on a Java Project. The factory class returns the object.

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

    example neither too hard nor too simple just perfect

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

    Why is it necessary to watch the other DI IOC video when you repeat it all here?

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

    What you are doing is usefull. I finaly understood these concepts with your explanations!

  • @seemamajoka1761
    @seemamajoka1761 9 ปีที่แล้ว

    Very good video for understanding DI.Thanks :) But i need to explore more Please continue sharing.

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

    very very good explanation .. IoC

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

    how to handle many business objects such as customers, suppliers, agents etc in dependency injection? Should we add every object in the container

  • @99Rahulmehta
    @99Rahulmehta 10 ปีที่แล้ว +6

    why instance of oracle was injected and not SQL??

    • @jasonrodgers5533
      @jasonrodgers5533 10 ปีที่แล้ว

      It looks like it goes in order of declaration. If you change the order of the RegisterTypes and put the SqlServerDal one before the OracleDal one, it will use SqlServerDal

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

    Very useful... Thank you so much Sir

  • @srini3993
    @srini3993 7 ปีที่แล้ว

    hi can you tell me - from where obj.container.resolve came to know that it is calling sql or Oracle???? it is used defined classes... how does utility came to know these??

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

    very well explained. Where is video no 2?

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

    why it is not made the call to sqldata access layer through unity framework. how it is identifying which data access layer needs to be call ?

  • @ronnieullah
    @ronnieullah 9 ปีที่แล้ว

    another impressive explanation of a difficult theory. Very helpful. Please keep up the good work.

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

    Excellent video!

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

    Hi, thanks for making this video. I finally learned how DI works. But now I want to learn more and I can't find the next part of this video. Could you please share it?

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

    Can plz share link where IOC video is there

  • @aamirjamal6833
    @aamirjamal6833 9 ปีที่แล้ว

    Very beautifully explained... thanks a lot..

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

    Hello, how is this different from OPEN-CLOSE principle?

  • @kamdemkakengne
    @kamdemkakengne 7 ปีที่แล้ว

    Very nice lesson on Dependency Injection! Thank you so much ! It helped me a lot!

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

    Can you please send a link for inversion of control video ?

  • @sanfordhoffman2392
    @sanfordhoffman2392 8 ปีที่แล้ว

    Very good video. Thank you for taking the time to explain this concept.

  • @seesharp477
    @seesharp477 7 ปีที่แล้ว

    Very good explanation good sir, on both the IoC and the DI. Thank you

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

    Wow never thought it was so simple....Where is the part 2??

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

    very good video to explain the injection dependency, thank you!

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

    Thank you sor...this content is really useful

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

    Hey!! Is this channel still active?? As I want to know Why it injected the dependency of OracleData and not SqlData ?

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

    Great Video. Please provide the part 2 link.

  • @Guitarman01
    @Guitarman01 7 ปีที่แล้ว

    Doesn't registertype basically new up the classes? So why not create a class that returns each type of interface? It seems like unity is doing the same thing just behind the scenes.

  • @anilkale5138
    @anilkale5138 7 ปีที่แล้ว

    Video give better visual and conceptual understanding of DI.

  • @basundhibiryani3546
    @basundhibiryani3546 10 ปีที่แล้ว

    Resolve -- will be used in Service Locator pattern, Service Locator Technique is different from DI right ? Also what if we need SQL Server instance to be passed rather than Oracle instance ???

  • @SujaiSuresh1992
    @SujaiSuresh1992 8 ปีที่แล้ว

    it was a nice one . Nicely explained... thanks a lot..

  • @amit4bhargava1
    @amit4bhargava1 9 ปีที่แล้ว

    This is really informative and nicely presented. Please share the link of next video

  • @VipulKumar-xf8uh
    @VipulKumar-xf8uh 5 ปีที่แล้ว

    How inversion of control is being implemented in events and delegates

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

    thank you so much it was a pretty good tutorial and i learned how to decouple an application by implementing DI IOC injections

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

    Very clear explanation, though in my own opinion it would be better to cut some of the repetitions.
    I think your explanations are clear enough without reexplanations which made me kind of loose interest and feel that I am wasting time.
    Still good video after all, thanks! :)

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

    sir please make second part of this video
    1-Conditional Resolve
    2-Load Configuration from config file
    3- Life time management
    i am waiting

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

    IUnityContainer objContainer = new UnityContainer();
    objContainer.RegisterType("IDal");

    objContainer.RegisterType();
    objContainer.RegisterType();
    From the above how can I have to use SQL Server DB connection how should I gain control over it.
    I've tried some modification as below:
    objContainer.RegisterType("EmployeeSQLServerDB");
    objContainer.RegisterType("EmployeeOracleDB");
    But how Customer object knows which DB connection to select as it is returning lastly added Class in the container ?

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

      Somehow,, I am able to achieve it as the below workaround as follows, is this a good practice or not ?
      var addCust = objContainer.Resolve("EmployeeSQLServerDB");
      Customer cust = new Customer(addCust);
      cust.CustName = "Test1";
      cust.add();

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

    Nice tutorial. Where can I find the part 2?

  • @evgenygoldin5024
    @evgenygoldin5024 8 ปีที่แล้ว +1

    Do I have to register both IDal implementation and how does the UnityContainer decide which IDal implementation to inject to the Customer constructor???

  • @PraveenKumar-ft2kr
    @PraveenKumar-ft2kr 6 ปีที่แล้ว

    Thanks sir.. Excellent one 😊😊

  • @AkashYadav-eh6fc
    @AkashYadav-eh6fc 8 ปีที่แล้ว +8

    It instantiated with OracleDal class why ? why not SQLServerDal ? how does it decides ?
    Thanks.

    • @johnnydepp1499
      @johnnydepp1499 8 ปีที่แล้ว

      let me know if you have got the answer ? thanks

    • @prashantadhakal500
      @prashantadhakal500 8 ปีที่แล้ว

      This is an important question that was overlooked. This whole concept is a moot point if the decision is arbitrary.

    • @YingHuiThe1958
      @YingHuiThe1958 8 ปีที่แล้ว

      so we take a deterministic system and make it indeterministic. Looks like last "type" to be added is the one chosen.

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

      It is very simple which surprise me why the author did not even pointed it out (PS this video is like it was stripped of from Pluralsight). Unity will use the last registered object to resolve which is the OracleDal

    • @yvdineshkumar
      @yvdineshkumar 8 ปีที่แล้ว

      This will explain your question and continuation of above video in different form..
      stackoverflow.com/a/32415954/7260208

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

    Great video but can you please share second video link.. Links are not organised.

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

      They never made it.

  • @rockingdude8383
    @rockingdude8383 9 ปีที่แล้ว +1

    Excellent video. Best short video for dependency injection. Thanks a lot and let us know when is the 2nd part releasing :-)

  • @kaushalbhatt5443
    @kaushalbhatt5443 7 ปีที่แล้ว

    Hi how do i call SQL or Oracle Add Method when calling Customer Class Add Method, because at now it will call only last register IDal Add method

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

    Thanks. Great video. Very well explained in simple way..

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

    Where is the 2 part sir? Plz share the link

  • @sugirthansivasakthy4517
    @sugirthansivasakthy4517 8 ปีที่แล้ว

    i could not find the next video. can you share the link?

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

    please provide that link of (ioc)

  • @jinizzraeel7705
    @jinizzraeel7705 7 ปีที่แล้ว

    How about determine which DB to use on the DAL?

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

    can anyone please explain why only oracle one object is called by unity not sql one

  • @BhushanChaudhari1988
    @BhushanChaudhari1988 9 ปีที่แล้ว

    Thank you for such a detailed video.

  • @HealingMusiz
    @HealingMusiz 9 ปีที่แล้ว

    Nice video...but why its going to oravcle not Sql?

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

    You say GO and watch IOC first! Go ! then when i search for it in your list nothing comes up.... ? Pleas add a link of what you refer too.

  • @sruthibalachandran387
    @sruthibalachandran387 8 ปีที่แล้ว

    Very informative video. Could you please upload the next part soon and share us the link?

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

    Superb sir,god bless you