What this book covers
Chapter 1, Introduction to Design Patterns, goes through the basics of object-oriented programming and discusses object-oriented design principles in detail. This chapter gives a brief introduction to the concept of design patterns so that you will be able to appreciate the context and application of design patterns in software development.
Chapter 2, The Singleton Design Pattern, covers one of the simplest and well-known Creational design patterns used in application development—the Singleton design pattern. The different ways in which we can create a Singleton pattern in Python are also covered in this chapter along with examples. This chapter also covers the Monostate (or Borg) design pattern, which is a variant of the Singleton design pattern.
Chapter 3, The Factory Pattern – Building Factories to Create Objects, discusses another creational pattern, the Factory pattern. You will also learn about the Factory Method pattern and Abstract Factory pattern with a UML diagram, real-world scenarios, and Python v3.5 implementations.
Chapter 4, The Façade Pattern – Being Adaptive with Façade, shows you another type of design pattern, the Structural design pattern. We will be introduced to the concept of Façade and learn how it is applicable to software design with the help of the Façade design pattern. You'll also learn its implementation with a sample Python application using a real-world scenario.
Chapter 5, The Proxy Pattern – Controlling Object Access, deals with the Proxy pattern that falls into the category of Structural design patterns. We will be introduced to the Proxy as a concept and discuss the design pattern and see how it is used in software application development. You'll also learn about the different variants of the Proxy pattern—Virtual Proxy, Smart Proxy, Remote Proxy, and Protective Proxy.
Chapter 6, The Observer Pattern – Keeping Objects in the Know, talks about the third type of design pattern—the behavioral design pattern. We will be introduced to the Observer design pattern with examples. In this chapter, you'll learn how to implement the Push and Pull models of the Observer pattern and the principles of loose coupling. We'll also see how this pattern is critical when it comes to applying it to cloud applications and distributed systems.
Chapter 7, The Command Pattern – Encapsulating Invocation, tells you about the Command design pattern. We will be introduced to the Command design pattern and discuss how it is used in software application development with a real-world scenario and Python implementation. We will also study two main aspects of the Command pattern—an implementation of redo/rollback operations and asynchronous task execution.
Chapter 8, The Template Method Pattern – Encapsulating Algorithm, discusses the Template design pattern. Like the Command pattern, the Template pattern falls into the category of Behavioral patterns. Here, we discuss the Template method pattern, and you will learn about Hooks with an implementation. We'll also cover the Hollywood principle that helps us appreciate this pattern better.
Chapter 9, Model-View-Controller – Compound Patterns, talks about Compound patterns. We will be introduced to the Model-View-Controller design pattern and discuss how it is used in software application development. MVC is easily one of the most used design patterns; in fact, many Python frameworks are based on this principle. You will learn about the details of MVC implementation with an example application written in Python Tornado (a framework used by Facebook).
Chapter 10, The State Design Pattern, introduces you to the State design pattern, which falls into the category of Behavioral patterns just like the Command or Template design patterns. We will discuss how it is used in software application development.
Chapter 11, AntiPatterns, tells you about AntiPatterns—what we shouldn't do as architects or software engineers.