The bridge pattern is a powerful pattern that helps you isolate the objects that actually perform some work from their abstractions. This may help you achieve better testability of the abstractions by letting your tests provide a different implementation, so you can focus on testing the abstractions separately from their implementations.
In order to implement the bridge pattern successfully, you'll need to:
- Identify which abstractions need to be isolated from their implementations
- Refactor the Abstraction class in order to let the implementation be passed at runtime
- Ideally, add tests to ensure Abstraction is behaving as it should, without interference from the implementation