Leanpub Header

Skip to main content

EMBARGO!

Journalists and bloggers: please do not publish anything about this until the embargo is lifted!

Please contact the author for more information about when this is.

Design Patterns in Modern C++

The original Design Patterns book used C++. A long time has passed since it was published. Perhaps it's time for an update?

Minimum price

$15.00

$30.00

You pay

$30.00

Author earns

$24.00
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
About

About

About the Book

Based on a popular Pluralsight course series, Design Patterns in Modern C++ covers all of the original Gang of Four design patterns using all the advanced features of Modern C++.

Share this book

Categories

Author

About the Author

Dmitri Nesteruk

Dmitri Nesteruk is a developer, speaker, podcaster and a technologist. His interests lie in software development and integration practices in the areas of computation, quantitative finance and algorithmic trading. He is an instructor of an entry-level course in Quantitative Finance. His technological interests include C#, F# and C++ programming as well high-performance computing using technologies such as CUDA. He has been a C# MVP since 2009.

Contents

Table of Contents

1.Introduction

  1. Preliminaries
  2. Important Concepts
  3. The SOLID Design Principles
  4. Time for Patterns!
  5. ICreational Patterns
  6. Returning Objects From Functions

2.Builder

  1. Scenario
  2. Simple Builder
  3. Fluent Builder
  4. Communicating Intent
  5. Groovy-style Builder
  6. Composite Builder
  7. Summary

3.Factories

  1. Scenario
  2. Factory Method
  3. Factory
  4. Inner Factory
  5. Abstract Factory
  6. Functional Factory
  7. Summary

4.Prototype

  1. Object Constrution
  2. Ordinary Duplication
  3. Duplication via Copy Construction
  4. Serialization
  5. Prototype Factory
  6. Summary

5.Singleton

  1. Singleton as Global Object
  2. Classic Implementation
  3. The Trouble with Singleton
  4. Singletons and Inversion of Control
  5. Monostate
  6. Summary
  7. IIStructural Patterns

6.Adapter

  1. Scenario
  2. Adapter
  3. Adapter Temporaries
  4. Summary

7.Bridge

  1. The Pimpl Idiom
  2. Bridge
  3. Summary

8.Composite

  1. Array Backed Properties
  2. Grouping Graphic Objects
  3. Neural Networks
  4. Summary

9.Decorator

  1. Scenario
  2. Dynamic Decorator
  3. Static Decorator
  4. Functional Decorator
  5. Summary

10.Façade

  1. How the Terminal Works
  2. An Advanced Terminal
  3. Where’s the Façade?
  4. Summary

11.Flyweight

  1. User Names
  2. Boost.Flyweight
  3. String Ranges
  4. Summary

12.Proxy

  1. Smart Pointers
  2. Property Proxy
  3. Virtual Proxy
  4. Communication Proxy
  5. Summary
  6. IIIBehavioral Patterns

13.Chain of Responsibility

  1. Scenario
  2. Pointer Chain
  3. Broker Chain
  4. Summary

14.Command

  1. Scenario
  2. Implementing the Command Pattern
  3. Undo Operations
  4. Composite Command
  5. Command Query Separation
  6. Summary

15.Interpreter

  1. Numeric Expression Evaluator
  2. Parsing with Boost.Spirit
  3. Summary

16.Iterator

  1. Iterators in the Standard Library
  2. Traversing a Binary Tree
  3. Iteration with Coroutines
  4. Summary

17.Mediator

  1. Chat Room
  2. Mediator with Events
  3. Summary

18.Memento

  1. Bank Account
  2. Undo and Redo
  3. Summary

19.Null Object

  1. Scenario
  2. Null Object
  3. shared_ptr is not a Null Object
  4. Design Improvements
  5. Implicit Null Object
  6. Summary

20.Observer

  1. Property Observers
  2. Observer<T>
  3. Observable<T>
  4. Connecting Observers and Observables
  5. Dependency Problems
  6. Unsubscription and Thread Safety
  7. Reentrancy
  8. Observer via Boost.Signals2
  9. Summary

21.State

  1. State Driven State Transitions
  2. Handmade State Machine
  3. State Machines with Boost.MSM
  4. Summary

22.Strategy

  1. Dynamic Strategy
  2. Static Strategy
  3. Summary

23.Template Method

  1. Game Simulation
  2. Summary

24.Visitor

  1. Intrusive Visitor
  2. Reflective Printer
  3. WTH is Dispatch?
  4. Classic Visitor
  5. Acyclic Visitor
  6. Variants and std::visit
  7. Summary
  8. IVAppendix A: Functional Design Patterns

25.Maybe Monad

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub