ebook img

Mastering Python Design Pattern PDF

212 Pages·2015·2.05 MB·english
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Mastering Python Design Pattern

Mastering Python Design Patterns Create various design patterns to master the art of solving problems using Python Sakis Kasampalis BIRMINGHAM - MUMBAI Mastering Python Design Patterns Copyright © 2015 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: January 2015 Production reference: 1220115 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78398-932-4 www.packtpub.com Credits Author Project Coordinator Sakis Kasampalis Aboli Ambardekar Reviewers Proofreaders Evan Dempsey Ameesha Green Amitabh Sharma Joyce Littlejohn Yogendra Sharma Indexer Patrycja Szabłowska Tejal Soni Commissioning Editor Graphics Kunal Parikh Abhinash Sahu Acquisition Editor Production Coordinator Owen Roberts Aparna Bhagat Content Development Editor Cover Work Sumeet Sawant Aparna Bhagat Technical Editors Tanvi Bhatt Gaurav Suri Copy Editors Shivangi Chaturvedi Nithya P. Adithi Shetty About the Author Sakis Kasampalis (@SKasampalis) is a software engineer living in the Netherlands. He is not dogmatic about particular programming languages and tools; his principle is that the right tool should be used for the right job. One of his favorite tools is Python because he finds it very productive. Sakis was also the technical reviewer of Mastering Object-oriented Python and Learning Python Design Patterns, published by Packt Publishing. I want to thank my sweetheart, Georgia, for supporting this effort. Many thanks to Owen Roberts who encouraged me to write this book. I also want to thank Sumeet Sawant for being a very kind and cooperative content development editor. Last but not least, I want to thank the reviewers of this book for their valuable feedback. About the Reviewers Evan Dempsey is a software developer from Waterford, Ireland. When he isn't hacking in Python for fun and profit, he enjoys craft beers, common Lisp, and keeping up with modern research in machine learning. He is a contributor to several open source projects. Amitabh Sharma is a professional software engineer. He has worked extensively on enterprise applications in telecommunications and business analytics. His work is focused on service-oriented architecture, data warehouses, and languages such as Java, Python, and others. I would like to thank my grandfather and my father for allowing me to learn all that I can. I would also like to thank my wife, Komal, for her support and encouragement. Yogendra Sharma was born and brought up in a small but cultural town, Pratapgarh, in the state of Rajasthan. His basic education has been imparted in his hometown itself, and he completed his BTech in Computer Science from Jaipur. He is basically an engineer by heart and a technical enthusiast by nature. He has vast experience in the fields of Python, Django framework, web app security, networking, Web 2.0, and C++. Along with CCNA, many other esteemed certifications have been awarded to him. He is an active member of International Association of Engineers, Ubuntu, India, and Computer Society of India. More recently, he participated in bug bounty programs and won many bug bounties, including the respected Yahoo, Ebay, PayPal bug bounty. He has been appointed as security researcher for several respected organizations, such as Adobe, Ebay, Avira, Moodle, Cisco, Atlassian, Basecamp, CodeClimate, Abacus, Rediff, Assembla, RecruiterBox, Tumbler, Wrike, Indeed, HybridSaaS, Sengrid, and SnapEngag. He has reviewed many books from reputed publishing houses. You can find him on LinkedIn at http://in.linkedin.com/in/yogendra0sharma. I would like to thank all my friends who always encouraged me to do something new and believing in me. Patrycja Szabłowska is a Python developer with some Java background, with experience mainly in backend development. She graduated from Nicolaus Copernicus University in Toruń, Poland. She is currently working in Warsaw, Poland, at Grupa Wirtualna Polska. She is constantly exploring technical novelties and is open-minded and eager to learn about the next Python library or framework. Her favorite programming motto is Code is read much more often than it is written. I'd like to thank my husband, Wacław, for encouraging me to explore new frontiers, and also my parents for teaching me what matters the most. www.PacktPub.com Support files, eBooks, discount offers, and more For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM https://www2.packtpub.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via a web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Table of Contents Preface 1 Chapter 1: The Factory Pattern 9 Factory Method 9 A real-life example 10 A software example 10 Use cases 10 Implementation 12 Abstract Factory 20 A real-life example 20 A software example 21 Use cases 21 Implementation 21 Summary 27 Chapter 2: The Builder Pattern 29 A real-life example 30 A software example 30 Use cases 31 Implementation 34 Summary 43 Chapter 3: The Prototype Pattern 45 A real-life example 47 A software example 48 Use cases 48 Implementation 49 Summary 54

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.