Summary
In this chapter, you learned about the Factory design pattern and the context in which it's used. We understood the basics of the Factory, and how it is effectively used in software architecture.
We looked at Simple Factory, where an appropriate instance is created at runtime based on the type of the argument passed by the client.
We also discussed the Factory method pattern, which is a variation of Simple Factory. In this pattern, we defined an interface to create objects, but the creation of objects is deferred to the subclass.
We went on to explore the Abstract Factory method, which provides an interface to create families of related objects without specifying the concrete class.
We also worked out a real-world Python implementation for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access