Two Factory Patterns Flashcards
(9 cards)
1
Q
Factory Class
A
A class that builds and returns object(s).
2
Q
Product
A
The object being created.
3
Q
Abstract Product
A
A base class/interface for all products.
4
Q
Concrete Product
A
The actual implementations of the product.
5
Q
Client (Factory Pattern)
A
Calls the code that uses the factory to get objects.
6
Q
Abstract Creator
A
The superclass with the factory method.
7
Q
Concrete Creator
A
Subclass that implements the factory method.
8
Q
Simple Factory Pattern
A
- A class that creates different products from the same family.
- Not a formal design pattern (technically), but widely used.
9
Q
Factory Method Pattern
A
- Each subclass (creator) defines how to create an object.
- Supports multiple families of products.
- A formal design pattern.