Jump to ratings and reviews
Rate this book

Mastering Python Design Patterns

Rate this book
Create various design patterns to master the art of solving problems using PythonAbout This BookSimplify design pattern implementation using the power of PythonEach pattern is accompanied with a real-world example demonstrating its key featuresThis is an easy-to-follow guide focusing on the practical aspects of Python design patternsWho This Book Is ForThis book is for Python programmers with an intermediate background and an interest in design patterns implemented in idiomatic Python. Programmers of other languages who are interested in Python can also benefit from this book, but it would be better if they first read some introductory materials that explain how things are done in Python.

What You Will LearnExplore Factory Method and Abstract Factory for object creationClone objects using the Prototype patternMake incompatible interfaces compatible using the Adapter patternSecure an interface using the Proxy patternChoose an algorithm dynamically using the Strategy patternExtend an object without subclassing using the Decorator patternKeep the logic decoupled from the UI using the MVC patternIn DetailPython is an object-oriented, scripting language that is used in wide range of categories. In software engineering, a design pattern is a recommended solution to a software design problem. Although not new, design patterns remain one of the hottest topics in software engineering and they come as a ready reference for software developers to solve the common problems they face at work.

This book will take you through each and every design pattern explained with the help of real-world examples. The aim of the book is to introduce more low-level detail and concepts on how to write Pythonic code, not just focusing on common solutions as implemented in Java and C++. It includes small sections on troubleshooting, best practices, system architecture, and its design aspects. With the help of this book, you will be able to understand Python design pattern concepts and the framework, as well as issues and their resolution. You'll focus on all 16 design patterns that are used to solve everyday problems.

214 pages, Kindle Edition

First published January 28, 2015

7 people are currently reading
95 people want to read

About the author

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
7 (16%)
4 stars
21 (48%)
3 stars
8 (18%)
2 stars
3 (6%)
1 star
4 (9%)
Displaying 1 - 8 of 8 reviews
1 review
October 7, 2017
I started and was already quite disappointed. The code isn't very pythonic and not PEP8. And the explanations are plain bad. I'm still at the beginning though (just started chapter 4). But there are places where I could disagree. How is adapter a way to make "two incompatible interfaces compatible" p57? I feel like the adapter is more about modifying an API (notice the I in the API word) so as to make it compatible, thus just 1 interface. Also, stating "a structural design pattern focuses on providing a simple way of composing objects"p57 seems kinda misleading to me since composition is a strong well-defined notion in CS and shouldn't be used in common sense (is it the case here?). Anyway, I'll read on and try to make the 40€ worthwhile, though I highly doubt it.
Profile Image for Matías.
48 reviews
September 13, 2019
Examples are bad, both in python style and usefulness. Explanations limited, and diagrams remind me of Java. Each chapter fabricates a problem to solve with the pattern at hand immediately after mentioning real-world examples of python libraries and frameworks that use them. It is a missed opportunity not to use that code instead.

If I could give this book 0 stars... I wouldn't, but only because it does list design patterns and tries to explain them. And that is more than what I've ever done on the matter.
Profile Image for Scott.
451 reviews11 followers
July 31, 2019
This was a huge disappointment. It felt incredibly rushed and haphazardly assembled.

The code examples were very poorly formatted and not pythonic at all. The non-code examples were just ridiculous and completely irrelevant. There was no real information to be extracted from these poor, tortured metaphors, nor from the seemingly random code.
Profile Image for Dang-Khoa Le Tan.
41 reviews14 followers
March 29, 2020
It's not Raymond Hettinger's level of details. The book looks like a bunch of blog posts and Internet material about design patterns collected by the author. It could be 2.5/5 since I've still found some tidbits.
Profile Image for Anılbey.
91 reviews1 follower
Read
June 29, 2022
This book can be seen as a translation of gang of four design patterns book to Python.
Profile Image for LeoQuiroa.
50 reviews
June 18, 2021
I really liked the real-life explanation of each design pattern because it is something you can understand and relate to. To be brutally honest it was the only thing I can rescue from it. The book feels like a low-quality summary from multiple sources, most of the time the code doesn't work or it is really hard to follow for the format. In the end, I finished it using just as a guide, reading the real-life example but for the code, I had to look somewhere else.
Profile Image for Constantine.
122 reviews2 followers
August 8, 2018
Pretty good explanations about common design patterns. There are nice programming examples with corresponding prototypes from real life that makes it easier to understand them and how can u implement those solutions. It's worth reading, at least to get to know design patterns.
9 reviews3 followers
November 9, 2017
It was a good read. Small in size but with clear and direct language. Also, I liked, and only kept reading, when the author demonstrated having good sense and not blindly evangelized design patterns.
Displaying 1 - 8 of 8 reviews

Can't find what you're looking for?

Get help and learn more about the design.