Learning Python Design Patterns

Gennadiy Zlobin

  • 出版商: Packt Publishing
  • 出版日期: 2013-11-25
  • 售價: $1,090
  • 貴賓價: 9.5$1,036
  • 語言: 英文
  • 頁數: 100
  • 裝訂: Paperback
  • ISBN: 1783283378
  • ISBN-13: 9781783283378
  • 相關分類: Python程式語言Design Pattern
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

商品描述

Written for intermediate Python programmers, this excellent tutorial will help streamline your work through the use of Design Patterns. You'll learn through example and clear explanations to expand your know-how and speed up your output.

Overview

  • Explore the Model-View-Controller pattern and learn how to build a URL shortening service
  • All design patterns use a real-world example that can be modified and applied in your software
  • No unnecessary theory! The book consists of only the fundamental knowledge that you need to know

In Detail

Design pattern is a well-known approach to solve some specific problems which each software developer comes across during his work. Design patterns capture higher-level constructs that commonly appear in 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-oriented programming language.

The choice of implementation language affects the use of design patterns. Naturally, some languages are more applicable for certain tasks than others. Each language has its own set of strengths and weaknesses. In this book, we introduce some of the better known design patterns in Python. You will learn when and how to use the design patterns, and implement a real-world example which you can run and examine by yourself.

You will start with one of the most popular software architecture patterns which is the Model- View-Controller pattern. Then you will move on to learn about two creational design patterns which are Singleton 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 the same algorithm with the least modifications
  • Implement the publisher-subscriber pattern
  • Create an object when only one instance of it is needed
  • Create a simple interface using the Facade design pattern
  • Increase the functionality while leaving the interface unchanged

Approach

This book takes a tutorial-based and user-friendly approach to covering Python design patterns. Its concise presentation means that in a short space of time, you will get a good introduction to various design patterns.

Who this book is written for

If you are an intermediate level Python user, 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 are used to describe some design patterns.

商品描述(中文翻譯)

這本優秀的教程是為中級Python程序員而寫的,將幫助您通過使用設計模式來優化您的工作流程。通過實例和清晰的解釋,您將學習擴展您的專業知識並加快您的輸出速度。

概述:
- 探索模型-視圖-控制器模式,並學習如何構建URL縮短服務
- 所有設計模式都使用可以修改並應用於您的軟件的現實世界示例
- 沒有不必要的理論!本書只包含您需要了解的基本知識

詳細內容:
設計模式是解決軟件開發人員在工作中遇到的特定問題的一種廣為人知的方法。設計模式捕捉常出現在程序中的高級結構。如果您知道如何在一種語言中實現設計模式,通常您將能夠將其移植並在另一種面向對象的編程語言中使用。

實現語言的選擇會影響設計模式的使用。自然地,某些語言比其他語言更適用於特定任務。每種語言都有其自身的優點和缺點。在本書中,我們介紹了一些在Python中較為著名的設計模式。您將學習何時以及如何使用這些設計模式,並實現一個您可以運行和檢查的現實世界示例。

您將從最受歡迎的軟件架構模式-模型-視圖-控制器模式開始。然後,您將學習兩種創建型設計模式-單例模式和工廠模式,以及兩種結構型模式-外觀模式和代理模式。最後,本書還解釋了三種行為型模式-命令模式、觀察者模式和模板模式。

從本書中您將學到:
- 使用最少的修改創建相同算法的不同實現
- 實現發布者-訂閱者模式
- 在只需要一個實例的情況下創建對象
- 使用外觀設計模式創建簡單的接口
- 在保持接口不變的情況下增加功能

這本書以教程為基礎,以用戶友好的方式介紹Python設計模式。簡潔的呈現意味著在短時間內,您將對各種設計模式有一個良好的介紹。

本書適合中級Python用戶閱讀,需要具備Python編程的基礎知識。理解用於描述某些設計模式的UML圖表需要一些UML知識。