Behavioral Design Patterns in C++

Video description

The course takes a structured approach to explain each pattern, starting with an introduction and then diving into its intent, structure, participants, and communication with the client. The UML class diagram is provided to illustrate the pattern’s structure and how classes interact with each other.

The guide includes a simple example implementation of the pattern, which helps students understand the pattern’s implementation and application in real-life scenarios. However, the course also highlights potential design issues in the example and explains how to refactor and apply the pattern effectively to avoid errors.

One of the key strengths of this guide is that it goes beyond a single implementation of each pattern. Then it discusses multiple implementations of the same pattern, helping students expand their knowledge of the pattern and how it can be applied in different scenarios. The pros and cons of each pattern are also discussed, providing students with a well-rounded understanding of each pattern’s strengths and limitations.

The different types of design patterns that you will study include Strategy, Template Method, Command, Memento, CoR (Chain of Responsibility), Observer, Mediator, Visitor, Interpreter, State, and Iterator. In addition to this, you will also learn about the pros and cons of each pattern.

By the end of this course, you will be well-versed with behavioral design patterns and will have developed the skills to implement them in modern C++.

What You Will Learn

  • Implement behavioral design patterns using modern C++ features
  • See how behavioral design patterns use compile and runtime polymorphism
  • Look at the Strategy, Template Method, and Command design patterns
  • Learn Memento, CoR (Chain of Responsibility), and State design patterns
  • See Observer, Mediator, Visitor, Interpreter, and Iterator design patterns
  • Explore the pros and cons of each design pattern

Audience

If you are a student who wants to get a basic understanding of design patterns; a software developer, project manager, or an architect who wants to understand and implement design patterns in their projects; or a C++ developer who wants to implement design patterns in C++, this course is for you. To get started with this course, it is necessary to have basic knowledge of C++ and object-oriented programming concepts.

About The Author

Umar Lone: Umar Lone is a civil engineer who found his calling in software development. He started teaching C++ and Visual C++ 15 years ago. Currently, he trains software professionals in various software companies in India in different technologies, such as modern C++, advanced C++, STL, design patterns, Android, Unity, Linux, and more. He is extremely passionate about teaching and has trained more than 20,000 software professionals.

An avid gamer, Umar is currently trying his hand at game development in Unity and Unreal. He has a few Android applications to his credit, including one on design patterns. The only thing he likes more than C++ is Modern C++.

Table of contents

  1. Chapter 1 : Introduction to the Course
    1. Why You Should Take This Course
  2. Chapter 2 : Basic Concepts
    1. Introduction to Patterns
    2. Overview of Class Diagram
    3. Overview of Behavioral Patterns
  3. Chapter 3 : Strategy
    1. Introduction
    2. Basic Example
    3. Spreadsheet Application - I
    4. Spreadsheet Application – II
    5. Spreadsheet Application - III
    6. Spreadsheet Application - IV
    7. Spreadsheet Application – V
    8. Dynamic Array - I
    9. Dynamic Array - II
    10. Dynamic Array - III
    11. Dynamic Array - IV
    12. Null Object Pattern
    13. Static Strategy
    14. Function Strategy - I
    15. Function Strategy - II
    16. Non-Member Strategy Pointer
    17. Pros and Cons
  4. Chapter 4 : Template Method
    1. Introduction
    2. Basic Implementation
    3. Document Framework - I
    4. Document Framework - II
    5. Document Framework - III
    6. Template Method - I
    7. Template Method - II
    8. Template Method - III
    9. Pros and Cons
  5. Chapter 5 : Command
    1. Introduction
    2. Intent
    3. Basic Implementation - I
    4. Basic Implementation - II
    5. FindDialog - I
    6. FindDialog - II
    7. TextPad - I
    8. TextPad - II
    9. TextPad - III
    10. TextPad - IV
    11. TextPad - V
    12. TextPad - VI
    13. TextPad - VII
    14. TextPad - VIII
    15. TextPad - IX
    16. Undo - I
    17. Undo - II
    18. Undo - III
    19. Undo - IV
    20. Undo - V
    21. DataList - I
    22. DataList - II
    23. Pros and Cons
  6. Chapter 6 : Memento
    1. Introduction
    2. Basic Implementation
    3. Account Class
    4. Hangman - I
    5. Hangman - II
    6. Hangman - III
    7. Hangman - IV
    8. Hangman - V
    9. Hangman - VI
    10. Pros and cons
  7. Chapter 7 : Chain of Responsibility
    1. Introduction
    2. Basic Implementation
    3. Help System - I
    4. Help System - II
    5. Logging System - I
    6. Logging System - II
    7. Logging System - III
    8. Logging System - IV
    9. Pros and Cons
  8. Chapter 8 : Observer
    1. Introduction
    2. Basic Implementation
    3. Alarm System
    4. Slide Deck - I
    5. Slide Deck - II
    6. Slide Deck - III
    7. Slide Deck - IV
    8. Sensor - I
    9. Sensor - II
    10. Change Manager - I
    11. Change Manager - II
    12. Pros and Cons
  9. Chapter 9 : Mediator
    1. Introduction
    2. Basic Implementation
    3. Chat System - I
    4. Chat System - II
    5. DialogBox - I
    6. DialogBox - II
    7. DialogBox - III
    8. DialogBox - IV
    9. Pros and Cons
  10. Chapter 10 : Visitor
    1. Introduction
    2. Basic Implementation
    3. Shapes Example - I
    4. Shapes Example - II
    5. Shapes Example - III
    6. Shapes Example - IV
    7. Shapes Example - V
    8. Shapes Example - VI
    9. Acyclic Visitor
    10. Generic Acycle Visitor - I
    11. Generic Acycle Visitor - II
    12. Variant
    13. Overload Pattern
    14. Pros and Cons
  11. Chapter 11 : Interpreter
    1. Introduction
    2. Basic Implementation
    3. Lexing and Parsing
    4. Boolean Evaluator
    5. Boolean Interpreter - I
    6. Boolean Interpreter - II
    7. Boolean Interpreter - III
    8. RPN Evaluator - I
    9. RPN Evaluator - II
    10. Pros and Cons
  12. Chapter 12 : State
    1. Introduction
    2. Basic Example
    3. Lamp - I (NoState)
    4. Lamp - II (Enum States)
    5. Lamp - III (State Pattern)
    6. Lamp - IV (Yellow State)
    7. Lamp - V (Factory)
    8. Transition Table - I
    9. Transition Table - II
    10. Methods for States - I
    11. Methods for States - II
    12. Methods for States - III
    13. Methods for States - IV
    14. Pros and Cons
  13. Chapter 13 : Iterator
    1. Introduction
    2. Basic Implementation
    3. Organization - I
    4. Organization - II (Cursor)
    5. Organization - III (Iterator)
    6. Containers - I (Array)
    7. Containers - II (List)
    8. Containers - III (Issues)
    9. Containers - IV (ArrayIterator)
    10. Containers - V (ListIterator)
    11. C++ Iterators - I
    12. C++ Iterators - II
    13. C++ Iterators - III (More Iterators)
    14. Pros and Cons

Product information

  • Title: Behavioral Design Patterns in C++
  • Author(s): Umar Lone
  • Release date: April 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781804615652