Amy Blankenship
Oct 28, 2022

--

In reality, the Singleton pattern is most often used to allow pretty much anyone in the neighborhood to touch all parts of the car at any time. It doesn't really have as much to do with having only one of them as with having that getInstance method that lets everyone conveniently access the car without asking anyone.

Then when someone takes their dog for a joyride and it craps on the backseat, good luck figuring out who it was! That's why Singleton is considered an anti pattern.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

Responses (1)