Below are the main difference between these 2 patterns.
Can adapt classes as well as sub classes since uses composition
More flexible since dynamic polymorphism can be used with composition
Can adapt classes or sub classes not both. As a result no need to re implement the entire adaptee
More efficient since class adapter acts as adapter and adaptee
Asked In: Many Interviews |