Adapter Design Pattern

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

КОМЕНТАРІ •

  • @bosaeed2011
    @bosaeed2011 3 роки тому +5

    It's not necessary that the Adapter class inherits the Adaptee class. The Adapter class can have an Adaptee attribute. For example:
    public class Adapter {
    private Adaptee adaptee;
    public Adapter() {
    this.adaptee = new Adaptee();
    }
    //Rest of the code goes here
    }
    By this way, Both Adapter and Adaptee are independent so that they are loosely coupled.

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

      right, I am thinking the same. We can also do it with simple inheritance and new keyword(I commented my solution here regarding kudvenkat). Now I am confused why do we need adapter design pattern and where do we use it.

  • @voidydude
    @voidydude 5 років тому +4

    adaptor pattern is used to connect to interfaces that are not compatible - this example does not show it :( - It shows haw a client can get the employees in JSON using NewtonSoft lib

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

    Excellent way. Liked very much

  • @manishkumargautam8224
    @manishkumargautam8224 5 років тому +3

    Hi Venkat Sir, Hope you read this message. I am watching this 17th video of design pattern series by hoping that Kudvenkat series are the best to understand pattern which is considered as the base of .NET Programming. But seriously, I don't like the way that Avish has explained in all the design pattern(I am talking about the diagram or the Representational diagram on pattern that has been used has some kind of disconnection in the video as well as the auto-implemented code in every video which makes the topic disconnected as the video is short now). I feel like I am in a huge mess now. I would like if you could build a brief video on the same in your way. I am saying this because the way you taught makes me understand the topic easily as it gives a way to connect those with real scenarios.

  • @leejin321
    @leejin321 4 роки тому +6

    Nice video! but it is slightly hard to look for the previous/next tutorial video. It will be nice to have a playlist. Thank you

  • @RahulSingh-gy1xl
    @RahulSingh-gy1xl 6 років тому

    At 4:00 can you please provide the complete line no. 39....???

  • @HimalayaGarg
    @HimalayaGarg 6 років тому +4

    Great explanation with a perfect example...

  • @raghavendranr8627
    @raghavendranr8627 5 років тому +1

    In this case, existing clients who expect xml doesn't work, correct?

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

    Nice video and explanation.

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

    Simply explained a great thing .. Thank you!!!

  • @alexanderagyapong2328
    @alexanderagyapong2328 6 років тому +2

    Very clear and concise. Excellent!

  • @kanishmishra4019
    @kanishmishra4019 6 років тому +2

    Hello sir. I have a query regarding this tutorial. what's the use of IEmployee interface because we can achieve same result without using IEmployee interface. Please clear my doubt.

    • @rahulshinde6070
      @rahulshinde6070 6 років тому +1

      I have same doubt

    • @rameshr7958
      @rameshr7958 6 років тому

      Hi Kanish, It's contract for client,client should call the methods using IEmployee interface. We need to make sure at any point of time to implement all the methods for IEmployee interface,we are not going to change existing clasees.

    • @HimalayaGarg
      @HimalayaGarg 6 років тому +3

      Using interface at client will allow to add more adapters if needed in future. We should never use concrete implementation at client.

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

    Hi sir, Do u have an example code snippet for point2 mentioned under Implementation Guidelines for adapter pattern
    Point2: We need to work through a seperate adapter that adapts the interface of an existing class without changing it…

  • @RahulSingh-gy1xl
    @RahulSingh-gy1xl 6 років тому

    "ArrayOfEmployee" How this name was attached to the final JSON string...?????
    where we have given this name...???

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

    I have one doubt. What if your method is not a virtual method. Inheriting from EmployerManager looking bit impractical

  • @kivikall
    @kivikall 5 років тому

    I have to say. All videos I found online and all articles I google just doesn't explain this very clearly (or the way that is good for me personally). So I did something desperate. I actually read that Adapter chapter from GoF book. First three pages and it was all clear. So if you find this hard to understand after hours of watching / googling then maybe that book can help you too! PS. Obviously this comment is not for the author of the video but for future viewers. And I'm not saying video is necessarily bad, I just find book and its example much easier to comprehend.

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

    Hi,
    Very well explained, I have a doubt though. Here, the return type of GetAllEmployees function of both Adaptee and Adapter is string. Will this work if adapter needs a different return type, let's say integer ?

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

      It is not necessary to override the function and return same String type. One can have a new method in Adapter Class that accepts the String from GetAllEmployees as input and returns an Integer. The idea is to not disturb the existing Adaptee class.

  • @veerababubonthu927
    @veerababubonthu927 5 років тому

    Great explanation with a perfect example

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

    Nice

  • @DG-wc8iz
    @DG-wc8iz 4 роки тому

    Is it adapter pattern 🤔 it does not fit the definition 🙄

  • @CoReeYe
    @CoReeYe 5 років тому

    EmployeeManager should also inherit from IEmployee interface.

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

      EmployeeManager is existing class and idea behind adapter design pattern is allow to access without modifying existing method

  • @mindawakening3873
    @mindawakening3873 5 років тому

    Thank you!

  • @sailutummuru7343
    @sailutummuru7343 7 років тому +6

    Examples are very tough for understanding

    • @sonulohani
      @sonulohani 5 років тому

      It will be easy if you use it in real project. Eventually you will find the need of this design pattern.

  • @jeewanmaharjan2712
    @jeewanmaharjan2712 7 років тому +3

    HAPPY NEW YEAR .GOOD TO SEE YOU IN 2018.

    • @avishmsd1651
      @avishmsd1651 7 років тому

      Thank you and we wish you the same.

  • @juhandvan
    @juhandvan 7 років тому

    What script is this? Java | C | C++ or something else .

  • @cindy3661
    @cindy3661 4 роки тому +1

    Iemploy is redudant here.

  • @alinawaz4034
    @alinawaz4034 7 років тому

    Console.Writeline("Happy New Year");

    • @avishmsd1651
      @avishmsd1651 7 років тому

      Thank you so much and we wish you the same.

  • @rvnl0rd
    @rvnl0rd 5 років тому +2

    I really miss Venkat's approach. This tutorial by Avish must be extremely confusing, especially for new people. You are not actually adapting the `Employee` at all, but rather the `EmployeeManager`.
    Here is updated code without the confusion:
    pastebin.com/1fGxS6tu

  • @prarthanassounds8410
    @prarthanassounds8410 7 років тому

    Happy New Year

    • @avishmsd1651
      @avishmsd1651 7 років тому

      Thank you and we wish you the same.

  • @peterl1699
    @peterl1699 7 років тому

    @Phong Phung c#

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

    Not very clear