Search code examples
bridge

Bridge pattern and additional implementer types


Does bridge pattern (intent) allow to use additional implementer types in descendant abstractions? Or this approach violates smth? Or maybe it's a misuse of the pattern? Example:

enter image description here

Thanks in advance!


Solution

  • You've just used the bridge pattern twice. There's no problem with that.

    Even if you don't need to support more abstraction-style subclass of CAbstractionB, you should probably do this, because the Abstraction hierarchy is about the services provided and you don't want to confuse this by mixing in an implementation hierarchy at the leaves.