A beginner’s take on The Abstract Factory

Photo by Lenny Kuhne on Unsplash

Simplest Definition

A way to free your class from having to create the objects it depends on.

The Problem

It is less motivating to study something if we don’t understand why that thing is important. That is why before getting into the what, let’s first understand the why. So the question to be answered first is: Why should a developer care about the Abstract Factory pattern?

The Solution

What if there was a way to allow our “Downloader” classes to simply ask for an object that performs downloads and have some other part of the system take care of selecting the right type, instantiating and providing it to the calling class?

Software developer. C# and Go. Enthusiast for gRPC and IoT. Also husband, father and believer in Christ. https://robwillup.com

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