Design principles and patterns for building better Python software.
Great Python applications take advantage of established design principles and patterns that maximize performance, maintainability, and reliability. Software Design in Python shows you how to build on your Python coding skills by mastering the practices of great software design! Following intuitive “before” and “after” examples of improved code, you’ll learn to plan and execute Python applications effectively and avoid bugs associated with unmanaged state, poorly-formed classes, inflexible functions, and more.
In Software Design in Python, you’ll learn how
• Acquire and analyze application requirements • Create well-designed applications through iterative development • Design Python classes with high cohesion and loose coupling • Implement Python decorators to enhance class properties, abstraction, and method functionality • Apply industry-standard design principles to improve code structure and maintainability • Identify appropriate design patterns to solve complex software design challenges
Software Design in Python teaches you to apply tried-and-tested object-oriented design principles to your Python code. The examples in this guide are simple, clear, and accessible. All examples are in Python, although most of the techniques will apply to any object-oriented language. You’ll solve common architecture problems, and discover the “Pythonic” way to implement encapsulation, implementation-hiding, method overloading, and more.
About the book
Software Design in Python helps you build software like the pros. In clear, jargon-free language it lays out the object-oriented design principles, practices, and patterns that you need to know to build scalable and maintainable applications. Throughout, you’ll find intuitive “before” and “after” examples that show you what bad code looks like, and how to fix it with the right pattern. Conversation sidebars feature engaging talking heads that ask-and-answer common questions. If you know the basics of Python code and are ready to make the leap to building software, this book will be the patient and insightful mentor you need!
About the reader
For programmers comfortable with Python syntax. No experience with object-oriented software design required.
About the author
Ronald Mak is a former NASA senior scientist. Currently, he teaches data science and computer science at San Jose State University. He is the author of Object-Oriented Software Design in C++.
This book was very different than what I expected, as I read lots of books on software design, but in the age of vibe coding how can this one stand out. A couple thoughts, first, that the author acknowledges that AI can be used for development and for simple applications it may be appropriate, but, if you want to write a more complex application then software engineering comes in handy. They also mention that with experience the design can be shortened.
The book starts off with are you writing the correct solution. So they go through how do you collect requirements, as a starting point, and why it is important to have dates for when freezing the gathering. They talk about functional and non-functional requirements, as all of these are important, with discussion as to why.
So, once you have come up with what you are actually building, then you should be looking at documenting the design, and there is a long discussion about UML diagrams. These are old-school but can be very useful. Personally I find flow charts, data flow and sequence diagrams enough, but there is a reason why so many people use the various diagrams. To be more complete, as they didn't just write it for me, they do a great job discussing various diagrams.
Ok, so now we need to take into account design patterns, and they go through most of the Gang of Four patterns, in great detail, which can be helpful, and they help give ideas as to when you may want to pick one pattern or another. This will be useful for anyone using object oriented programming languages, and if you don't know how to use OOP in python this book will give you the knowledge on how to take your python skills to another level, rather than just writing simple programs.
The author also give a great deal of experience on expecting to start going down one path, then realize it isn't ideal, so going back and trying a different path, until the design is deemed ideal for the requirements and expectations.
I loved the spiral design methodology while in college and in a scrum approach it can still be useful. While reading the book I was thinking about the importance of knowledgable architects, to help with keeping good design, and the importance of having a coding standard.
I also found the section on programming to contract to be very helpful to newer developers/architects and they discuss recursion and multithreading in detail.
For people that want to design applications that are maintainable, expandable and meet the expectations of the stakeholders this book will prepare you to do that.
This is purely for Object Oriented programming, and I realize functional programming would be another book, though I do miss it, and it doesn't take into account of the dynamic properties of Python, which I think is a miss, but that is just my thoughts. In python you can dynamically add functions and properties but that is harder to design well for and to use with large groups without a great deal more documentation.
The content stays true to its title, and I found it to be both an easy and entertaining read.
### The Core Content The principles and patterns presented are industry classics. Their validity is backed by years of professional use, and the author illustrates each one with concrete examples.
What I found particularly useful is that the examples aren't limited to "happy path" scenarios where applying a pattern is beneficial. Instead, the author also illustrates cases where poor design decisions were initially made. Once the problems generated by these low-quality designs are identified, that is when the principles and patterns discussed in the book come into play to solve them.
You might not agree 100% with the author’s specific application of these principles or his choice of pattern for every case, but these are well-established concepts validated over many years. At the very least, this book serves as a great refresher if you already know them, and it will prompt you to reflect on and rethink your own perspective in contrast to the author’s.
### The Critiques As is common in software engineering, nothing is perfect. In my humble opinion, these are the aspects you might not like when reading this book:
* Language Agnostic (to a fault): Despite the title, the code is quite language-agnostic. The advantage is that it’s easy to port the examples to other languages; the disadvantage is that it is not Pythonic, nor does it follow PEP 8 style guides. * Defensive Programming: If you aren't a fan of defensive programming, you will likely have several "But why?!" moments. * Strictly OOP: All the principles and patterns are classic and purely related to Object-Oriented Design. You won't find anything related to other paradigms or paradigm-agnostic principles. * Artificial Examples: Some examples can feel a bit contrived, though they do illustrate the discussed principles and patterns perfectly. * Outdated Patterns: Some patterns are somewhat obsolete. For instance, the Iterator pattern was highly useful in 1995, but modern languages now incorporate these features as native parts of the language itself.
POV: I am a data scientist who uses Python (and other languages) on a regular basis. But I do not have the background of computer science or a software engineer. This book covers object oriented design though teaching of design patterns, design architecture solutions that make use of object oriented design principles in both class design and how classes work together.
What I really liked about this was its use of a spiral development exercise as the way to teach principles then the patterns. Each chapter introduces a problem, then a reasonable seeming solution. Then it develops the pattern by demonstrating what makes the solution fragile, then introduces another part of the pattern to resolve. This gives a good motivation on how and why the design pattern works for its goal, and if following along with the code you can see the difference in your own IDE.
A short form presentation of design patterns usually consists of the problem and solution. But does not teach you how to recognize the problem or different forms the problem could take. By starting out with a working naive solution, then iteratively improving it, this book gives a deeper understanding of design patterns and how to use them.
Disclaimer: I received preliminary copies of this book to give comments and feedback while is was being written by the publisher. This review is my own and has not been reviewed by Manning Publications.
This book is a practical and eye-opening guide for developers who want to move beyond writing code and start thinking about software at a higher level. What immediately stands out is the clarity of the language and the quality of the examples — every concept is explained in plain, accessible terms, and you always understand not just what to do, but why. The top-down approach is another strong point. The author starts by teaching you how to properly think about and design an application before writing a single line of code. Chapter 2 is particularly impressive in this regard, making a compelling case that good design is an iterative process: developer gather requirements, sketch a design, discover gaps, and revisit. The UML diagrams accompanying each design pattern are also a highlight. They give you an immediate visual overview of the involved objects and their relationships, making even complex patterns easy to grasp at a glance. The only slightly out-of-place element is the chapter on multithreaded applications: well written and interesting, but feeling more like a bonus chapter than an integral part of the book's core narrative. Overall, a highly recommended read for any Python developer looking to level up their design skills.
A great guide for becoming a pro. While many books focus on theory, this one stays grounded using frequently encountered real-world decisions.
Part 2 is very beneficial reading now that AI is writing more of our code. Understanding encapsulation and class design is the only way to keep long-running projects from collapsing under their own weight. I found part 4 to be the most useful, focusing on the "greatest hits" of design patterns rather than obscure edge cases. The presented architectures regularly come up in production and personal projects so it is extremely valuable to identify and implement them well.
Highly recommended for any junior-to-mid dev looking to level up.
This book is perfect for people who started their software engineering career with Python, and perhaps Python scripting, and want to level up to developing large-scale applications that adhere to industry design standards. I just started reading the book, and I truly enjoyed the writing style, the structure, and the way the chapters are sequentially organized.
This book is good for people who started using Python and want to level up to developing large-scale applications in line with industry design standards. The author provides clear, easy-to-understand details on multithreading and complex recursive solutions in the dedicated sections.