What is the difference between facade and mediator design pattern. I want understand which design pattern to choose between these two in which scenario. I was going through
The facade exposes existing functionality and the mediator adds to the existing functionality.
If you look at the facade example, you will see that you are not adding any new functionality, just giving the current objects a new perspective. For example, Circle already exists and you are just abstracting off circle, using the method drawCircle.
If you look at your mediator class, you see that the method handle()
provides additional functionality by checking the state. If you were to take out the conditions, you would have a facade pattern, since the additional functionality is gone.