Bridge Pattern and Abstract Factory Pattern
Both the bridge pattern and the abstract factory pattern decouple two families of related objects. The following is a list of differences between them:
- In the bridge pattern, the first family is an abstraction (a class that relies on abstract operations); the second is its implementations. Both can vary independently.
- In the abstract factory pattern, the first family is multiple families; the second is an interface for creating families of related or dependent objects without specifying their concrete classes.
- Comparing with the first families. In the bridge pattern, the first family is an abstraction. In the abstract factory pattern, the first family is multiple abstractions (families) in parallel.
- Comparing with the second families. In the bridge pattern, the second family is used as the implementations or a part of implementations (that can vary) of the first family. In the abstraction factory pattern, the second family is used to create objects from the first family. Normally one object from one abstraction.
- Bridge pattern is a structural pattern; abstract factory pattern is a creational pattern.
I wish to have better descriptions for their distinctions.