Learning Python Design Patterns - Second Edition

Leverage the power of Python design patterns to solve real-world problems in software architecture and design

Learning Python Design Patterns - Second Edition

This ebook is included in a Mapt subscription
Chetan Giridhar

1 customer reviews
Leverage the power of Python design patterns to solve real-world problems in software architecture and design
$0.00
$16.00
$39.99
$29.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785888038
Paperback164 pages

Book Description

With the increasing focus on optimized software architecture and design it is important that software architects think about optimizations in object creation, code structure, and interaction between objects at the architecture or design level. This makes sure that the cost of software maintenance is low and code can be easily reused or is adaptable to change. The key to this is reusability and low maintenance in design patterns.

Building on the success of the previous edition, Learning Python Design Patterns, Second Edition will help you implement real-world scenarios with Python’s latest release, Python v3.5.

We start by introducing design patterns from the Python perspective. As you progress through the book, you will learn about Singleton patterns, Factory patterns, and Façade patterns in detail. After this, we’ll look at how to control object access with proxy patterns. It also covers observer patterns, command patterns, and compound patterns.

By the end of the book, you will have enhanced your professional abilities in software architecture, design, and development.

Table of Contents

Chapter 1: Introduction to Design Patterns
Understanding object-oriented programming
Major aspects of object-oriented programming
Object-oriented design principles
The concept of design patterns
Patterns for dynamic languages
Classifying patterns
Summary
Chapter 2: The Singleton Design Pattern
Understanding the Singleton design pattern
Lazy instantiation in the Singleton pattern
Module-level Singletons
The Monostate Singleton pattern
Singletons and metaclasses
A real-world scenario – the Singleton pattern, part 1
A real-world scenario – the Singleton pattern, part 2
Drawbacks of the Singleton pattern
Summary
Chapter 3: The Factory Pattern – Building Factories to Create Objects
Understanding the Factory pattern
The Simple Factory pattern
The Factory Method pattern
The Abstract Factory pattern
The Factory method versus Abstract Factory method
Summary
Chapter 4: The Façade Pattern – Being Adaptive with Façade
Understanding Structural design patterns
Understanding the Façade design pattern
A UML class diagram
Implementing the Façade pattern in the real world
The principle of least knowledge
Frequently asked questions
Summary
Chapter 5: The Proxy Pattern – Controlling Object Access
Understanding the Proxy design pattern
A UML class diagram for the Proxy pattern
Understanding different types of Proxies
The Proxy pattern in the real world
Advantages of the Proxy pattern
Comparing the Façade and Proxy patterns
Frequently asked questions
Summary
Chapter 6: The Observer Pattern – Keeping Objects in the Know
Introducing Behavioral patterns
Understanding the Observer design pattern
The Observer pattern in the real world
The Observer pattern methods
Loose coupling and the Observer pattern
The Observer pattern – advantages and disadvantages
Frequently asked questions
Summary
Chapter 7: The Command Pattern – Encapsulating Invocation
Introducing the Command pattern
Understanding the Command design pattern
Implementing the Command pattern in the real world
Advantages and disadvantages of Command patterns
Frequently asked questions
Summary
Chapter 8: The Template Method Pattern – Encapsulating Algorithm
Defining the Template Method pattern
The Template Method pattern in the real world
The Template Method pattern – hooks
The Hollywood principle and the Template Method
The advantages and disadvantages of the Template Method pattern
Frequently asked questions
Summary
Chapter 9: Model-View-Controller – Compound Patterns
An introduction to Compound patterns
The Model-View-Controller pattern
A UML class diagram for the MVC design pattern
The MVC pattern in the real world
Benefits of the MVC pattern
Frequently asked questions
Summary
Chapter 10: The State Design Pattern
Defining the State design pattern
A simple example of the State design pattern
Advantages/disadvantages of the State pattern
Summary
Chapter 11: AntiPatterns
An introduction to AntiPatterns
Software development AntiPatterns
Software architecture AntiPatterns
Summary

What You Will Learn

  • Enhance your skills to create better software architecture
  • Understand proven solutions to commonly occurring design issues
  • Explore the design principles that form the basis of software design, such as loose coupling, the Hollywood principle and the Open Close principle among others
  • Delve into the object-oriented programming concepts and find out how they are used in software applications
  • Develop an understanding of Creational Design Patterns and the different object creation methods that help you solve issues in software development
  • Use Structural Design Patterns and find out how objects and classes interact to build larger applications
  • Focus on the interaction between objects with the command and observer patterns
  • Improve the productivity and code base of your application using Python design patterns

Authors

Table of Contents

Chapter 1: Introduction to Design Patterns
Understanding object-oriented programming
Major aspects of object-oriented programming
Object-oriented design principles
The concept of design patterns
Patterns for dynamic languages
Classifying patterns
Summary
Chapter 2: The Singleton Design Pattern
Understanding the Singleton design pattern
Lazy instantiation in the Singleton pattern
Module-level Singletons
The Monostate Singleton pattern
Singletons and metaclasses
A real-world scenario – the Singleton pattern, part 1
A real-world scenario – the Singleton pattern, part 2
Drawbacks of the Singleton pattern
Summary
Chapter 3: The Factory Pattern – Building Factories to Create Objects
Understanding the Factory pattern
The Simple Factory pattern
The Factory Method pattern
The Abstract Factory pattern
The Factory method versus Abstract Factory method
Summary
Chapter 4: The Façade Pattern – Being Adaptive with Façade
Understanding Structural design patterns
Understanding the Façade design pattern
A UML class diagram
Implementing the Façade pattern in the real world
The principle of least knowledge
Frequently asked questions
Summary
Chapter 5: The Proxy Pattern – Controlling Object Access
Understanding the Proxy design pattern
A UML class diagram for the Proxy pattern
Understanding different types of Proxies
The Proxy pattern in the real world
Advantages of the Proxy pattern
Comparing the Façade and Proxy patterns
Frequently asked questions
Summary
Chapter 6: The Observer Pattern – Keeping Objects in the Know
Introducing Behavioral patterns
Understanding the Observer design pattern
The Observer pattern in the real world
The Observer pattern methods
Loose coupling and the Observer pattern
The Observer pattern – advantages and disadvantages
Frequently asked questions
Summary
Chapter 7: The Command Pattern – Encapsulating Invocation
Introducing the Command pattern
Understanding the Command design pattern
Implementing the Command pattern in the real world
Advantages and disadvantages of Command patterns
Frequently asked questions
Summary
Chapter 8: The Template Method Pattern – Encapsulating Algorithm
Defining the Template Method pattern
The Template Method pattern in the real world
The Template Method pattern – hooks
The Hollywood principle and the Template Method
The advantages and disadvantages of the Template Method pattern
Frequently asked questions
Summary
Chapter 9: Model-View-Controller – Compound Patterns
An introduction to Compound patterns
The Model-View-Controller pattern
A UML class diagram for the MVC design pattern
The MVC pattern in the real world
Benefits of the MVC pattern
Frequently asked questions
Summary
Chapter 10: The State Design Pattern
Defining the State design pattern
A simple example of the State design pattern
Advantages/disadvantages of the State pattern
Summary
Chapter 11: AntiPatterns
An introduction to AntiPatterns
Software development AntiPatterns
Software architecture AntiPatterns
Summary

Book Details

ISBN 139781785888038
Paperback164 pages
Read More
From 1 reviews

Read More Reviews