Proxy vs Adapter vs Facade Pattern | Code Walks 012

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

КОМЕНТАРІ • 19

  • @f-alzahraa_Ahmed
    @f-alzahraa_Ahmed 2 роки тому +1

    the artical link is not working anymore, will you please check it and provide another

  • @AntonioSeprano
    @AntonioSeprano 7 років тому +5

    Nice video. However, the main purpose of the Façade pattern could be thought of as simplifying the interaction between a client and a set of complex objects

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

      This video was made two years before he made his Design Pattern series. He got it right on those.

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

    So what about the difference between decorator and proxy? In the decorator video, you've announced discussing it (aside adapter and facade) :)

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

      Decorator is about inheritance. Decorators allow to wrap around object any number of times with different decorators. Basically it’s multi-inheritance.

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

    Thanks for this informative video.

  • @webdev3885
    @webdev3885 4 роки тому

    Amazing video. However, it's been a while since you upload the last video.

  • @Manwithsteelnerves
    @Manwithsteelnerves 4 роки тому

    Thats ok! But why he is explaining while driving O_o :|

  • @iGotTheGift
    @iGotTheGift 8 років тому +2

    A facade pattern just abstracts the functionality of the method .. it's like the simplest thing ever.

    • @ChristopherOkhravi
      @ChristopherOkhravi  8 років тому +2

      Agreed. I over-complicated it. I now usually use the word in the vein you describe. Thanks for the comment! However I do believe there is value in the idea of communicating deprecation of the facadee. I mean if we are creating a facade, there must be a reason for not using the facadee directly. If it's a facade over an external library it doesn't necessarily signal deprecation as it could simply exist to encapsulate the external dependency. But again, we are communicating to other devs that one should not use the facadee directly. Do you agree?

    • @todorinskiz
      @todorinskiz 8 років тому +1

      From what I understand from Façade so far, is that it abstracts a specific function or implements specific business logic, while facilitating the required dependencies and information (can be referred to as context). This sounds like you are providing a proxy to specific object (or functionality) but we could argue that by implementing business logic at that lair would possibly change behavior, making it comparable to the adapter pattern. Am I getting this right? If so, then this pattern really smells and highlights the need for redesign of the functionality exposed through the facade.

    • @ChristopherOkhravi
      @ChristopherOkhravi  8 років тому +2

      Hmm.. could you expand on the comment of it being smelly? Having thought about this a bit more after making this video, one example where I think Facades makes perfect sense is when e.g. "wrapping" external dependencies (i.e. APIs). So instead of scattering interactions with an external dependency around the application we wrap the dependency in a facade and simply interact with the facade. This would (in line with what's mentioned in the video) both a) potentially change the interface of the facadee, and b) imply to other developers that one should not interact directly with the facadee.

    • @todorinskiz
      @todorinskiz 8 років тому +1

      Okay, this example was more clear :)

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

      Right. At work I created a RestApiFacade which just wraps the RestSharp library and provides a MUCH smaller and simpler set of functions for doing REST calls. Since the RestSharp library is pretty big, we don't need most of its functionality, so there's no need to confuse the developers on my team with too much information that they don't need.
      It also has the benefit of completely separating a 3rd party library from our code, so in the future we could replace RestSharp with another library inside the RestApiFacade, and none of the other code would be the wiser since it doesn't care how RestApiFacade works, it just uses it.