C++ Software Design

Klaus Iglberger

2-day-workshop
intermediate
advanced
10:00-18:00, Monday, 1st - Tuesday, 2nd July 2024

"The design plays a much more central role in the success of a project than any feature could ever do. Good software is not primarily about the proper use of any feature; rather, it is about solid architecture and design. Good software design can tolerate some bad implementation decisions, but bad software design cannot be saved by the heroic use of features (old or new) alone." (Klaus Iglberger, C++ Software Design)

Good Software Design -- the proper management of dependencies -- is the foundation for the success of a project. The basic building blocks for software design are design patterns. Design patterns have proven themselves invaluable over several decades and thus knowledge about them is essential to design robust, decoupled systems. Modern C++, however, has profoundly changed the way we use C++, how we think about design and implement solutions. This also affects how we implement design patterns.

This training class explores modern C++ software design and the modern forms of classic design patterns. It provides guidelines, idioms and best practices for sustainable and maintainable design, which enables 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 implemented 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;
  • ... understand the benefits of separation of concerns;
  • ... be able to design code with minimum dependencies;
  • ... have an impression of the modern alternatives of classic design patterns;
  • ... have gained knowledge about modern design techniques;
  • ... understand how std::function, std::any, and ranges work;
  • ... favor composition over inheritance;
  • ... know about the importance of value semantics;
  • ... comprehend the advantages of non-intrusive design.



Motivation -- The Vital Role of Software Design Design Patterns -- An Introduction From Reference Semantics to Value Semantics

  • Visitor: The classic GoF implementation
  • Visitor: The modern C++ implementation Design Patterns in Modern C++

Value-Semantics-Based Object-Oriented Programming

  • Strategy (classic and modern, incl. Policy-Based design)
  • Command
  • Prototype
  • Bridge (incl. the fast pimple idiom)
  • External Polymorphism
  • Type Erasure
  • Decorator
  • CRTP
  • Expression Templates
  • Adapter

Software Design
Design Patterns
Value Semantics
Book now

Klaus Iglberger

Klaus Iglberger is a freelance C++ trainer and consultant. He shares his expertise in popular C++ courses — from beginner to advanced — all around the world. He is the author of “C++ Software Design” [1], one of the organizers of the Munich C++ user group [2], and the (co-)organizer of the Back-to-Basics [3] and Software Design [4] tracks at CppCon [5].

[1] https://learning.oreilly.com/library/view/c-software-design/9781098113155/ [2] https://www.meetup.com/MUCplusplus/ [3] https://cppcon.org/b2b/ [4] https://cppcon.org/softwaredesign/ [5] https://cppcon.org