Andrew Connell

Prefer Factories over Contructors

Brian Wilson has a good article why factories are better than contructors. He outlines a few reasons why:Constructors cannot be namedConstructors must return objectsConstructors must return single objectsConstructors must return objects of a specific typeGreat article and a quick read. » Prefer Factories to Constructors...

Brian Wilson has a good article why factories are better than contructors. He outlines a few reasons why:

  1. Constructors cannot be named
  2. Constructors must return objects
  3. Constructors must return single objects
  4. Constructors must return objects of a specific type

Great article and a quick read.

» Prefer Factories to Constructors

Andrew Connell
Founder & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.