更多好资料可以关注我哦
Book Details
- Title: Learning Python Design Patterns
- Author: Gennadiy Zlobin
- Length: 100 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2013-11-25
- ISBN-10: 1783283378
- ISBN-13: 9781783283378
Editorial Reviews
A practical and fast-paced guide exploringPython design patterns
Overview
Explore the Model-View-Controller patternand learn how to build a URL shortening service
All design patterns use a real-worldexample that can be modified and applied in your software
No unnecessary theory! The book consists ofonly the fundamental knowledge that you need to know
In Detail
Design pattern is a well-known approach tosolve some specific problems which each software developer comes across duringhis work. Design patterns capture higher-level constructs that commonly appearin 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-orientedprogramming language.
The choice of implementation languageaffects the use of design patterns. Naturally, some languages are moreapplicable for certain tasks than others. Each language has its own set ofstrengths and weaknesses. In this book, we introduce some of the better knowndesign patterns in Python. You will learn when and how to use the designpatterns, and implement a real-world example which you can run and examine byyourself.
You will start with one of the most popularsoftware architecture patterns which is the Model- View-Controller pattern.Then you will move on to learn about two creational design patterns which areSingleton 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.
What you will learn from this book
Create different implementations of thesame algorithm with the least modifications
Implement the publisher-subscriber pattern
Create an object when only one instance ofit is needed
Create a simple interface using the Facadedesign pattern
Increase the functionality while leavingthe interface unchanged
Approach
This book takes a tutorial-based anduser-friendly approach to covering Python design patterns. Its concisepresentation means that in a short space of time, you will get a goodintroduction to various design patterns.
Who this book is written for
If you are an intermediate level Pythonuser, this book is for you. Prior knowledge of Python programming is essential.Some knowledge of UML is also required to understand the UML diagrams which areused to describe some design patterns.
Table of Contents
Chapter 1: Model-View-Controller
Chapter 2: Creating Only One Object withthe Singleton Pattern
Chapter 3: Building Factories to CreateObjects
Chapter 4: The Facade Design Pattern
Chapter 5: Facilitating ObjectCommunication with Proxy and Observer Patterns
Chapter 6: Encapsulating Calls with theCommand Pattern
Chapter 7: Redefining Algorithms with theTemplate Method