What is the difference between the bridge pattern and the strategy pattern?

Semantics. From wikipedia: The UML class diagram for the Strategy pattern is the same as the diagram for the Bridge pattern. However, these two design patterns aren’t the same in their intent. While the Strategy pattern is meant for behavior, the Bridge pattern is meant for structure. The coupling between the context and the strategies … Read more

Difference between Bridge pattern and Adapter pattern

“Adapter makes things work after they’re designed; Bridge makes them work before they are. [GoF, p219]” Effectively, the Adapter pattern is useful when you have existing code, be it third party, or in-house, but out of your control, or otherwise not changeable to quite meet the interface you need it to. For instance, we have … Read more

How do the Proxy, Decorator, Adapter, and Bridge Patterns differ?

Proxy, Decorator, Adapter, and Bridge are all variations on “wrapping” a class. But their uses are different. Proxy could be used when you want to lazy-instantiate an object, or hide the fact that you’re calling a remote service, or control access to the object. Decorator is also called “Smart Proxy.” This is used when you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)