We can use Bridge design pattern to detach the implementation from
the abstraction.
Bridge is mainly used for separation of concern in design. We can
create an implementation and store it in the interface, which is an
abstraction. Where as specific implementation of other features can
be done in concrete classes that implement the interface.
Often Bridge design pattern is implemented by using Adapter
pattern.
E.g. we have Shape interface. We want to make Square and Circle
shapes. But further we want to make RedSquare, BlackSquare
shapes and GreenCircle, WhiteCircle shapes. In this case rather
than creating one hierarchy of all the shapes, we separate the Color
concern from Shape hierarchy.
So we create two hierarchies. One is Shape to Square and Shape to
Circle hierarchy. Another one is Color to Red, Black, Green, White
hierarchy. In this way we can create multiple types of shapes with
multiple colors with Bridge design pattern.