20. Adapter Design Pattern with Examples, LLD | Low Level Design Interview Question | System Design

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 56

  • @rupeshjha4717
    @rupeshjha4717 2 роки тому +8

    Another example could be -
    There was api which needs pin code to fetch temperaturr, but let's say in your use case u want in with city name, then we can have a adpater in between and get pincode by city then call getTemperatureApi().
    Great series!
    Please keep on doing this.

  • @harikavolam7123
    @harikavolam7123 2 роки тому +4

    Hi Shrayansh, Thanks for passing all the knowledge..Please keep going..I have watched all your LLD and HLD videos...They are very easy to understand..Thanks for helping me in increasing my knowledge..!

  • @pawansinghla2149
    @pawansinghla2149 8 місяців тому +2

    Working in Node, not Java, but liked the way you explained, Thanks for making theses videos

  • @satisfyingwalks4010
    @satisfyingwalks4010 2 роки тому +2

    Your explanation with real life examples always make it easier to understand, thank you! Also at 15:00 you say perceptive, I think you meant perspective (not trying to be the grammar police, only pointing it bcoz I use to make the same mistake as well).

  • @NeerajSharma-mz4es
    @NeerajSharma-mz4es 5 місяців тому +1

    Really nice, impressive content.

  • @dpynsnyl
    @dpynsnyl Рік тому +1

    This is very well explained.

  • @abhimanyuchauhan7407
    @abhimanyuchauhan7407 2 роки тому +5

    Hi Shrayansh !
    Thanks for the video, its really helpful :)
    I see that there are a lot of design patterns which are present. Can you make a video on what all are important / mostly used design patterns from a SDE2 interviews perspective ?

    • @mahanirvaantantra
      @mahanirvaantantra 11 місяців тому

      Learn from an engineering perspective not from an interview perspective.

  • @NeverGiveUp186
    @NeverGiveUp186 Рік тому +2

    Great video as always, Shrayansh!! I had seen an interview question which asked to design a Foreign Currency Exchange System. I had no idea then, but now I think it was an application of Adapter Design Pattern. Please correct me if I am wrong. Thanks!

  • @gunjanbhatia8286
    @gunjanbhatia8286 2 роки тому +2

    Hi Shrayansh, your videos are really helpful. Can you please make one for low level design of chat application.
    Thanks for the sharing your knowledge with us.

  • @charan775
    @charan775 2 місяці тому

    12:20 why do we need interface for adapter?

  • @gyanaranjanmallick9714
    @gyanaranjanmallick9714 Рік тому +1

    Hi Shreyansh, quick question -
    'converting the weight value from pound to kilos', can we consider it as a post processing phase, and we can also call this design pattern a "proxy design" pattern(you discussed postprocessing in proxy design pattern). Or post processing involve some other type of general work, so it may not be suitable to call it "proxy design" pattern?
    thanks and appreciate your work.

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

      Sorry did not understand, when you said post processing, you mean Async operation

  • @harshittrivedi1
    @harshittrivedi1 Рік тому +1

    Heavily used Design pattern for integration framework and Id reconciliations.

  • @ErenYaegerPhilosophy
    @ErenYaegerPhilosophy 3 місяці тому +1

    The arrow directions don't seem correct for is-a & has-a relationship.

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

    Dao returns Database entities. API entry point needs DTOs. So, whatever class we create in middle for this, will that be adaptor?

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

      :) kind of we can say, we fetch data from DB, parse it and fill up in the DTO which client wanted. Good example:)

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

      @@ConceptandCoding Thanks, man.

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

      @@harshinredzone welcome

  • @NehaSingla-re6yv
    @NehaSingla-re6yv Рік тому +1

    Hi Shreyansh, Can you make a video on facade design pattern.

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

    Hi shrayansh thanks pls make video on : How Notion Sharded Their Postgres Database

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

    can we have proxy adapter for preprocessing in above examples..seems like proxy for preprocessing same as adaptter??

    • @ConceptandCoding
      @ConceptandCoding  Рік тому +1

      They are very similar but the purpose which used is different.
      Like proxy if you see it provide same interface and purpose is to control the access.
      In Adaptor also it's kind of a mediator but it's not the same interface.and it used to connect 2 different interfaces

  • @srikantsahoo7084
    @srikantsahoo7084 9 місяців тому

    Can anyone explain me how we can have an object "WeightMachine" inside the class "WeightMachineAdapterImpl" as "WeightMachine" is an interface ??
    Why did we put (new WeightMachineForBabies()) while creating an object of WeightMachineAdapter in main file ??

    • @punitrai9338
      @punitrai9338 5 місяців тому

      There is a HAS-A relationship between them. In the constructor of WeightMachineAdapterImpl, he has passed the reference of WeightMachne, and WeightMachineForBabies implements the WeightMachine interface, so there is an IS-A relationship between these two. So basically whoever class is implementing the WeightMachine interface we can pass that object and it will make code more flexible and easy to maintain as well.
      Hope you already got the answer.

    • @SinghFlex
      @SinghFlex 4 місяці тому

      Understand DIP principal and then you will have the answer my brother.

  • @ankitpahwa8571
    @ankitpahwa8571 Рік тому +3

    Isn't this similar to proxy design pattern

    • @piyushpathak1186
      @piyushpathak1186 10 місяців тому +1

      I guess the adapter design pattern changes the structure of request and response/ just type change
      Whereas proxy design patterns can do a lot like verifying req, setting rate limit ,etc
      Correct me if you found something else

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

    This pattern is somewhat same as Proxy Design pattern (at least UML is almost same) . just one edge is missing .adaptee implements adapter then it become proxy pattern. what do you think ?

    • @ConceptandCoding
      @ConceptandCoding  Рік тому +1

      Proxy class parent is the same interface but in adaptor it has different interface.
      Also intention is different too. Proxy is more like of controlling the access.
      And adaptor more of providing the compatibility between 2 interfaces

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

      @@ConceptandCoding I had the same question. Thanks for clarifying.😄

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

    Please arrange the videos in playlist
    From lecture no 1 to 20

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

      Hi nikhil, pls start from bottom and move Upward, i have added in the title and description of the playlist, kindly check and let me know pls :)

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

      @@ConceptandCoding thanks for replying sir
      One question
      Is the playlist complete ?can we rely on it for interview for LLD
      Or some videos are left ?

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

      @@asktostranger8296 Many many LLD interview questions are pending, so i am slowly covering all. But with these 20 you should be able to take care of LLD interviews

  • @wrishavbhattacharyya5216
    @wrishavbhattacharyya5216 5 місяців тому

    Is it not the same as Proxy design pattern ?

    • @satyajeetdas6577
      @satyajeetdas6577 2 місяці тому

      Correct me if i am wrong , but i think its not same as proxy design pattern , bcoz in proxy it is always two condition if valid then actually logic is executed or allowed if not then some default error message , but here lets take the same example now we want in kg tmrw lets say some other client wants to see the data in different unit so you can just add the new conversion method in interface and logic in the adapter class but how would you do the same in proxy design pattern ! Hope this helps

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

    Hi can we get the Source code Link?
    please

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

      gitlab.com/shrayansh8/interviewcodingpractise/-/tree/main/src/LowLevelDesign/DesignPatterns

  • @arnavsatrusal2480
    @arnavsatrusal2480 10 місяців тому +1

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

    This pattern looks alot similar to proxy pattern. Am i missing something ?

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

      Hi i have covered Proxy pattern too. There is some difference, kindly have a look once Bikrant

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

      @@ConceptandCoding i saw it, I guess apart from constructor injection there isn't much

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

      @@bikrantjajware6062 hey i have the similar doubt, have you find any difference ?

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

    Aren't you using the arrows in wrong direction ? also interface implementaion dotted line and then arrow without filled and when we inherit it will be non-dotted lines with arrow and arrow filled. something that i feel you need to improve on.

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

      :) yes and in one of the Live LLD session, i already mentioned that, i use very simple arrows to define inheritance and composition, as I find them very confusing.
      And that's work out to me in almost all LLD interviews.
      May be I am able to convience the interview by thinking out loud. But yes if you understand the concept, arrows we can correct buddy.

    • @sabkabhala5892
      @sabkabhala5892 Рік тому +1

      @@ConceptandCoding yep your videos are informative grateful for that. But those arrows needs to be shown rightly so that your viewers have right stuff printed in their memory.

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

      @@sabkabhala5892 sure I will do that buddy

  • @Vas_vites
    @Vas_vites 10 місяців тому

    sir isn't it free?