From the course: C++ Design Patterns: Behavioral
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Implementing the Chain of Responsibility pattern - C++ Tutorial
From the course: C++ Design Patterns: Behavioral
Implementing the Chain of Responsibility pattern
- [Instructor] Now that we've learned the basics of the chain of responsibility pattern. Let's take a look at a concrete example of what this pattern might look like in code. So I mentioned previously that the chain of responsibility pattern could be used to implement string validation. And that's the example we're going to be looking at here. More specifically, let's say that a user is trying to create an account for our application and we therefore have three strings we need to validate, right. The first one is the user's name. The second is their email address. And the third is their password. Each of these strings is going to have a different set of criteria, obviously that it's required to meet. So for the email address, for example. We're obviously going to need to make sure that what the user has entered is actually an email address. And for the password we'll need to make sure that it's the right length, that the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
The Chain of Responsibility pattern3m 57s
-
(Locked)
Implementing the Chain of Responsibility pattern7m 27s
-
(Locked)
Create Chain of Responsibility handlers7m 35s
-
(Locked)
The Command pattern3m 56s
-
(Locked)
Implementing the Command pattern4m 14s
-
(Locked)
Increasing code reuse with commands3m 28s
-
(Locked)
The Mediator pattern4m 13s
-
(Locked)
Implementing the Mediator pattern9m 1s
-
(Locked)
Using the Mediator from inside other classes6m 51s
-
(Locked)
The Observer pattern2m 54s
-
(Locked)
Creating publishers7m 48s
-
(Locked)
Creating subscribers5m 34s
-
(Locked)
Project: Create a group-chat program7m 32s
-
(Locked)
Challenge: Apply the Command pattern1m 2s
-
(Locked)
Solution: Apply the Command pattern6m 26s
-
-
-
-