Hi James,
Bridge basically separates 'abstraction' from 'implementation' and allows to interchange implementations (pls refer GOF).
I will try to explain with a real life example. Not the best ones but I hope you will get the picture.
We had a case where we were using 2 different RDBMSs (one for dev and one for uat/prod). So, we had
- 2 different Data Access Object implementations ('implementation' participant in Bridge),
- and a Service abstraction ('abstraction' participant in Bridge).
- The Service abstraction was further refined/extended as a)
JDBC Service and b) Indexed Service (for lucene based indexing).
Now comes the interesting part...
If you observed we could now change/switch the different abstractions and DAO implementations with a configuration change and use the differnt Services (JDBC or Indexing service) in different scenarios.
HTH.
Cheers