developers, architects
3-4 days

GoF (Gang of Four) Design Patterns is one of the most popular subjects for programming trainings out there. Even though the original book provided coding examples written in C++ and Smalltalk, those patterns are most useful in pure OO programming languages (like Java or C#).

This training provides an alternative approach to this subject. First, it discusses the art of good overload set and class design in detail. In this part of the training, among others, we learn that less is better, how non-member functions influence class encapsulation, what const keyword have in common with multithreading, and many other essential design principles. When we know how to form a well-behaved class properly, we learn a long list of C++-specific idioms that are very useful in the every-day job and which are not included in the GoF book. After that, the training thoroughly covers the subjects of inheritance, polymorphism, and value semantics. In the end, it describes all of the GoF design patterns, presents their intended use cases and implementation, and confronts that with Modern C++ criticism and possible alternatives. Training includes the examples of correct and incorrect implementation of the most popular patterns, and as part of the practical exercises, participants have the opportunity to learn about benefits and the consequences of using each of the approaches.

The training targets C++ developers and code architects that want to improve their skills in designing interfaces and proper classes interaction.

This course builds on top of the knowledge delivered in Modern C++ Design: Part I - Stable and Secure Code training, so please consider requesting them in this order.


  • Emphasis on understanding different use cases of inheritance in C++ language and learning how to reuse this knowledge in own code
  • Understanding the differences between inheritance and polymorphism
  • Learning of different C++ idioms and patterns and their use cases
  • Particular focus on the usage of "C++ templates" in practical tasks
  • Development of error-unfriendly code


The following plan is an initial proposal for the training material. The final agenda is always created based on the individual pre-training analysis of client's requirements and constraints.

  1. Advanced Modern C++ in a nutshell
    1. C++ Types
    2. Value Categories
    3. Name Lookup
    4. Range-based for loop
    5. Special Member Functions
    6. Exception Safety
    7. C++ template definition
    8. Template parameters
    9. Template specialization
    10. Structured binding
    11. std::variant
  2. Stable and Secure Code in a nutshell
    1. Class (de)initilaization
    2. Pointless Pointers
    3. Helper types and idioms
    4. C++ Concepts
    5. C++ Contracts
    6. Selected C++ attributes
    7. Error handling - more than one way to do it
  3. Modern API design guidelines
    1. Overload sets
    2. The art of class design
    3. Rule of 3, 5, 0
    4. Hidden Friends
    5. Proper encapsulation
    6. const
    7. noexcept
    8. Operators overloading
    9. explicit
  4. Modern C++ Idioms
    1. Non-Copyable
    2. RAII
    3. Copy-and-swap
    4. Smart Pointer
    5. Type Traits
    6. Tag dispatch
    7. Policy-based design
    8. EBO
    9. Type Erasure
    10. SOO
    11. Copy-on-write
    12. CRTP
    13. Customization point object (Niebloid)
    14. Singleton
  5. Kinds of Inheritance
    1. Public inheritance
    2. Name hiding
    3. Virtual functions
    4. Pure virtual functions and abstract classes
    5. Interfaces
    6. Virtual Constructor Idiom
    7. Polymorphism and its types
    8. Double dispatch
    9. Private and protected inheritance
    10. Multiple inheritance
    11. RTTI
    12. Value vs Reference Semantics
    13. Concept-based Polymorphism
  6. GoF Design Patterns
    1. Criticism
    2. Creational Design Patterns
    3. Structural Design Patterns
    4. Behavioral Design Patterns
    5. Weak-points of "traditional" implementation
    6. Modern C++ ways to do it
developers, architects
3-4 days


Mateusz Pusz