Next up is the final creational pattern I’m going to cover in this series.
It’s the prototype pattern…. it’s literally beyond simple, so let’s get going.
It’s the prototype pattern…. it’s literally beyond simple, so let’s get going.
However the builder pattern will not only create objects, but prepare them for your application too. The builder pattern actually uses the factory method pattern behind the scenes, but I’ll get onto that soon.
The purpose of any factory class, is to create and return instances of other classes, just like a real world factory creates products. There are two types of factory design patterns. One is called the factory method and the other is called an abstract factory. There is another not official pattern called simple factory. All are described in detail below. Let’s get going.
A multiton is almost exactly the same as a singleton, the one slight difference is a multiton can store multiple instances of itself. Contrary to a singleton, which can only store one instance of itself.