https://refactoring.guru/design-patterns/factory-method
- Provides an interface for creating objects in a supper class, but allows subclasses to alter the type of objects that will be created
- Creates an instance of several derived classes
- Use the Factory Method when you don’t know beforehand the exact types and dependencies of the objects your code should work with.
- Use the Factory Method when you want to provide users of your library or framework with a way to extend its internal components.
- Use the Factory Method when you want to save system resources by reusing existing objects instead of rebuilding them each time.
python main.py
python example.py