4.79 out of 5
4.79
7 reviews on Udemy

Structural Design Patterns in Modern C++

Learn structural design patterns in depth & their implementation in Modern C++
Instructor:
Umar Lone
133 students enrolled
English [Auto]
Understand what structural design patterns are
How structural patterns help create bigger structures through inheritance & composition
Use adapter to convert an incompatible interface into a compatible one
Simply the complex interfaces of a system through facade
Use proxy to control access to an object
Understand how decorator can be used to add more behaviors to an object at runtime
Form larger structures through recursive composition through composite
Enable sharing of large number of objects through flyweight
Separate abstraction & its implementation to provide variations without implementing too many classes

Design Patterns are a way to solve common object oriented design problems. But understanding and learning design patterns is hard and takes time. Looking at a pattern is like looking at a solution without a problem, unless you’ve encountered the problem in the past.

This course aims to help you understand & implement Structural Design Patterns. Each pattern is explained with multiple examples and through modern C++. This helps you understand how the pattern can be implemented efficiently using language features. I provide real-world  examples written in Modern C++. These examples will compile & execute on any platform that supports a C++ compiler.

This is how the course teaches creational patterns.

  1. The intent, structure of the pattern is explained through UML class diagram.

  2. Basic implementation details of the pattern are explained.

  3. The pattern is implemented in a simple example.

  4. You get familiar with the overall implementation of the pattern.

  5. Another example is introduced that has design issues the pattern aims to resolve.

  6. We examine the issues and refactor the code by applying the design pattern step by step.

  7. Alternative scenarios & examples are explained along with differences between them. You also learn how to decide between different alternatives.

  8. I discuss the pattern in context of C++ and how to tweak it for performance, reusability & maximum flexibility.

  9. Finally, you’ll learn when to use the pattern and its pros & cons.

This is an intensive discussion that spans multiple lectures. At the end of each section, you’ll understand the pattern in depth and can apply it in your code or easily clear any design interview.

Introduction

1
Introduction

Course introduction.

2
Introduction to Patterns

Understand what a pattern means.

3
Overview of UML Class Diagrams

A quick primer on UML class diagrams.

4
S.O.L.I.D. Principles - I

Understand the basics of SOLID principles. This lecture explains the single responsibility & open closed principle.

5
S.O.L.I.D. Principles - II

Understand the liskov substitution principle.

6
S.O.L.I.D. Principles - III

This lecture explains the interface segregation & depending inversion principle.

7
Structural Patterns Overview

Gives an overview of the structural patterns.

8
Course Material (Slide Deck)

Download the slide deck used in the videos.

Note: The slide deck is password protected & must be opened as read-only when prompted for a password.

Adapter

1
Source Code
2
Introduction

Introduction to the Adapter Pattern.

3
Basic Example

Basic code example of the pattern and the participants & their interactions.

4
Game Input

Game input example.

5
Using Adapter

Understand why we need the adapter pattern.

6
Adapter Implementation

Object adapter implementation in the game.

7
Class Adapter

Example of how to implement a class adapter.

8
Pros & Cons

Pros & cons of the adapter pattern.

Facade

1
Source Code
2
Introduction

Introduction to the facade pattern.

3
Basic Example

Basic implementation of the facade.

4
Console Project - I

Using Console API to write colored text.

5
Console Project - II

Issues with the implementation.

6
Console Project - III

Implementing the Console class as a facade.

7
Console Project - IV

Using the Console class from the client code.

8
Console Facade For Linux

Adding support for Linux.

9
Pros & Cons

Pros & cons of the facade pattern.

Proxy

1
Source Code
2
Introduction

Introduction to the proxy pattern.

3
Basic Example

Basic C++ implementation of the proxy.

4
Virtual Proxy - I

Introduction to the virtual proxy.

5
Virtual Proxy - II

Implementing the Imageviewer application.

6
Virtual Proxy - III

Applying the virtual proxy.

7
Protection Proxy - I

Protection proxy introduction.

8
Protection Proxy - II

Creating the repository example.

9
Protection Proxy - III

Applying the protection proxy.

10
Remote Proxy - I

Introduction to the remote proxy.

11
Remote Proxy - II

Sprite animator example.

12
Remote Proxy - III

Using the remote proxy as a COM component.

13
Smart Proxy

Smart pointer as a proxy.

14
Pros & Cons

Pros & cons of using the proxy.

Decorator

1
Source Code
2
Introduction

Introduction to decorator pattern.

3
Basic Example - I

Basic example of the decorator.

4
Basic Example - II

Adding the abstract Decorator class.

5
Streams - I

Explanation of the Streams application & implementation of file stream classes.

6
Streams - II

Explanation of how to add buffering to streams.

7
Streams - III

Adding the BufferedStream class.

8
Streams - IV

Adding encrypting & compression support to streams.

9
Streams - V

Using composition instead of inheritance.

10
Streams - VI

Adding the Decorator abstract class in both input & output stream class hierarchies.

11
Decorator Types

Discussion on the types of decorators.

12
Static Decorator

Explanation & implementation of static decorator.

13
Functional Decorator

Explanation & implementation of functional decorator.

14
Pros & Cons

Pros & cons of the decorator pattern.

Composite

1
Source Code
2
Introduction

Introduction to composite pattern.

3
Composite Intent & Implementation Overview

Discussion of the intent & implementation overview.

4
Basic Example

Basic implementation of the composite.

5
UI Example Overview

Explanation of the user-interface example.

6
UI Example - I

Adding the UI class hierarchy.

7
UI Example - II

Discussion of the issues in the example.

8
UI Example - III

Adding support for parent pointer.

9
Pros & Cons

Pros & cons of using the composite pattern.

Bridge

1
Source Code
2
Introduction

Introduction to the bridge design pattern.

3
Bridge Intent & Implementation Overview

Intent of the pattern and overview of the implementation.

4
Basic Example

Basic implementation of the bridge pattern.

5
Shapes Hierarchy - I

Discussion of the Shape hierarchy and implementation of the Line class.

6
Shapes Hierarchy - II

Adding the Shape base class.

7
Shapes Hierarchy - III

Adding more shape classes.

8
Shapes Hierarchy - IV

Adding support for rendering through OpenGL.

9
Shapes Hierarchy Issues

Discussion of the issues with the design.

10
Bridge Implementation

Implementing the bridge pattern in the shape drawing application.

11
Handle-Body - I

Discussion of the handle-body idiom.

12
Handle-Body - II

Creating the String class.

13
Handle-Body - III

Implementing sharing for String objects.

14
PIMPL - I

Discussion of the PIMPL idiom.

15
PIMPL - II

Implementing PIMPL to remove compilation dependencies.

16
Static Bridge

Discussion of the static bridge.

17
Pros & Cons

Pros & cons of using the pattern.

Flyweight

1
Source Code
2
Introduction

Introduction to the flyweight pattern.

3
Intent & Implementation Overview

Discussion of the intent & overview of the implementation.

4
Basic Implementation

Basic implementation of the flyweight.

5
Game Implementation - I

Explanation of the 3d models in game.

6
Game Implementation - II

Discussion of the issues and their resolution.

7
Game Implementation - III

Adding the Car class.

8
String Interning - I

Creating the String class.

9
String Interning - II

Adding StringInfo for sharing internal strings.

10
String Interning - III

Completing the string interning implementation.

11
Boost.Flyweight

Using the Boost.Flyweight for interning.

12
Pros & Cons

Pros & cons of using the flyweight pattern.

13
BONUS LECTURE
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.8
4.8 out of 5
7 Ratings

Detailed Rating

Stars 5
5
Stars 4
3
Stars 3
0
Stars 2
0
Stars 1
0
4e953dd9d0c108de264196c8820853fd
30-Day Money-Back Guarantee

Includes

8 hours on-demand video
9 articles
Full lifetime access
Access on mobile and TV
Certificate of Completion