Practical C++ Design

From Programming to Architecture
 
 
Apress
  • erschienen am 27. September 2017
  • |
  • XX, 246 Seiten
 
E-Book | PDF mit Adobe DRM | Systemvoraussetzungen
E-Book | PDF mit Wasserzeichen-DRM | Systemvoraussetzungen
978-1-4842-3057-2 (ISBN)
 
Go from competent C++ developer to skilled designer or architect using this book as your C++ design master class. This title will guide you through the design and implementation of a fun, engaging case study. Starting with a quick exploration of the requirements for building the application, you'll delve into selecting an appropriate architecture, eventually designing and implementing all of the necessary modules to meet the project's requirements. By the conclusion of Practical C++ Design, you'll have constructed a fully functioning calculator that builds and executes on multiple platforms. Access to the complete source code will help speed your learning.
Utilize the Model-View-Controller pattern to determine the optimal architecture for the calculator; the observer pattern to design an event system; the singleton pattern as you design the calculator's central data repository, a reusable stack; the command pattern to design a command system supporting unlimited undo/redo; and the abstract factory pattern for a cross-platform plugin infrastructure to make the calculator extensible.
What You Will Learn
  • Read a specification document and translate it into a practical C++ design
  • Understand trade-offs in selecting between alternative design scenarios
  • Gain practical experience in applying design patterns to realistic development scenarios
  • Learn how to effectively use language elements of modern C++ to create a lasting design
  • Develop a complete C++ program from a blank canvas through to a fully functioning, cross platform application
  • Read, modify, and extend existing, high quality code
  • Learn the fundamentals of API design, including class, module, and plugin interfaces
Who This Book Is For

The experienced C++ developer ready to take the next step to becoming a skilled C++ designer.
1st ed.
  • Englisch
  • CA
  • |
  • USA
APRESS
  • 11
  • |
  • 13 s/w Abbildungen, 11 farbige Abbildungen
  • |
  • 13 schwarz-weiße und 11 farbige Abbildungen, Bibliographie
  • 3,00 MB
978-1-4842-3057-2 (9781484230572)
1484230574 (1484230574)
10.1007/978-1-4842-3057-2
weitere Ausgaben werden ermittelt
Adam B. Singer graduated first in his class at the Georgia Institute of Technology in 1999 with a bachelors degree in chemical engineering. He subsequently attended the Massachusetts Institute of Technology on a National Defense, Science, and Engineering Graduate Fellowship. He graduated from MIT with a Ph.D. in chemical engineering in 2004 after defending his thesis titled Global Dynamic Optimization.
Since graduation, Adam has been a member of the research and engineering staff at an oil and gas major, where he has worked in software development, design, and project management in areas such as optimization, reservoir simulation, decision support under uncertainty, basin modeling, well log modeling, and stratigraphy. He has also served on and chaired committees designing in-house training in the areas of technical software development and computational and applied mathematics. He currently holds a research supervisory position.

Adam additionally held the title of adjunct assistant professor in the Department of Computational and Applied Mathematics at Rice University from 2007-2012. In both 2006 and 2007, he taught a graduate level course, CAAM 520, on computational science. The course focused on the design and implementation of high performance parallel programs.
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'll learn techniques for simple parsing and tokenizingof input text streams.1. The User Interface Abstraction2. The Concrete CLI Class3. Tying It Together: A Working ProgramChapter 6: The Graphical User Interface (24 pages)In this chapter, we build the Qt-based graphical user interface for the calculator. Here, we'llexamine different strategies for building GUIs, abstraction of GUI elements, and modularization ofthe overall GUI design. Included in the discussion is design for the separation of on-screen widgetsfrom look-and-feel.1. Requirements2. Building GUIs3. Modularization4. A Working Program5. A Microsoft Windows Build NoteChapter 7: Plugins (38 pages)In this chapter, I describe how to build a cross-platform plugin system. This system includes theabstract interface for C++ plugins as well as the operating system specific mechanics involved withloading plugins and executing plugin functions. In the concrete case of the plugin loader, I explainthe many build tricks that can be used to handle cross-platform code and demonstrate how theabstract factory pattern provides an elegant design solution to this problem.1. What Is a Plugin?2. Problem 1: The Plugin Interface3. Problem 2: Loading Plugins4. Problem 3: Retrofitting pdCalc5. Incorporating Plugins6. A Concrete Plugin7. Next Steps7Chapter 8: New Requirements (24 pages)Any developer who has ever worked on a production software project quickly learns that newrequirements are always added late in the development cycle. In this chapter, we explore theaddition of new user requests after the original requirements have already been satisfied. Thediscussion progresses from fully implemented solutions to design only solutions to vague ideas forthe reader to explore on her own.1. Fully Designed New Features2. Designs Toward a More Useful Calculator3. Some Interesting Extensions for Self-ExplorationAppendix A: Acquiring, Building, and Executing pdCalc (4 pages)This appendix explains how to download the source code from GitHub and how to build the casestudy on Linux and Windows. Once the program is built, readers will want to execute the codeand its included test suite; execution instructions are therefore provided.1. Getting The Source Code2. Dependencies3. Building pdCalc4. Executing pdCalcAppendix B: Organization of the Source Code (6 pages)This appendix simply explains the organization of the source tree for pdCalc. This appendix isuseful for finding the locations for the source files referenced in the text.1. The src Directory2. The test DirectoryReferences (2 pages)This section lists twenty-nine references cited in the book.Index (3 pages)This section is a complete index for the book.
DNB DDC Sachgruppen

Dateiformat: PDF
Kopierschutz: Adobe-DRM (Digital Rights Management)

Systemvoraussetzungen:

Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).

Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions (siehe E-Book Hilfe).

E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)

Das Dateiformat PDF zeigt auf jeder Hardware eine Buchseite stets identisch an. Daher ist eine PDF auch für ein komplexes Layout geeignet, wie es bei Lehr- und Fachbüchern verwendet wird (Bilder, Tabellen, Spalten, Fußnoten). Bei kleinen Displays von E-Readern oder Smartphones sind PDF leider eher nervig, weil zu viel Scrollen notwendig ist. Mit Adobe-DRM wird hier ein "harter" Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.

Weitere Informationen finden Sie in unserer E-Book Hilfe.


Dateiformat: PDF
Kopierschutz: Wasserzeichen-DRM (Digital Rights Management)

Systemvoraussetzungen:

Computer (Windows; MacOS X; Linux): Verwenden Sie zum Lesen die kostenlose Software Adobe Reader, Adobe Digital Editions oder einen anderen PDF-Viewer Ihrer Wahl (siehe E-Book Hilfe).

Tablet/Smartphone (Android; iOS): Installieren Sie die kostenlose App Adobe Digital Editions oder eine andere Lese-App für E-Books (siehe E-Book Hilfe).

E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nur bedingt: Kindle)

Das Dateiformat PDF zeigt auf jeder Hardware eine Buchseite stets identisch an. Daher ist eine PDF auch für ein komplexes Layout geeignet, wie es bei Lehr- und Fachbüchern verwendet wird (Bilder, Tabellen, Spalten, Fußnoten). Bei kleinen Displays von E-Readern oder Smartphones sind PDF leider eher nervig, weil zu viel Scrollen notwendig ist. Mit Wasserzeichen-DRM wird hier ein "weicher" Kopierschutz verwendet. Daher ist technisch zwar alles möglich - sogar eine unzulässige Weitergabe. Aber an sichtbaren und unsichtbaren Stellen wird der Käufer des E-Books als Wasserzeichen hinterlegt, sodass im Falle eines Missbrauchs die Spur zurückverfolgt werden kann.

Weitere Informationen finden Sie in unserer E-Book Hilfe.


Download (sofort verfügbar)

34,99 €
inkl. 19% MwSt.
Download / Einzel-Lizenz
PDF mit Adobe DRM
siehe Systemvoraussetzungen
E-Book bestellen

34,99 €
inkl. 19% MwSt.
Download / Einzel-Lizenz
PDF mit Wasserzeichen-DRM
siehe Systemvoraussetzungen
E-Book bestellen

Unsere Web-Seiten verwenden Cookies. Mit der Nutzung dieser Web-Seiten erklären Sie sich damit einverstanden. Mehr Informationen finden Sie in unserem Datenschutzhinweis. Ok