← Back to design patterns map
Design Pattern

Abstract Factory

Create families of related objects behind one common interface.

creational

Visual Diagram

DBFactory
-> MySQL connection + query
-> Mongo connection + query

When To Use

  • ->Switching database families without changing app code
  • ->Supporting multiple cloud providers
  • ->Creating related UI components for different platforms
Used in: TypeORM, Sequelize dialect system, cloud provider SDK wrappers
abstract-factory.js

Live Editor

Loading...

Output

Run code to see output...

Comments

Sign in to leave a comment. Your name and photo come from Google; nothing else is shared.

Loading comments...