Design Patterns in Modern C++
4.3 (2 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
50 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Design Patterns in Modern C++ to your Wishlist.

Add to Wishlist

Design Patterns in Modern C++

Discover the modern implementation of design patterns with С++
New
4.3 (2 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
50 students enrolled
Created by Dmitri Nesteruk
Last updated 9/2017
English
English [Auto-generated]
Current price: $10 Original price: $100 Discount: 90% off
5 hours left at this price!
30-Day Money-Back Guarantee
Includes:
  • 12 hours on-demand video
  • 1 Article
  • 68 Supplemental Resources
  • 21 Coding exercises
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Recognize and apply design patterns
  • Refactor existing designs to use design patterns
  • Reason about applicability and usability of design patterns
  • Learn how to use different aspects of Modern C++
View Curriculum
Requirements
  • Good understanding of C++
  • Awareness of features of Modern C++ (11/14/17/...)
  • Understanding of OOP (encapsulation, polymorphism, inheritance)
Description

Course Overview

This course provides a comprehensive overview of Design Patterns in Modern C++ from a practical perspective. This course in particular covers patterns with the use of:

  • The latest versions of the C++ programming language
  • Use of modern programming approaches: dependency injection, use of coroutines, and more!
  • Use of modern developer tools such as CLion and ReSharper C++
  • Discussions of pattern variations and alternative approaches

This course provides an overview of all the Gang of Four (GoF) design patterns as outlined in their seminal book, together with modern-day variations, adjustments, discussions of intrinsic use of patterns in the language.

What are Design Patterns?

Design Patterns are reusable solutions to common programming problems. They were popularized with the 1994 book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, John Vlissides, Ralph Johnson and Richard Helm (who are commonly known as a Gang of Four, hence the GoF acronym).

The original book was written using C++ and Smalltalk as examples, but since then, design patterns have been adapted to every programming language imaginable: Swift, C#, Java, PHP and even programming languages that aren't strictly object-oriented, such as JavaScript.

The appeal of design patterns is immortal: we see them in libraries, some of them are intrinsic in programming languages, and you probably use them on a daily basis even if you don't realize they are there.

What Patterns Does This Course Cover?

This course covers all the GoF design patterns. In fact, here's the full list of what is covered:

  • SOLID Design Principles: Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion Principle
  • Creational Design Patterns: Builder, Factories (Factory Method and Abstract Factory), Prototype and Singleton
  • Structrural Design Patterns: Adapter, Bridge, Composite, Decorator, Façade, Flyweight and Proxy
  • Behavioral Design Patterns: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Null Object, Observer, State, Strategy, Template Method and Visitor

Who Is the Course For?

This course is for C++ developers who want to see not just textbook examples of design patterns, but also the different variations and tricks that can be applied to implement design patterns in a modern way.

Presentation Style

This course is presented as a (very large) series of live demonstrations being done in JetBrains CLion. Most demos are single-file, so you can download the file attached to the lesson and run it in CLion, XCode or another IDE of your choice (or just on the command line).

This course does not use UML class diagrams; all of demos are live coding.

Who is the target audience?
  • Beginner and experienced C++ software developers
  • Developers interested in implementations of design patterns
  • Computer scientists
Compare to Other Design Pattern Courses
Curriculum For This Course
127 Lectures
11:53:52
+
Introduction
1 Lecture 05:38

A taste of things to come... and yes, this is a course on Design Patterns. Join in, it should be a lot of fun!

Preview 05:38
+
SOLID Design Principles
7 Lectures 52:08

What are SOLID principles, where do they come from and why do we care?

Overview
00:52

A look at the Single Responsibility Principle, which states that a class should only have one reason to change. Also tied to the concept of Separation of Concerns which is basically stating the same thing.

Preview 06:48

A discussion of the Open-Closed Principle, which states that classes should be open for extension, but closed for modification. In other words, you should extend functionality using interfaces and inheritance rather than jumping back into already-written/tested code and adding to it or changing it.

This lesson also demonstrates the Specification pattern.

Open-Closed Principle
14:51

The Liskov Substitution Principle states that subtypes should be substitutable for their base types.

Liskov Substitution Principle
07:17

The Interface Segregation Principle is simple: don't throw everything in the kitchen sink into an interface because then all its users will have to implement things they do not need. Instead, split the interface into several smaller ones.

Interface Segregation Principle
06:33

Not to be confused with dependency injection, dependency inversion specifies that high-level modules should not depend on low-level ones; both should depend on abstractions. Confusing, huh?

Dependency Inversion Principle
13:21

A summary of the things we've learned in this section of the course.

Summary
02:26
+
Builder
7 Lectures 45:19

A discussion of the Builder pattern and what it's used for.

Overview
01:43

A look at why you'd want to have a builder in the first place.

Life Without Builders
03:50

We implement a simple builder for constructing trees of HTML elements.

Builder
06:40

We make the builder fluent by returning this from builder methods.

Fluent Builder
09:02

Not so much a Builder pattern, but a clever way of using uniform initializer syntax to create a DSL for easily defining HTML constructs in a familiar manner.

Groovy-Style Builder
08:12

We look at a more complicated builder facade that exposes several sub-builders (builder facets) for building up parts of an object in a fluent manner.

Builder Facets
14:55

Builder Coding Exercise
1 question

A summary of the things we've learned about the Builder pattern.

Summary
00:57
+
Factories
8 Lectures 36:52

A discussion of the general concept of factories and the two design patterns: Factory Methods and Abstract Factory.

Overview
03:20

A scenario where having a factory interface actually makes sense.

Point Example
04:05

Implementing a factory method, as an alternative to a constructor, is easy.

Factory Method
04:00

When you want all the factory methods in a separate class.

Factory
03:59

An external factory needs the created object's constructor to be public. But what if you want it to be private? There are two solutions here: you either make a friend class or, alternatively, stick a factory into the class whose instance it creates!

Inner Factory
04:02

Sometimes, you want abstract factories with abstract objects; we support DIP but break OCP in the process.

Abstract Factory
12:25

Thanks to constructs such as std::function, we can express factories in a purely functional way.

Functional Factory
03:46

Factory Coding Exercise
1 question

A summary of the things we've learned about factories.

Summary
01:15
+
Prototype
6 Lectures 33:24

A discussion of the Prototype factory (not to be confused with a rather good game of the same name) and what it's used for.

Overview
01:59

A sample scenario where the Prototype pattern is relevant.

Record Keeping
06:33

We implement the Prototype design pattern by making copy constructors.

Prototype
05:02

If you find using prototypes a lot, and you need many of them, why not put them into a separate class? Separation of concerns!

Prototype Factory
07:09

One common approach to the Prototype pattern is to serialize-deserialize data. But you need to support it explicitly in each type you use.

Prototype via Serialization
11:33

Prototype Coding Exercise
1 question

A summary of all the things we've learned about the Prototype pattern.

Summary
01:08
+
Singleton
7 Lectures 31:22

Ahh, the much maligned Singleton... is it really that evil? Let's find out...

Overview
02:43

Let's put together a simple implementation of Singleton before we start to embellish it with additional traits.

Singleton Implementation
06:52

So, what's wrong with the Singleton? Well, hard dependencies on singletons are hard to test.

Testability Issues
05:04

In order to write a unit test that uses a singleton, we must abstract it away. This is typically done by extracting the singleton's interface and then taking that interface as a dependency (e.g., a constructor parameter). This way, you can supply a fake object instead, thereby getting a true unit test instead of an integration test.

Singleton in Dependency Injection
06:24

The only socially acceptable way of using a singleton is when you inject it as a dependency. DI containers allow you to configure a singleton lifetime for a component.

Singleton Lifetime in DI Container
05:40

The Monostate design pattern is a bizarre variation on the Singleton: it's a type that appears just as an ordinary type (meaning you can construct multiple instances), but all its fields are actually private and static and are exposed with non-static getters and setters. More of a scientific curiosity rather than a viable design solution, this one.

Monostate
02:49

Singleton Coding Exercise
1 question

A summary of all the things we've learned about the Singleton design pattern.

Summary
01:50
+
Adapter
4 Lectures 20:12

An overview of the Adapter design pattern.

Overview
02:36

Let's look at a visual demonstration for a change. This MFC application can only render points, but all we have are lines. We need an adapter!

Vector/Raster Demo
09:12

It just so happens that an adapter generates lots of temporaries. Let's see if we can add some caching to reduce the workload.

Adapter Caching
07:14

Adapter Coding Exercise
1 question

A summary of all the things we've learned about the Adapter design pattern.

Summary
01:10
+
Bridge
4 Lectures 19:23

A look at the Bridge design pattern...

Overview
01:46

Pimpl Idiom
08:54

Bridge Implementation
08:22

Bridge Coding Exercise
1 question

A summary of all the things we've learned about the Bridge design pattern.

Summary
00:21
+
Composite
5 Lectures 33:25

A discussion of what the Composite pattern is for and how it's used.

Overview
01:53

Let's implement the Composite pattern by considering individual geometric shapes as well as grouping of shapes.

Geometric Shapes
04:34

Let's apply the Composite pattern to the implementation of simple neural networks (individual neurons and layers of neurons).

Neural Networks
15:19

Having individual fields with getters and setters is all fine until you want to perform aggregate operations on all the available fields. This calls for an alternative approach, which is an unusual blend of the Composite and Proxy design patterns.

Array-Backed Properties
09:37

Composite Coding Exercise
1 question

A summary of all the things we've learned about the Composite design pattern.

Summary
02:02
+
Decorator
5 Lectures 32:04
Overview
01:46

Dynamic Decorator
09:32


Decorators are typically applied to classes, but it is equally possible to build decorators which wrap arbitrary chunks of code.

Functional Decorator
11:18

Decorator Coding Exercise
1 question

A summary of all the things we've learned about the Decorator design pattern.

Summary
01:07
15 More Sections
About the Instructor
Dmitri Nesteruk
4.6 Average rating
1,316 Reviews
12,118 Students
15 Courses
Quant Finance • Algotrading • Software/Hardware Engineering

Dmitri Nesteruk is a developer, speaker and podcaster. His interests lie in software development and integration practices in the areas of computation, quantitative finance and algorithmic trading. His technological interests include C#, F# and C++ programming as well high-performance computing using technologies such as CUDA. He has been a C# MVP since 2009.

Dmitri is a graduate of University of Southampton (B.Sc. Computer Science) where he currently holds a position as a Visiting Researcher. He is also an instructor on an online intro-level Quantitative Finance course, and has also made online video courses on CUDA, MATLAB, D, the Boost libraries and other topics.