The Bridge pattern decouples an abstraction from its implementation, enabling them to vary independently. The Bridge pattern is useful when a new version of software is brought out that will replace an existing version, but the older version must still run for its existing client base. The client code will not have to change, as it is conforming to a given abstraction, but the client will need to indicate which version it wants to use.
Consider the rolling out of a new version of the .NET Framework used to compile and run C# 3.0. You can have several versions of the Framework loaded on your computer at any time and can select which one to use by externally setting a path to it in the Windows operating system. Setting the path is the bridge between what applications want from the Framework and the actual version they will get. In Figure 2-6, you can see that there are five versions of the Framework loaded on my computer. Figure 2-7 shows that the one the system is being directed to is Version 3.5, which includes the C# 3.0 compiler.
Figure 2-6. Bridge pattern illustration (a)—environment Path variable set to Version 3.5
Figure 2-7. Bridge pattern illustration (b)—five versions of the .NET Framework loaded
Inheritance is a common way to specify different ...