I am trying to learn Bridge pattern. So far every page I have referred to, has one abstraction as interface and other as abstract class. Abstract class holds a reference to interface. I was wondering, if I replace abstract class with interface and have a reference of second interface in each impl class, would that still make sense in context of Bridge pattern.
            Asked
            
        
        
            Active
            
        
            Viewed 98 times
        
    1 Answers
0
            If you move the composition relationship from the abstract class down to its implementation, then you have an Adapter rather than a Bridge.
If you have multiple Adapters all composing a common interface, then it probably makes sense to pull that composition relationship up to an abstraction, i.e. a Bridge again.
See also: Adapter vs Bridge
 
    
    
        jaco0646
        
- 15,303
- 7
- 59
- 83
