I am confused on how should I explain the bridge design pattern in java. Based on GoF's definition:
The bridge pattern is to decouple an abstraction from its implementation so that the two can vary independently.
However, I thought that we do abstractions (use of abstract classes and interfaces) to decouple the implementation from the rest of the code (since we are just declaring interfaces or abstract classes instead of the implementing class). Now, I think I am wrong on how I understood abstraction because of the bridge pattern.
What exactly is abstraction and how is it decoupled from implementation in the bridge pattern?
Aucun commentaire:
Enregistrer un commentaire