The bridge design pattern is all about connecting components together through abstractions.
So what is the motivation for actually building a bridge in the first place.
Well a bridge prevents what is called a Cartesian product complexity explosion.
So for example let's suppose that you have some base class called thread Sheckler and then the thread
scheduler can be preemptive or co-operative and it can also run on Windows and Linux and you end up
with a two by two scenario so if you decide to implement four classes one for you know the preemptive
Windows Scheduler preventive Unix Shenhua and so on you end up with a two by two scenario and the breech
pattern is precisely the thing that actually avoids this whole entity explosion.
So instead of having something like this way you have if you look at the very bottom you have four distinct
classes what you can do is you can do it differently so you can depend on some sort of platform chinchilla
where there is some interface or something which is implemented by a unix shell ular and the windows
scheduler.
And you also inherit from either preemptive threat scheduler or Kopra the threat credulous so you don't
you don't rely on inheritance as much as an inheritance.
Plus aggregation.
So this is the typical implementation of the bridge we're going to look at anything quite so complicated
but essentially a bridge is a mechanism that decouples the interface or the hierarchy from the implementation
and both of these can be hierarchies but they don't have to engage in one big inheritance relationship.
In this case you can have some inheritance and also some aggregation or just keeping references to other
components.