![]() That being said, use this concept as a stepping stone to understanding the factory method and the abstract factory. ![]() Just to reiterate, the simple factory is not considered a genuine pattern. This concrete factory doesn’t inherit from another abstraction layer. In contrast to the factory method or the abstract factory, the simple factory is made up of just one concrete factory. The simple factory is essentially a class that, based on a given input, returns objects of different types. You can read more about the terminology on Wikipedia. Many online resources portray the simple factory as the factory method pattern, which is wrong. Nevertheless, I’ve decided to write a blog post on this topic because I think the simple factory will give you a good intuition for understanding the proper factory patterns. Why is the Simple Factory a Pseudopattern?įirst of all, as I mentioned in the article on the factory method pattern, I use the prefix pseudo because the simple factory isn’t actually considered a pattern in the Gang of Four book. ![]() Check out the full list of covered patterns there. This post is part of the Design Patterns in Java Series. ![]() In this blog post, I’ll briefly describe the simple factory pseudopattern.
0 Comments
Leave a Reply. |