Blog 8 min read

Book Review: C++ Software Design by Klaus Iglberger

Share this article
Book Review: C++ Software Design by Klaus Iglberger

Klaus Iglberger's C++ Software Design: Design Principles and Patterns for High-Quality Software fills a long-standing gap in technical literature. While classical design pattern books focus heavily on object-oriented hierarchies and virtual dispatch (often resulting in pointer-heavy, dynamic allocations), Iglberger re-evaluates software design through the lens of Modern C++ (C++11 through C++20).

The central thesis of the book is simple yet powerful: Software design is the art of managing dependencies to keep code readable, testable, and maintainable. Instead of treating classic design patterns as rigid inheritance structures, Iglberger demonstrates how modern language constructs—such as value semantics, std::variant, templates, concepts, and type erasure—allow developers to achieve high levels of decoupling without sacrificing performance.

Key Structural Pillars & Content Breakdown

The book is structured around practical guidelines, moving systematically from fundamental design philosophy to advanced pattern implementations:

1. Re-evaluating Design & Dependency Management

Iglberger begins by defining what software architecture actually means in C++. He argues that poor design manifests as artificial coupling—where changing a single component cascades into full-codebase re-compilations.

  • Focus on Testability: The book stresses that untestable code is a direct byproduct of tight coupling.
  • SOLID Principles Revisited: Rather than repeating textbook definitions, Iglberger evaluates SOLID (especially the Single Responsibility Principle and Dependency Inversion Principle) specifically for C++ compilation models, header inclusions, and link-time dependencies.

2. Value Semantics vs. Reference Semantics

One of the book's strongest contributions is its contrast between classical OOP (reference semantics) and idiomatic modern C++ (value semantics).

  • Reference Semantics (Classic GoF): Relies on base classes, virtual functions (vtable lookups), dynamic allocations (std::shared_ptr/std::unique_ptr), and deep reference graphs.
  • Value Semantics (Modern C++): Focuses on value types, stack allocation, deterministic lifetimes, and non-intrusive abstractions.

Iglberger argues persuasively that value semantics lead to easier reasoning, better memory locality (cache efficiency), and fewer heap-allocation pitfalls—critical considerations for embedded and real-time systems.

3. Modernizing Classic GoF Patterns

The core of the book systematically revisits classical design patterns and transforms them using modern idioms:

  • The Visitor Pattern: Traditional Visitor requires intrusive accept() methods and double dispatch across class hierarchies. Iglberger contrasts this with modern non-intrusive visitors using std::variant and std::visit, eliminating base class dependencies entirely.
  • The Strategy Pattern: Instead of abstract strategy base interfaces with virtual calls, the book illustrates compile-time strategy injection via template policies (std::function or template type parameters), avoiding dynamic memory and vtable overhead.
  • Type Erasure (std::function, std::any paradigm): The book dedicates substantial detail to manually building non-intrusive Type Erasure wrappers (similar to std::function or std::any). This pattern offers the flexibility of dynamic polymorphism without forcing classes to inherit from a common base interface.
  • Observer and Command Patterns: Modernized using lambda expressions, std::function, and value-based task queues rather than raw pointer registration.

Major Strengths

  1. Practical Code-First Approach: Every pattern and architectural principle is backed by clean, modern C++ code snippets rather than abstract UML diagrams alone.
  2. Focus on Non-Intrusive Design: The book continually pushes for abstractions that do not force domain types to inherit from framework base classes, keeping core logic clean and independent.
  3. Performance Awareness: Unlike generic OOP literature, Iglberger remains sensitive to C++ performance considerations—addressing indirection costs, cache misses, and dynamic allocations throughout.
  4. Tooling & Compilation Realities: Excellent awareness of how C++ compilers, include guards, forward declarations, and modules impact build times and structural boundaries.

Nuances & Considerations

  • Not a Beginner's Book: Readers are expected to already understand C++ basics, template syntax, move semantics, and basic standard library components.
  • Template-Heavy Idioms: Some modern implementations (such as hand-crafted Type Erasure or template metaprogramming tricks) increase code complexity inside the implementation layer to keep caller code simple. Engineering teams must balance this against maintainability for junior developers.

Why We Loved This Book

At CppDepend, our core mission has always been to help developers visualize, measure, and enforce clean software architecture. Reading Klaus Iglberger's C++ Software Design felt like reading a theoretical twin to our own engineering philosophy.

What makes this book stand out is that Iglberger doesn't treat software design as an abstract, academic discipline or a rigid set of 1990s inheritance patterns. Instead, he treats it as the practical science of managing dependencies, balancing trade-offs, and keeping codebases resilient over time.

Here is why this book resonated so strongly with us and where its principles directly converge with CppDepend's architectural rules:

1. The Shared Mission: Low Coupling and High Cohesion

Iglberger repeatedly highlights Low Coupling and High Cohesion as the ultimate goals of good design. He demonstrates how uncontrolled dependencies create "fragile" systems where a change in one module cascades into unexpected breakages across the entire codebase.

  • In the Book: Iglberger shows how modern C++ features—such as std::variant, template policies, and Type Erasure—allow developers to break tight dependencies between domain models and operational logic.
  • In CppDepend: We quantify these exact relationships using metrics like Coupling Between Objects (CBO) and Lack of Cohesion in Methods (LCOM). Where Iglberger warns against tight coupling in theory, CppDepend's dependency matrices make those hidden coupling paths immediately visible and flag them before they accumulate into technical debt.

2. The Abstractness vs. Instability Metric (The Main Sequence)

One of the most satisfying alignments between Iglberger's writing and CppDepend's analysis engine is the focus on Robert C. Martin's Abstractness vs. Instability metric (the Distance from the Main Sequence).

  • In the Book: Iglberger emphasizes the dangers of two architectural extremes: the Zone of Pain (highly concrete modules that are heavily depended upon—rigid and impossible to refactor) and the Zone of Uselessness (highly abstract modules that nobody actually inherits from or uses—unnecessary indirection and over-engineering).
  • In CppDepend: We plot every component in your C++ solution directly onto the Abstractness vs. Instability Graph (A vs I). Iglberger provides the architectural rules for staying on the "Main Sequence"—balancing stability with abstractness—while CppDepend automatically tracks whether your components are drifting into the Zone of Pain.

3. Non-Intrusive Design & Concrete C++ Architecture

Traditional Object-Oriented Design often forces types to inherit from rigid framework interfaces, polluting domain objects with base class pointers and vtable overhead. Iglberger argues passionately for non-intrusive design, where classes remain lightweight, value-based, and uncoupled from infrastructure.

  • In the Book: The author demonstrates how value semantics, compile-time dispatch, and non-member functions keep core business logic clean.
  • In CppDepend: We enforce non-intrusive architecture statically via CQLinq (Code Query LINQ) queries. Architects can write custom checks to flag deep inheritance trees, audit unnecessary virtual functions, and detect header inclusions that violate layer boundaries.

The Verdict

We loved C++ Software Design because it provides the exact mental framework needed to write modern, high-performance C++ systems. It doesn't just tell you how to use syntax; it teaches you why certain designs scale while others collapse under their own weight.

For teams striving to implement Iglberger's principles across real-world codebases, pairing his architectural insights with automated static analysis creates a powerful synergy: Iglberger gives you the blueprint, and CppDepend ensures your codebase never strays from it.