Mastering Python Design Patterns

Create various design patterns to master the art of solving problems using Python

Mastering Python Design Patterns

Progressing
Sakis Kasampalis

Create various design patterns to master the art of solving problems using Python
$10.00
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781783989324
Paperback212 pages

About This Book

  • Simplify design pattern implementation using the power of Python
  • Each pattern is accompanied with a real-world example demonstrating its key features
  • This is an easy-to-follow guide focusing on the practical aspects of Python design patterns

Who This Book Is For

This 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.

Table of Contents

Chapter 1: The Factory Pattern
Factory Method
Abstract Factory
Summary
Chapter 2: The Builder Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 3: The Prototype Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 4: The Adapter Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 5: The Decorator Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 6: The Facade Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 7: The Flyweight Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 8: The Model-View-Controller Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 9: The Proxy Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 10: The Chain of Responsibility Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 11: The Command Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 12: The Interpreter Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 13: The Observer Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 14: The State Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 15: The Strategy Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 16: The Template Pattern
A real-life example
A software example
Use cases
Implementation
Summary

What You Will Learn

  • Explore Factory Method and Abstract Factory for object creation
  • Clone objects using the Prototype pattern
  • Make incompatible interfaces compatible using the Adapter pattern
  • Secure an interface using the Proxy pattern
  • Choose an algorithm dynamically using the Strategy pattern
  • Extend an object without subclassing using the Decorator pattern
  • Keep the logic decoupled from the UI using the MVC pattern

In Detail

Python 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.

Authors

Table of Contents

Chapter 1: The Factory Pattern
Factory Method
Abstract Factory
Summary
Chapter 2: The Builder Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 3: The Prototype Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 4: The Adapter Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 5: The Decorator Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 6: The Facade Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 7: The Flyweight Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 8: The Model-View-Controller Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 9: The Proxy Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 10: The Chain of Responsibility Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 11: The Command Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 12: The Interpreter Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 13: The Observer Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 14: The State Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 15: The Strategy Pattern
A real-life example
A software example
Use cases
Implementation
Summary
Chapter 16: The Template Pattern
A real-life example
A software example
Use cases
Implementation
Summary

Book Details

ISBN 139781783989324
Paperback212 pages
Read More