Design patterns: Factory pattern

Here’s an interesting question. If your children are identical twins and you are just introducing them to someone, how do you help your guests distinguish between your twins?
You use the factory design pattern of course!

Let’s use this post to learn one of the most commonly used design patterns in the world of object-oriented programming. Instead of compelling you remember the names of classes, the factory pattern gives you a class based on something you know about that class. Let’s dive in to see what I mean. Continue reading “Design patterns: Factory pattern”