Adapter/Wrapper Design Pattern (C#, Microservices)

Поділитися
Вставка
  • Опубліковано 17 бер 2021
  • The Adapter design pattern explained with examples in code & microservices scenario.
    Patreon 🤝 / raw_coding
    Courses 📚 learning.raw-coding.dev
    Shop 🛒 shop.raw-coding.dev
    Discord 💬 / discord
    Twitter 📣 / anton_t0shik
    Twitch 🎥 / raw_coding
    Playlist: • c# design patterns
    Source: github.com/raw-coding-youtube...
    #csharp #adapter #microservices

КОМЕНТАРІ • 45

  • @faithyintii8457
    @faithyintii8457 3 роки тому +11

    I must say I really appreciate and love this series. Thank you so much for the good work you are doing .

    • @RawCoding
      @RawCoding  3 роки тому +1

      Thank you for watching)

  • @niclo3611
    @niclo3611 3 роки тому +2

    You know you are a software development nerd when you recognize at first sight all books people read.
    Great video Anton, keep it up !

    • @RawCoding
      @RawCoding  3 роки тому

      Thank you 🙏 if you like nerding out on programming come join me on clubhouse:P

  • @thatcreole9913
    @thatcreole9913 3 роки тому +1

    Short. Simple. Straight to the point. Love it!

  • @thegaribovv
    @thegaribovv Рік тому

    Good explanation, thanks a lot. I love tutorials when they explain directly on real technical cases, not bird, shape and etc

  • @picflight
    @picflight 3 роки тому +1

    Great explanations! 👍

  • @ganeshkumar-zz5hp
    @ganeshkumar-zz5hp 3 роки тому +1

    great explanation.. every one easy to follow your content. great job bro..

  • @bambusgott4106
    @bambusgott4106 3 роки тому +1

    Very interesting video. Thank You!

    • @RawCoding
      @RawCoding  3 роки тому

      Thank you for watching

  • @saurabhchauhan232
    @saurabhchauhan232 3 роки тому +1

    Thank you for this series sir

    • @RawCoding
      @RawCoding  3 роки тому

      Thank you for watching

  • @farhadshariat
    @farhadshariat 3 роки тому +1

    thanks for your great tutorials, anton do you have any plan for architectural patterns like microservices or DDD?

    • @RawCoding
      @RawCoding  3 роки тому

      Microservices maybe some time in the future might release some tutorials as nfts/shrug

  • @shaikzuhair8537
    @shaikzuhair8537 3 роки тому +2

    Thank you bro..

    • @RawCoding
      @RawCoding  3 роки тому +1

      Thank you for watching

  • @vishalpandey4176
    @vishalpandey4176 3 роки тому +1

    Great 👍🏻

  • @haraheiquedossantos4283
    @haraheiquedossantos4283 2 роки тому +1

    Congrats

  • @anthonyparcker7775
    @anthonyparcker7775 2 роки тому +1

    I really enjoyed your teaching bro, great work. Quick question how can i apply the adapter /wrapper in the following usecase. I am to write a single notification service for my company which can be use to send sms , emails and whatapp . However these channel have third party service providers that i will connect to like the sms there are three service provider ,and also for the email. How can i use adapter design pattern to achive these complex implementations . thanks

    • @RawCoding
      @RawCoding  2 роки тому +1

      Start with an interface - of how you want to send these notifications

    • @anthonyparcker7775
      @anthonyparcker7775 2 роки тому

      @@RawCoding
      public interface INotificationService
      {
      Task SendSms(string to, string message);
      Task SendEmail(string to, string body, IList cc);
      }

    • @anthonyparcker7775
      @anthonyparcker7775 2 роки тому

      i have also done the implementation but i have a challenge , there are two types of sms local or International and i need to validate phone code before making deciding if internation/Local . should this validation be an interface which can also be inject into my NotificationSevice implementation . thanks for the response

  • @aaronaaronaaron5922
    @aaronaaronaaron5922 2 роки тому

    Thanks!!
    #RawCoding you are really awesome! Could be great if you share your bibliography, I would love read it in parallel with your amazing videos 😁 Thanks again

    • @RawCoding
      @RawCoding  2 роки тому

      Cheers and what do you mean bibliography?

    • @aaronaaronaaron5922
      @aaronaaronaaron5922 2 роки тому +1

      @@RawCoding Thanks, for answer, I mean the bunch of books you are reading

  • @swastikprince164
    @swastikprince164 3 роки тому +1

    I saw only books Anton not the pictures on your wall :P

    • @RawCoding
      @RawCoding  3 роки тому

      Why not, the pictures are the best )

  • @moellerdk93
    @moellerdk93 3 роки тому +1

    Back to using Visual Studio? if so how come? I have thourght about to swap to rider, and if there is anything you dont like can you share your pros and cons?

    • @RawCoding
      @RawCoding  3 роки тому +1

      The only reason I’m using visual studio is because it’s easier to read from for newbies. I still prefer Rider if I change my mind you’ll know.

    • @moellerdk93
      @moellerdk93 3 роки тому +1

      @@RawCoding yeah I really like it too. There is some getting used to, but over all a good experience compared to ReSharper visual studio combo

  • @clearlyunwell
    @clearlyunwell 3 роки тому +1

    👍🏽

  • @vibhoregupta1742
    @vibhoregupta1742 3 роки тому +1

    Hi, thanks for the explanation. What i have learned about this pattern from other sources is , that adapter enables communication between client whose interface is incompatible with the interface of the functionality it requires. And adapter will implemement the client interface and call the adaptee and provide the data in the manner client interface expects. What do you think about this?

    • @RawCoding
      @RawCoding  3 роки тому +1

      I think that’s a very text book definition that doesn’t let beginners understand what it is. It assumes we know what incompatible interfaces are and doesn’t let us understand the details or get muscle memory. It will only make sense if you already know what adapter pattern is. But other than that it’s correct 👏

  • @joshuajones02
    @joshuajones02 3 роки тому +1

    In my experience, I've used the adapter pattern to create a concrete class that implements a specific interface that a service I'm trying to implement doesn't easily match in API's...
    i.e. implenting a client for a new WebApi that will be replacing a legacy service in a legacy app, where there is some consistency but requires an additional layer to make the connection cleanly
    Where as the wrapper pattern is more of a generic way to extend a class for any purposes.
    Then also in conjuctiom with the adapter pattern I use the decorator pattern with the adapter pattern to implement any models that the interface responds with, encapsulating thr model being transformed through the constructor.
    Disclaimer - I'm not by any means an expert in design patterns, only sharing my perspective since it sounded unclear where the line is drawn between Adapter, Wrapper, and Decorator

    • @RawCoding
      @RawCoding  3 роки тому

      both Adapter and Decorator are 'wrapping' other objects
      Adapter - make the class fit your other programming interface
      Decorator - inject/add functionality to a class
      it's possible to say that you are decorating your class to fit your other programming interface, however when you are using decorators there will usually be multiples of them, i.e human can be a doctor, soldier or soldier doctor etc...

  • @oleksandrdidenko1872
    @oleksandrdidenko1872 3 роки тому +1

    Why not in Rider?)

    • @RawCoding
      @RawCoding  3 роки тому +2

      Because people cry that I don’t use vs )