Transcript from the "Factory Pattern" Lesson
[00:01:15] I see there's an overflow here. Now, we will go into the prototype pattern a bit later, which actually shows that this pattern is not very memory efficient, maybe you should try to avoid it if you're actually creating a really large amount of objects. But we will cover that in the prototype pattern.
[00:01:35] So yeah, just to recap all it does is we just have a function that returns an object, that's the vector pattern, and that function is called a factory function. So when we look at the exercise here, you see that we have many books. We have Harry Potter, a Great Gatsby and all this stuff.
[00:01:51] And in index, I guess, yeah, we're logging all of those books. But in this case, so we create it, explicitly created all of these objects. So the exercise here is to create a factory function instead that returns a book, instead of having to write those books like this.