The daily routine of a worker, especially for workers of the same company, is very close to the Template design pattern. All workers follow more or less the same routine, but specific parts of the routine are very different. This is shown in the following figure, provided by www.sourcemaking.com [j.mp/templatepat]. The fundamental difference between what is shown in the figure and implementing the Template pattern in Python is that in Python, inheritance is not mandatory. We can use it if it really benefits us. If there's no real benefit, we can skip it and use naming and typing conventions.
Mastering Python Design Patterns
By :
Mastering Python Design Patterns
By:
Overview of this book
Table of Contents (23 chapters)
Mastering Python Design Patterns
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The Builder Pattern
The Prototype Pattern
The Adapter Pattern
The Decorator Pattern
The Facade Pattern
The Flyweight Pattern
The Model-View-Controller Pattern
The Proxy Pattern
The Chain of Responsibility Pattern
The Command Pattern
The Interpreter Pattern
The Observer Pattern
The State Pattern
The Strategy Pattern
The Template Pattern
Index
Customer Reviews