Once again about Bridge (in pictures)

    Once again, if the community allows, I will turn to the theme of the Bridge pattern, because the latest articles, in my opinion, explain it not as easily as necessary.

    The main idea: "We use the Bridge where you need to change not only the implementation, but also the abstraction . "

    One picture is worth 1000 words ...

    Spread the abstraction (API) and implementation into two different hierarchies and get the opportunity to manage them separately . Now the implementation is not tied to the interface, and we can create new abstractions (by extension), based on the methods of basic abstractions .

    All. I don’t understand what kilometer-long posts to plant here ...

    PS I took the explanation and picture from Head First Design Patterns

    Also popular now: