Note: This content was generated by AI. I am working on this page to provide personal content of better quality.

Factory Method

Nota bene : This content was generated by AI. I am working on this page to provide personal content of better quality.

Define a creation interface and let subclasses choose the concrete type.

Intent

Decouple client code from concrete classes being instantiated.

Python example

Chargement…

Console output

Rendering WindowsButton Rendering HTMLButton

When to use

Framework code cannot know concrete types in advance.