Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Python Design Patterns - Second Edition

You're reading from   Learning Python Design Patterns - Second Edition

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781785888038
Length 164 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Gennadiy Zlobin Gennadiy Zlobin
Author Profile Icon Gennadiy Zlobin
Gennadiy Zlobin
Chetan Giridhar Chetan Giridhar
Author Profile Icon Chetan Giridhar
Chetan Giridhar
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introduction to Design Patterns 2. The Singleton Design Pattern FREE CHAPTER 3. The Factory Pattern – Building Factories to Create Objects 4. The Façade Pattern – Being Adaptive with Façade 5. The Proxy Pattern – Controlling Object Access 6. The Observer Pattern – Keeping Objects in the Know 7. The Command Pattern – Encapsulating Invocation 8. The Template Method Pattern – Encapsulating Algorithm 9. Model-View-Controller – Compound Patterns 10. The State Design Pattern 11. AntiPatterns Index

Chapter 3. The Factory Pattern – Building Factories to Create Objects

In the previous chapter, you learned about Singleton design patterns—what they are and how they are used in the real world along with the Python implementation. The Singleton design pattern is one of the Creational design patterns. In this chapter, we move ahead and learn about another creational pattern, the Factory pattern.

The Factory pattern is arguably the most used design pattern. In this chapter, we will understand the concept of Factory and go through the Simple Factory pattern. You will then learn about the Factory method pattern and Abstract Factory pattern with a UML diagram, real-world scenarios, and Python v3.5 implementations. We'll also compare the Factory method and Abstract Factory method.

In this chapter, we will cover the following topics in brief:

  • Understanding the Simple Factory design pattern
  • Discussing the Factory method and Abstract Factory method and their differences
  • Implementing...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image