Learning Python Design Patterns

Written for intermediate Python programmers, this excellent tutorial will help streamline your work through the use of Design Patterns. You’ll learn through example and clear explanations to expand your know-how and speed up your output.
Preview in Mapt

Learning Python Design Patterns

Gennadiy Zlobin

Written for intermediate Python programmers, this excellent tutorial will help streamline your work through the use of Design Patterns. You’ll learn through example and clear explanations to expand your know-how and speed up your output.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.50
RRP $14.99
Save 29%
Print + eBook
$24.99
RRP $24.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.50
$24.99
$29.99 p/m after trial
RRP $14.99
RRP $24.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Learning Python Design Patterns Book Cover
Learning Python Design Patterns
$ 14.99
$ 10.50
Scala Design Patterns - Second Edition Book Cover
Scala Design Patterns - Second Edition
$ 35.99
$ 25.20
Buy 2 for $28.00
Save $22.98
Add to Cart

Book Details

ISBN 139781783283378
Paperback100 pages

Book Description

Design pattern is a well-known approach to solve some specific problems which each software developer comes across during his work. Design patterns capture higher-level constructs that commonly appear in programs. If you know how to implement the design pattern in one language, typically you will be able to port and use it in another object-oriented programming language.

The choice of implementation language affects the use of design patterns. Naturally, some languages are more applicable for certain tasks than others. Each language has its own set of strengths and weaknesses. In this book, we introduce some of the better known design patterns in Python. You will learn when and how to use the design patterns, and implement a real-world example which you can run and examine by yourself.

You will start with one of the most popular software architecture patterns which is the Model- View-Controller pattern. Then you will move on to learn about two creational design patterns which are Singleton and Factory, and two structural patterns which are Facade and Proxy. Finally, the book also explains three behavioural patterns which are Command, Observer, and Template.

Table of Contents

Chapter 1: Model-View-Controller
Model – the knowledge of the application
View – the appearance of knowledge
Controller – the glue between the model and view
Benefits of using the MVC
Implementation in Python
Summary
Chapter 2: Creating Only One Object with the Singleton Pattern
A module-level singleton
A classic singleton
The borg singleton
Implementation in Python
Summary
Chapter 3: Building Factories to Create Objects
The Factory Method
Abstract Factory
Abstract Factory versus Factory Method
Summary
Chapter 4: The Facade Design Pattern
The Facade design pattern
Facades in Python's standard library
Implementation in Python
Summary
Chapter 5: Facilitating Object Communication with Proxy and Observer Patterns
Proxy design pattern
Observer design pattern
Summary
Chapter 6: Encapsulating Calls with the Command Pattern
Command Pattern terminology
Use cases of the Command design pattern
Advantages and disadvantages of the Command design pattern
Implementation in Python
Summary
Chapter 7: Redefining Algorithms with the Template Method
The Template Method design pattern
Implementation in Python
Summary

What You Will Learn

  • Create different implementations of the same algorithm with the least modifications
  • Implement the publisher-subscriber pattern
  • Create an object when only one instance of it is needed
  • Create a simple interface using the Facade design pattern
  • Increase the functionality while leaving the interface unchanged

Authors

Table of Contents

Chapter 1: Model-View-Controller
Model – the knowledge of the application
View – the appearance of knowledge
Controller – the glue between the model and view
Benefits of using the MVC
Implementation in Python
Summary
Chapter 2: Creating Only One Object with the Singleton Pattern
A module-level singleton
A classic singleton
The borg singleton
Implementation in Python
Summary
Chapter 3: Building Factories to Create Objects
The Factory Method
Abstract Factory
Abstract Factory versus Factory Method
Summary
Chapter 4: The Facade Design Pattern
The Facade design pattern
Facades in Python's standard library
Implementation in Python
Summary
Chapter 5: Facilitating Object Communication with Proxy and Observer Patterns
Proxy design pattern
Observer design pattern
Summary
Chapter 6: Encapsulating Calls with the Command Pattern
Command Pattern terminology
Use cases of the Command design pattern
Advantages and disadvantages of the Command design pattern
Implementation in Python
Summary
Chapter 7: Redefining Algorithms with the Template Method
The Template Method design pattern
Implementation in Python
Summary

Book Details

ISBN 139781783283378
Paperback100 pages
Read More

Read More Reviews

Recommended for You

Expert Python Programming - Second Edition Book Cover
Expert Python Programming - Second Edition
$ 35.99
$ 25.20
Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Python 3 Object-oriented Programming - Second Edition Book Cover
Python 3 Object-oriented Programming - Second Edition
$ 39.99
$ 28.00
Learning Python Book Cover
Learning Python
$ 39.99
$ 28.00
Python Unlocked Book Cover
Python Unlocked
$ 31.99
$ 22.40
Mastering Python Design Patterns Book Cover
Mastering Python Design Patterns
$ 26.99
$ 18.90