Structural Design Patterns in Modern C++

Video description

With design patterns, it is very easy to solve common object-oriented design problems. However, understanding and learning design patterns is tough and time-consuming. This course will help you get acquainted with design patterns and teach you some useful techniques to implement them in modern C++.

The course starts with an introduction to design patterns and explains the structure of a pattern with the help of a Unified Modeling Language (UML) class diagram. Then, you will understand how to implement a design pattern, how to examine the issues, and how to refactor the code by studying different types of design patterns such as adapter, façade, proxy, decorator, composite, bridge, and flyweight. 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 in various structural design patterns and will have developed the skills to implement them in modern C++.

What You Will Learn

  • Use the adapter pattern to convert an incompatible interface into a compatible one
  • Control access to the original object using the proxy pattern
  • Form larger structures through recursive composition using the composite pattern
  • Simplify complex interfaces of a system using the façade pattern
  • Enable sharing of large number of objects using the flyweight pattern
  • Use the decorator pattern to add more behaviors to an object at runtime

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
    1. Course Overview
    2. Introduction to Design Patterns
    3. Overview of Unified Modeling Language (UML) Class Diagrams
    4. Single-Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion (S.O.L.I.D.) Principles – Part I
    5. Single-Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion (S.O.L.I.D.) Principles – Part II
    6. Single-Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion (S.O.L.I.D.) Principles – Part III
    7. Structural Design Patterns Overview
  2. Chapter 2 : Adapter Design Pattern
    1. Introduction to the Adapter Pattern
    2. Basic Example
    3. Game Input
    4. Using the Adapter Pattern
    5. Adapter Implementation
    6. Class Adapter
    7. Pros and Cons
  3. Chapter 3 : Façade Design Pattern
    1. Introduction to the Façade Pattern
    2. Basic Example
    3. Console Project – Part I
    4. Console Project – Part II
    5. Console Project – Part III
    6. Console Project – Part IV
    7. Console Façade for Linux
    8. Pros and Cons
  4. Chapter 4 : Proxy Design Pattern
    1. Introduction to the Proxy Pattern
    2. Basic Example
    3. Introducing Virtual Proxy
    4. Implementing Virtual Proxy
    5. Applying Virtual Proxy
    6. Introduction to Protection Proxy
    7. Protection Proxy Example
    8. Applying Protection Proxy
    9. Remote Proxy Introduction
    10. Example of the Remote Proxy
    11. Using the Remote Proxy as a Component Object Model (COM) Component
    12. Smart Proxy
    13. Pros and Cons
  5. Chapter 5 : Decorator Design Pattern
    1. Introduction to the Decorator Pattern
    2. Basic Example
    3. Adding the Abstract Decorator Class
    4. Implementing and Applying Streams
    5. Adding Buffering to Streams
    6. Adding the BufferedStream Class
    7. Adding Encryption and Compression Support to Streams
    8. Using Composition Instead of Inheritance
    9. Adding the Abstract Decorator Class to Stream Class Hierarchies
    10. Decorator Types
    11. Static Decorator
    12. Functional Decorator
    13. Pros and Cons
  6. Chapter 6 : Composite Design Pattern
    1. Introduction to the Composite Pattern
    2. Composite Intent and Implementation Overview
    3. Basic Example
    4. User Interface (UI) Example Overview
    5. User Interface (UI) Example – Part I
    6. User Interface (UI) Example – Part II
    7. User Interface (UI) Example – Part III
    8. Pros and Cons
  7. Chapter 7 : Bridge Design Pattern
    1. Introduction to the Bridge Pattern
    2. Bridge Intent and Implementation Overview
    3. Basic Example
    4. Shapes Hierarchy and Implementing the Line Class
    5. Adding More Shape Classes
    6. Adding Support for Rendering through OpenGL
    7. Shapes Hierarchy Issues
    8. Bridge Implementation
    9. Handle-Body
    10. Creating the String Class
    11. Implementing Sharing for String Objects
    12. Pointer to IMPLementation (Plmpl) – Part I
    13. Pointer to IMPLementation (Plmpl) – Part II
    14. Static Bridge
    15. Pros and Cons
  8. Chapter 8 : Flyweight Design Pattern
    1. Introduction to the Flyweight Pattern
    2. Intent and Implementation Overview
    3. Basic Implementation
    4. Game Implementation – Part I
    5. Game Implementation – Part II
    6. Game Implementation – Part III
    7. Creating String Class
    8. Adding StringInfo for Sharing Internal Strings
    9. Implementing String Interning
    10. Boost.Flyweight
    11. Pros and Cons

Product information

  • Title: Structural Design Patterns in Modern C++
  • Author(s): Umar Lone
  • Release date: November 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781801073073