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
Decorator is about inheritance. Decorators allow to wrap around object any number of times with different decorators. Basically it’s multi-inheritance.
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?
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.
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.
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.
the artical link is not working anymore, will you please check it and provide another
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
This video was made two years before he made his Design Pattern series. He got it right on those.
So what about the difference between decorator and proxy? In the decorator video, you've announced discussing it (aside adapter and facade) :)
Decorator is about inheritance. Decorators allow to wrap around object any number of times with different decorators. Basically it’s multi-inheritance.
Thanks for this informative video.
Amazing video. However, it's been a while since you upload the last video.
Thats ok! But why he is explaining while driving O_o :|
A facade pattern just abstracts the functionality of the method .. it's like the simplest thing ever.
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?
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.
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.
Okay, this example was more clear :)
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.