- Learning Python Design Patterns(Second Edition)
- Chetan Giridhar
- 180字
- 2021-07-16 09:46:15
Chapter 2. The Singleton Design Pattern
In the previous chapter, we explored design patterns and their classifications. As we are aware, design patterns can be classified under three main categories: structural, behavioral, and creational patterns.
In this chapter, we will go through the Singleton design pattern—one of the simplest and well-known Creational design patterns used in application development. This chapter will give you a brief introduction to the Singleton pattern, take you through a real-world example where this pattern can be used, and explain it in detail with the help of Python implementations. You will learn about the Monostate (or Borg) design pattern that is a variant of the Singleton design pattern.
In this chapter, we will cover the following topics in brief:
- An understanding of the Singleton design pattern
- A real-world example of the Singleton pattern
- The Singleton pattern implementation in Python
- The Monostate (Borg) pattern
At the end of the chapter, we have a short summary on Singletons. This will help you think independently about some of the aspects of the Singleton design pattern.
- PHP動態網站程序設計
- 無代碼編程:用云表搭建企業數字化管理平臺
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- Python進階編程:編寫更高效、優雅的Python代碼
- MATLAB應用與實驗教程
- The Data Visualization Workshop
- Yocto for Raspberry Pi
- 深入淺出PostgreSQL
- R Data Analysis Cookbook(Second Edition)
- SpringBoot從零開始學(視頻教學版)
- C++程序設計
- Sitecore Cookbook for Developers
- SQL Server 2008實用教程(第3版)
- C語言程序設計實驗指導
- Java Script從入門到精通(第5版)