The Bridge pattern allows the programmer to decouple an abstraction from its implementation so that the two can vary independently. This important design pattern is used in many professional software applications since it’s debut in 1994. For this review of the design pattern, I’ve used varying datatypes, which makes use of multiple spell checking libraries in PHP, each of which can vary independently from each other. I’ve used some PHP code to describe the behaviours underlying the ideas in the pattern. As shown below, this pattern does allow implementations to vary independently from one another.
Implementation Code
Spell Checker Interface
Enchant Implementation
pSpell Implementation
DataType Abstract Class
CSV Class
HTML Class
Text Class