Learning Python Design Patterns
暫譯: 學習 Python 設計模式

Gennadiy Zlobin

  • 出版商: Packt Publishing
  • 出版日期: 2013-11-25
  • 售價: $1,180
  • 貴賓價: 9.5$1,121
  • 語言: 英文
  • 頁數: 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 程式設計師撰寫的,這本優秀的教程將幫助您通過使用設計模式來簡化工作。您將通過範例和清晰的解釋來擴展您的知識並加快您的產出。

概述

  • 探索模型-視圖-控制器(Model-View-Controller)模式,學習如何建立一個 URL 縮短服務
  • 所有設計模式都使用可以修改並應用於您的軟體的真實世界範例
  • 沒有不必要的理論!本書僅包含您需要了解的基本知識

詳細內容

設計模式是一種解決每位軟體開發者在工作中遇到的特定問題的知名方法。設計模式捕捉了在程式中常見的高階結構。如果您知道如何在一種語言中實現設計模式,通常您將能夠將其移植並在另一種物件導向程式語言中使用。

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

您將從最受歡迎的軟體架構模式之一——模型-視圖-控制器模式開始。然後,您將學習兩個創建型設計模式,即單例模式(Singleton)和工廠模式(Factory),以及兩個結構型模式,即外觀模式(Facade)和代理模式(Proxy)。最後,本書還解釋了三個行為型模式,即命令模式(Command)、觀察者模式(Observer)和模板模式(Template)。

您將從本書中學到什麼

  • 以最少的修改創建相同演算法的不同實現
  • 實現發布-訂閱模式(publisher-subscriber pattern)
  • 在只需要一個實例時創建一個物件
  • 使用外觀設計模式創建一個簡單的介面
  • 在不改變介面的情況下增加功能性

方法

本書採取基於教程和使用者友好的方法來涵蓋 Python 設計模式。其簡潔的呈現意味著您在短時間內將獲得對各種設計模式的良好介紹。

本書的讀者對象

如果您是中階 Python 使用者,本書適合您。對 Python 程式設計的先前知識是必需的。還需要對 UML 有一些了解,以理解用於描述某些設計模式的 UML 圖。