Modern C++ Design Patterns [2020 Class Archive]

Modern C++ Design Patterns is a three-day training course with programming exercises taught by Klaus Iglberger. It is offered online from 11AM to 5PM Eastern Time (EDT),  Wednesday September 9th through Friday September 11th, 2020 (before the conference).

Course Description

Design patterns have proven to be useful over several decades and knowledge about them is still very useful to design robust, decoupled systems. Modern C++, however, has profoundly changed the way we use C++, think about design and implement solutions. This training explores modern C++ design and the modern forms of the classic design patterns. It provides guidelines, idioms and best practices for sustainable and maintainable design, which enable programmers to create professional, high-quality code. Amongst others it will answer the following questions:
  • How does good C++ design with a minimum of dependencies look like?
  • What are the most important rules for robust, maintainable, and sustainable design?
  • What are the most common pitfalls in C++ software design?
  • Why does classical C++ design based on inheritance hierarchies fail so often?
  • How are the classic design patterns realised in modern C++?
  • What are alternatives to the classic design patterns?

After this course, participants will … 

  • … have a detailed understanding of the essential design principles;
  • … be able to design with minimum dependencies;
  • … have an impression on the modern alternatives of classic design patterns;
  • … have gained knowledge about modern design techniques;
  • … understand how std::function, std::any, and ranges work;
  • … avoid the usual pitfalls in the context of inheritance;
  • … know about the importance of value semantics;
  • … comprehend the advantages of non-intrusive design.

Prerequisites

Course participants should have a solid base knowledge of C++ and at least one to two years of experience with the language. Additionally, the course is interesting for you if several of the following statements apply to you:
  • You are not aware of the impact of dependencies on code quality
  • You don’t know the SOLID principles or don’t consider them for your work
  • You believe object-oriented programming is about inheritance relationships
  • You consider moving functionality into classes the preferred design choice
  • You don’t comprehend the arcane rules when the compiler is generating the special member functions for you
  • You don’t know the details of move semantics
  • You want to reevaluate classic design patterns
  • You want to get an impression on modern C++ design patterns
  • You wonder about type erasure and expression templates or their value

Course Topics

Basic Design Principles
  • Design Metrics
  • The SOLID Principles

Dynamic Polymorphism

  • The Perils of Inheritance
  • Good Public Inheritance
  • Bad Public Inheritance

The Design of Regular Types

  • Towards Value Semantics
  • Compiler Generated Functions
  • Move Semantics
  • Class Design

Classic Design Patterns Revisited

  • Command
  • Prototype
  • Strategy
  • Observer
  • Visitor
  • Decorator
  • Template Method
Modern Design Patterns
  • Type Erasure
  • CRTP
  • Expression Templates
  • Policy Based Design

Course Instructor

Klaus Iglberger

Klaus Iglberger is a freelancing C++ trainer and consultant and is currently on the payroll of Siemens in Nuremberg, Germany. He has finished his PhD in computer science in 2010 and since then is focused on large-scale C++ software design. He shares his experience in popular advanced C++ courses around the world (mainly in Germany, but also the EU and US). Additionally, he is the initiator and lead designer of the Blaze C++ math library and the organizer of the Munich C++ user group.