Three things called a factory
transcript
Everyone says the word factory. A factory here, a factory there. But it can mean three different things. Interviewers notice which one you mean. Say it out loud.
First, a simple factory. A function or a table, name in, object out. It is not one of the 23 patterns. It is an idiom. In Python and JavaScript, it is often all you need.
Second, Factory Method. A base class calls one method to get its product. A subclass overrides that method, and decides which class to create. The base class never learns which.
Third, Abstract Factory. One object with several create methods. It hands back a whole family: payment, tax and invoice, all matching. Swap the kit, and you swap all three.
One product, chosen by a name: a simple factory. One product, chosen by a subclass: Factory Method. Several products that must match: Abstract Factory.
A registry is usually enough. Name what you built. Reach for the book's patterns only when the shape fits.
Full breakdown in the lecture.