Write Flexible Apex using Dependency Injection | Developer Quick Takes

Поделиться
HTML-код
  • Опубликовано: 12 дек 2024
  • НаукаНаука

Комментарии • 17

  • @timyoungblood
    @timyoungblood 2 года назад +7

    I think this is the most concise and well demonstrated explanation of DI I have seen so far. Well done!

  • @MikeAtCirrius
    @MikeAtCirrius 2 года назад +5

    I'd be curious to see the side-by-side PROS and CONS for this approach vs. the OOB Callable Interface pattern. What's the benefit of using one over the other? Thanks for the content!

    • @valeryprokudin1499
      @valeryprokudin1499 2 года назад +1

      Callable is not really suitable for this usecase. You will still need to implement everything using if/else etc. But if we pretend that it would suit it, then without the usage of the interfaces the code would be very complex and inefficient with lots of typecasing and map work.
      Callable shines better with microservices. In case your app should be completely unaware of the payment service implementation. So with callable you would be able to have payment service implementation in the separate repo and never setup this part for sandboxes that do not require payment functionality(and a ton of other cases :))

    • @valeryprokudin1499
      @valeryprokudin1499 2 года назад +1

      Ok I got it :) actually easy to implement with callable. But still , there will be way more runtime errors and all the casting will be less efficient with Callable then with predefined structure.

    • @msrivastav13
      @msrivastav13 2 года назад +4

      Thanks Mike! Looks like a good suggestion for upcoming content!!

    • @sukanta129
      @sukanta129 2 года назад

      @@valeryprokudin1499 fggghhjhjgjhjh

  • @rohanarayan
    @rohanarayan 2 года назад +8

    Same thing can be achieved by using out of box Callable interface .

    • @msrivastav13
      @msrivastav13 2 года назад +4

      @Neel Kamal, You are right, it can be done easily via the callable interface too. Callable will make more loosely coupled and if you understand the implications of the design, then I suggest go for it!! For the purpose of creating content I wanted to keep it simple and let beginner/intermediate developers understand the principles of DI!

    • @RekhaYadav-nj1ks
      @RekhaYadav-nj1ks 2 года назад

      @@msrivastav13 pat and

  • @prakashtiwari2570
    @prakashtiwari2570 2 года назад +3

    Thank you for knowledgeable video 😊

  • @shaunmcarthur3616
    @shaunmcarthur3616 22 дня назад

    Good stuff, thank you.

  • @SalesforceUSA
    @SalesforceUSA 2 года назад +1

    Good video. We recommend this.

  • @gabrielpaez321
    @gabrielpaez321 2 года назад +1

    Hi Mohith, could you explain how you associate metadata fields called Default and Stripe in the manner to show implementaron of each Apex clases implemented (title:implementation Apex class) I build those fields at the metadata but I dont how to related to each class implemented as you show at minute 4.03 at your video.

    • @msrivastav13
      @msrivastav13 2 года назад +2

      I have used inner classes to make it easier for audience to follow through the content.
      Use a separate class and no inner classes if you are replicating.

  • @mighty2635
    @mighty2635 2 года назад

    If we really look at the different integration system of payment gateway, they have different way initiate payment with multiple setups , will this work practically for all payment gateway ?

  • @RachitNarayan
    @RachitNarayan 2 года назад

    I missed it. When recording will be available

    • @msrivastav13
      @msrivastav13 2 года назад +1

      This is a short quick take video and not a live stream! Appreciate you hanging around here and watching the content and sharing feedback!