Contents
- 1 What is the key strategy in the Abstract Factory?
- 2 What problem is the bridge trying to solve?
- 3 What is the difference between abstract factory and factory pattern?
- 4 What is the difference between abstract factory and factory method?
- 5 What kind of pattern is abstract factory design?
- 6 When to use abstract factory instead of facade?
What is the key strategy in the Abstract Factory?
Abstract Factory Pattern says that just define an interface or abstract class for creating families of related (or dependent) objects but without specifying their concrete sub-classes. That means Abstract Factory lets a class returns a factory of classes.
What problem is the bridge trying to solve?
This problem occurs because we’re trying to extend the shape classes in two independent dimensions: by form and by color. That’s a very common issue with class inheritance. The Bridge pattern attempts to solve this problem by switching from inheritance to the object composition.
What is the difference between abstract factory and factory pattern?
The main difference between a “factory method” and an “abstract factory” is that the factory method is a single method, and an abstract factory is an object. The factory method is just a method, it can be overridden in a subclass, whereas the abstract factory is an object that has multiple factory methods on it.
How does bridge pattern work?
Bridge pattern decouple an abstraction from its implementation so that the two can vary independently. It is used mainly for implementing platform independence feature. It adds one more method level redirection to achieve the objective.
What is the difference between factory pattern and abstract factory pattern?
What is the difference between abstract factory and factory method?
What kind of pattern is abstract factory design?
Abstract Factory design pattern is one of the Creational pattern. Abstract Factory pattern is almost similar to Factory Pattern is considered as another layer of abstraction over factory pattern. Abstract Factory patterns work around a super-factory which creates other factories.
When to use abstract factory instead of facade?
Abstract Factory can serve as an alternative to Facade when you only want to hide the way the subsystem objects are created from the client code. You can use Abstract Factory along with Bridge. This pairing is useful when some abstractions defined by Bridge can only work with specific implementations.
What kind of interfaces does abstract factory use?
Client : Uses only interfaces declared by AbstractFactory and AbstractProduct classes. Abstract Factory provides interfaces for creating families of related or dependent objects without specifying their concrete classes.
How are concrete factories implemented in abstract factory?
Concrete Factories implement creation methods of the abstract factory. Each concrete factory corresponds to a specific variant of products and creates only those product variants. Although concrete factories instantiate concrete products, signatures of their creation methods must return corresponding abstract products.