I am working through various patterns. One thing I am not clear about is how Bridge pattern differs from Facade? Both patterns have same (almost) functionality -- i.e., they translate information between two separate layers, and/or components.
Sometimes patterns have very similar UML diagrams but different intent. I'd use facade if I were building a set of services for other clients to use and I'd like to make a single, simplified API for them to use so I don't have to explain all the complicated objects I have. It's kind of a courtesy to my clients.
How would you see the motivation to write a bridge being different? I only ask because I haven't read Bridge recently enough to say myself.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
My understanding of bridge pattern is to horizontally separate interface (API) from implementation. For example, a contract, API, is defined for an application. The implementations can be different but as long as they fulfilled the contract, they can be plugged in either directly or indirectly via adapter.
Stan is right - the most important difference is in the intent. Facade is about how to interface to the outside of a component, Bridge is more about organizing its internal structure.
On the other hand, in my copy of the GoF book, the diagrams for Facade and Bridge look quite different, so I'm not sure what similarities you see...
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Jul 07, 2005
Your replies have clarified distinction between Bridge and Facade pattern. Though I still have to digest your replies.
Joined: Jul 07, 2005
Ilja, your URL take me to book description. Unfortunately I cannot read German (Danish ??).