Book description
Ensure your code is sleek, efficient and elegant by mastering powerful Python design patterns
About This BookLearn all about abstract design patterns and how to implement them in Python 3
Understand the structural, creational, and behavioral Python design patterns
Get to know the context and application of design patterns to solve real-world problems in software architecture, design, and application development
Discover how to simplify Design Pattern implementation using the power of Python 3
If you have basic Python skills and wish to learn in depth how to correctly apply appropriate design patterns, this course is tailor made for you.
What You Will LearnDiscover what design patterns are and how to apply them to writing Python
Implement objects in Python by creating classes and defining methods
Separate related objects into a taxonomy of classes and describe the properties and behaviors of those objects via the class interface
Understand when to use object-oriented features, and more importantly when not to use them
Get to know proven solutions to common 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
Use Structural Design Patterns and find out how objects and classes interact to build larger applications
Improve the productivity and code base of your application using Python design patterns
Secure an interface using the Proxy pattern
Python is an object-oriented scripting language that is used in everything from data science to web development. Known for its simplicity, Python increases productivity and minimizes development time. Through applying essential software engineering design patterns to Python, Python code becomes even more efficient and reusable from project to project.
This learning path takes you through every traditional and advanced design pattern best applied to Python code, building your skills in writing exceptional Python. Divided into three distinct modules, you’ll go from foundational to advanced concepts by following a series of practical tutorials.
Start with the bedrock of Python programming – the object-oriented paradigm. Rethink the way you work with Python as you work through the Python data structures and object-oriented techniques essential to modern Python programming. Build your confidence as you learn Python syntax, and how to use OOP principles with Python tools such as Django and Kivy.
In the second module, run through the most common and most useful design patterns from a Python perspective. Progress through Singleton patterns, Factory patterns, Façade patterns and more all with detailed hands-on guidance. Enhance your professional abilities in in software architecture, design, and development.
In the final module, run through the more complex and less common design patterns, discovering how to apply them to Python coding with the help of real-world examples. Get to grips with the best practices of writing Python, as well as creating systems architecture and troubleshooting issues.
This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products:
Python 3 Object-Oriented Programming - Second Edition by Dusty Phillips
Learning Python Design Patterns - Second Edition by Chetan Giridhar
Mastering Python Design Patterns by Sakis Kasampalis
Advance your Python code through three distinct modules that each build on preceding content. Get the complete coverage of Python design patterns you need to write elegant and efficient code that’s reusable and powerful.
Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.
Table of contents
-
Python: Master the Art of Design Patterns
- Table of Contents
- Python: Master the Art of Design Patterns
- Python: Master the Art of Design Patterns
- Credits
- Preface
-
1. Module 1
- 1. Object-oriented Design
- 2. Objects in Python
- 3. When Objects Are Alike
- 4. Expecting the Unexpected
- 5. When to Use Object-oriented Programming
- 6. Python Data Structures
- 7. Python Object-oriented Shortcuts
- 8. Strings and Serialization
- 9. The Iterator Pattern
- 10. Python Design Patterns I
- 11. Python Design Patterns II
- 12. Testing Object-oriented Programs
- 13. Concurrency
-
2. Module 2
- 1. Introduction to Design Patterns
-
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
- 3. The Factory Pattern – Building Factories to Create Objects
- 4. The Façade Pattern – Being Adaptive with Façade
- 5. The Proxy Pattern – Controlling Object Access
- 6. The Observer Pattern – Keeping Objects in the Know
- 7. The Command Pattern – Encapsulating Invocation
- 8. The Template Method Pattern – Encapsulating Algorithm
- 9. Model-View-Controller – Compound Patterns
- 10. The State Design Pattern
- 11. AntiPatterns
-
3. Module 3
- 1. The Factory Pattern
- 2. The Builder Pattern
- 3. The Prototype Pattern
- 4. The Adapter Pattern
- 5. The Decorator Pattern
- 6. The Facade Pattern
- 7. The Flyweight Pattern
- 8. The Model-View-Controller Pattern
- 9. The Proxy Pattern
- 10. The Chain of Responsibility Pattern
- 11. The Command Pattern
- 12. The Interpreter Pattern
- 13. The Observer Pattern
- 14. The State Pattern
- 15. The Strategy Pattern
- 16. The Template Pattern
- A. Bibliography
- Index
Product information
- Title: Python: Master the Art of Design Patterns
- Author(s):
- Release date: September 2016
- Publisher(s): Packt Publishing
- ISBN: 9781787125186
You might also like
book
Test-Driven Development with Python, 2nd Edition
By taking you through the development of a real web application from beginning to end, the …
book
Tiny Python Projects
A long journey is really a lot of little steps. The same is true when you're …
book
Fluent Python, 2nd Edition
Don't waste time bending Python to fit patterns you've learned in other languages. Python's simplicity lets …
book
Learning Python, 5th Edition
Get a comprehensive, in-depth introduction to the core Python language with this hands-on book. Based on …