Design Patterns in C++: Structural - Façade to Proxy

This course will teach you about structural design patterns and their implementation in modern C++. It covers the Façade, Flyweight, Null Object, and Proxy patterns.
Course info
Rating
(23)
Level
Intermediate
Updated
Jun 23, 2016
Duration
1h 46m
Table of contents
Description
Course info
Rating
(23)
Level
Intermediate
Updated
Jun 23, 2016
Duration
1h 46m
Description

The correct application and recognition of design patterns is an important skill for developers and architects. This course, Design Patterns in C++: Structural - Façade to Proxy, is part of a multi-series course on C++ patterns, and it introduces you to structural design patterns. It covers the Façade, Flyweight, Null Object, and Proxy design patterns, showing different ways in which these patterns can be implemented in modern C++ (C++ 11 and beyond). First, you'll learn about Façade. The Façade pattern attempts to hide the interface of a complicated system (often involving several components and their relationships) behind a single, easy-to-use interface. Next, you'll learn about Flyweight, which is used to save up on memory by sharing as much data as is possible with similar objects. After that you'll learn about Null Objects, which lets you provide a neutered, no-op object which conforms to the interface but does absolutely nothing at all. Finally, you'll learn about Proxy design patterns, which lets an object 'stand in' for another object, conforming to the same interface while performing additional operations. By the end of this course, you should be able to recognize these design patterns in other libraries and you'll be able to then apply these patterns in your own work.

About the author
About the author

Dmitri is a developer, speaker, podcaster, technical evangelist and wannabe quant.

More from the author
ReSharper Fundamentals
Intermediate
2h 54m
Apr 28, 2017
More courses by Dmitri Nesteruk
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi there, my name is Dmitri, and I'm very happy to welcome you to my course on the Structural Design Patterns - Facade to Proxy. Now I work as an independent quantitative analyst and trader, and I apply my knowledge of C++ to work on the financial markets. This course happens to be part three of a five-course series on C++ design patterns, and it also constitutes the second half of the structural design patterns. Now structural patterns are design patterns which I use to build constructs, which identify specific relationships between entities. So in this particular course we're going to look at four such patterns. We'll talk about Facade, Flyweight, Null Object, and Proxy. And by the end of this course you should be able to recognize these design patterns in other libraries and code that you read, and you should also know how to apply these patterns in your work. Before beginning the course you should be reasonably familiar with programming using the C++ programing language. And from here on you are welcome to check out other courses in the C++ Design Patterns series, as well as other general C++ courses here on Pluralsight. So I hope you'll join me in this journey to learn the structural design patterns in this course here on Pluralsight.

Flyweight
Hi, and welcome to the second module of this course. Now in this module we're going to talk about the Flyweight design pattern. So what are we going to take a look at? Well, first of all, as always, we'll talk about the motivation for using the Flyweight design pattern, and then we'll take a look at two different examples. So the first example is going to be an example of a massively multiplayer online game, like an MMORPG. And the scenario we're going to take a look at is twofold. So first of all we're going to try and implement the Flyweight pattern by hand, just by using the kind of C++ that we have available nowadays, but then we'll actually use Boost. Flyweight to save some of the effort that's required to implement the Flyweight pattern. And the second example will take us back to the text console that we've already seen in the previous module, and in this scenario what we're going to add is a bit of formatting to the text that we output on the screen, and we'll see how to apply the Flyweight pattern there as well.

Null Object
In this rather brief module we'll talk about the Null Object pattern. And the structure of this module is rather simple because we're going to take a look at the motivation for using the Null Object pattern, and then we'll actually implement it and see what it looks like in code.

Proxy
Welcome. This is the last module in the course, and in this module we're going to talk about the Proxy design pattern. So, as always, we'll begin by talking about the motivation for using the Proxy pattern. Then we'll take a look at a very simple and well-known implementation of proxies in the standard library, specifically the smart pointers and the way they are effectively proxies of role pointers. And then we'll end up building some proxies of our own, specifically we'll build a virtual proxy, we'll build a communication proxy, and we'll also talk about the differences between Proxy and Decorator design patterns, because those may appear to be quite similar.