Practical C++ Design: From Programming to Architecture
暫譯: 實用 C++ 設計:從程式設計到架構

Singer, Adam B.

  • 出版商: Apress
  • 出版日期: 2021-12-11
  • 售價: $1,770
  • 貴賓價: 9.5$1,682
  • 語言: 英文
  • 頁數: 312
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1484274067
  • ISBN-13: 9781484274064
  • 相關分類: C++ 程式語言
  • 海外代購書籍(需單獨結帳)

商品描述

Preface (5 pages)The preface details my motivation for writing the book, the target audience for the book, thegeneral structure of the book, and how to contact the author. Of particular importance is therationale behind choosing the case study, the target language (C++), and the GUI toolkit (Qt).Chapter 1: Defining the Case Study (6 pages)The first chapter describes, in detail, the case study to be examine in the book. The chapterdiscusses requirements in the abstract and then transitions to the calculator's specific requirements.This sets the stage for the remainder of the book, which describes, in detail, the design andimplementation of the calculator, pdCalc, proposed in Chapter 1.1. A Brief Introduction2. A Few Words About Requirements3. Reverse Polish Notation (RPN)4. The Calculator's Requirements5. The Source Code1The advice, information, and conclusions discussed in this book are those of the author and have not beenendorsed by, or reflect the opinions or practices of, ExxonMobil Corporation or its affiliates.5Chapter 2: Decomposition (18 pages)In this chapter, I explain the elements of a good decomposition and strategies for decomposing aproblem into manageable pieces. Subsequently, an architecture for pdCalc is selected, the calculatoris modularized, and use cases are used to develop interfaces for the high level calculator modules.The four high level modules are the stack, the command dispatcher, the user interface (subdividedinto a command line interface and a graphic user interface), and a plugin manager.1. The Elements of a Good Decomposition2. Selecting An Architecture3. Interfaces4. Assessment of Our Current Design5. Next StepsChapter 3: The Stack (20 pages)The stack is the first module discussed in detail. The stack is the fundamental data repositoryof the calculator. As part of the calculator's design and implementation, the singleton pattern isexplored. The stack also affords the first opportunity to discuss an event system for the calculator, which provides a backdrop for exploration of the observer pattern, including the design andimplementation of reusable publisher and observer abstract classes.1. Decomposition of the Stack Module2. The Stack Class3. Adding Events4. A Quick Note on TestingChapter 4: The Command Dispatcher (32 pages)This chapter describes the design and implementation of the command dispatcher, the module ofthe calculator responsible for the creation, storage, and execution of commands. Of particular notein this chapter is the exposition on the command pattern and how it can be used to implement apractical undo/redo framework. In addition to exploring a traditional deep hierarchy method forimplementing commands, a C++11 alternative using lambda expressions and the standard functiontemplate are presented as a modern alternative design.1. The Decomposition of the Command Dispatcher2. The Command Class3. The Command Repository4. The Command Manager5. The Command Dispatcher6. Revisiting Earlier Decisions6Chapter 5: The Command Line Interface (14 pages)This chapter marks an important milestone, the creation of the first user executable program.In addition to building a simple command line interface, we'll explore how to create an abstractsoftware interface suitable for both a command line interface and a graphical user interface. Withinthe context of the command line interface, we'

商品描述(中文翻譯)

前言(5頁)
前言詳細說明了我撰寫本書的動機、書籍的目標讀者、書籍的一般結構以及如何聯繫作者。特別重要的是選擇案例研究、目標語言(C++)和GUI工具包(Qt)的理由。

第一章:定義案例研究(6頁)
第一章詳細描述了本書將要探討的案例研究。該章節首先討論了抽象中的需求,然後過渡到計算器的具體需求。這為本書的其餘部分奠定了基礎,該部分詳細描述了在第一章中提出的計算器pdCalc的設計和實現。
1. 簡介
2. 關於需求的幾句話
3. 逆波蘭表示法(RPN)
4. 計算器的需求
5. 原始碼

本書中討論的建議、資訊和結論均為作者的觀點,並未獲得ExxonMobil Corporation或其附屬公司的認可或反映其意見或做法。

第二章:分解(18頁)
在本章中,我解釋了良好分解的要素以及將問題分解為可管理部分的策略。隨後,選擇了pdCalc的架構,計算器被模組化,並使用用例來開發高級計算器模組的介面。四個高級模組分別是堆疊、命令調度器、用戶介面(分為命令行介面和圖形用戶介面)以及插件管理器。
1. 良好分解的要素
2. 選擇架構
3. 介面
4. 我們當前設計的評估
5. 下一步

第三章:堆疊(20頁)
堆疊是第一個詳細討論的模組。堆疊是計算器的基本數據儲存庫。作為計算器設計和實現的一部分,探討了單例模式。堆疊還提供了首次討論計算器事件系統的機會,這為觀察者模式的探索提供了背景,包括可重用的發布者和觀察者抽象類的設計和實現。
1. 堆疊模組的分解
2. 堆疊類
3. 添加事件
4. 測試的簡要說明

第四章:命令調度器(32頁)
本章描述了命令調度器的設計和實現,該模組負責命令的創建、存儲和執行。本章中特別值得注意的是對命令模式的闡述,以及如何使用它來實現實用的撤銷/重做框架。除了探索傳統的深層層次方法來實現命令外,還提出了一種使用lambda表達式和標準函數模板的C++11替代方案作為現代設計。
1. 命令調度器的分解
2. 命令類
3. 命令庫
4. 命令管理器
5. 命令調度器
6. 重新考慮早期決策

第五章:命令行介面(14頁)
本章標誌著一個重要的里程碑,即創建第一個用戶可執行的程序。除了構建一個簡單的命令行介面外,我們還將探討如何創建一個適合命令行介面和圖形用戶介面的抽象軟體介面。在命令行介面的背景下,我們將...