Image for post
Image for post

The factory pattern is a way to create objects without worrying about how that object is created or what is needed, which allows loose coupling. This means we can ask our factory object to provide us a specific object and the factory will deal with constructing it. Of course, we have to setup our factory to do the creation first!

Here’s an example: you want to hire a new developer to work at your company. Now we may know what skills we are looking for, but what about work benefits and background checks? This is where we would ask the company’s hiring manager to sort things out. …

Ben Watts

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store