Is the bridge pattern the same as the vendor pattern?
3 answers
Maybe the difference is that the vendor pattern could potentially encapsulate many bridges?
I also ask myself the same question and can hardly see the difference.
I see the vendor template as the main strategy template.
A question that can help and clear my confusion
When do you use the bridge pattern? How is this different from the adapter pattern?
IE yes, they are similar in the examples, but their purpose is different.
+1
a source to share
Not familiar with vendor pattern. The purpose of the Bridge pattern is to decouple abstractions from their respective implementations. Simplified code for example:
class Abstraction
{
IBridge _bridge;
public Abstraction(IBridge implementation) { _bridge=implementation; }
public DoStuff() { _bridge.DoStuff(); }
}
interface IBridge
{
void DoStuff();
}
class BridgeA : IBridge
{
void DoStuff() {...}
}
class BridgeB : IBridge
{
void DoStuff() {...}
}
0
a source to share