C++ Strategy Design Pattern - Part 1 of 2 - Changing Algorithmic Behavior

  Рет қаралды 1,330

Mike Shah

Mike Shah

Күн бұрын

►Software Design and Design Patterns Playlist: • C++ Software Design an...
►Find full courses on: courses.mshah.io/
►Join as Member to Support the channel: / @mikeshah
►Lesson Description: In this lesson we talk about how to change algorithmic behavior at run-time by using inheritance for use in the strategy pattern. We typically choose to create a inheritance hierarchy when we have a family of related algorithms that could be called based on some condition at compile-time or run-time. In this video, we'll try to motivate the strategy pattern, and further understand where we may use the strategy pattern in applications. Stay tuned to the next video for an implementation!
►KZbin Channel: / mikeshah
►Please like and subscribe to help the channel!
►Join our free community: courses.mshah.io/communities/...

Пікірлер: 18
@nrnjn8547
@nrnjn8547 3 ай бұрын
Hell yee, I was waiting for this. I'm using your videos along with the gang of 4 book, to understand design patterns
@MikeShah
@MikeShah 3 ай бұрын
Awesome!
@danielabouelezz6448
@danielabouelezz6448 3 ай бұрын
Love your explanation, although I am still a beginner but i found it interesting to watch the whole video. I am very good with data structures now, so do you think I should be learning design pattern or what is my next step.
@MikeShah
@MikeShah 2 ай бұрын
Yes, next step is to give it a try to implement based on the explanation. Next video will also provide a walkthrough. Otherwise, next steps are to also consider a project (e.g. a small game) to put everything together.
@VoidloniXaarii
@VoidloniXaarii 2 ай бұрын
Omg, so exciting, thank you. I usually feel like sh.. When think of this stuff, so thanking of u talk about this ❤
@MikeShah
@MikeShah 2 ай бұрын
Cheers, enjoy!
@Chupe_chupe
@Chupe_chupe 2 ай бұрын
Great video
@MikeShah
@MikeShah 2 ай бұрын
Cheers!
@hoangbuihp2974
@hoangbuihp2974 2 ай бұрын
yes sir, I have waited for this alot of time. And I want to know whether you will teach about linux in the future
@MikeShah
@MikeShah 2 ай бұрын
I can put something together
@MikeShah
@MikeShah 2 ай бұрын
Not sure on timeline -- but doing some videos on terminal is something that I am actively drafting
@hoangbuihp2974
@hoangbuihp2974 2 ай бұрын
thanks @@MikeShah i hope you will be knowed by more people in the future because your tutorial is extremely good
@MikeShah
@MikeShah 2 ай бұрын
Cheers!@@hoangbuihp2974
@AlanMardi
@AlanMardi 2 ай бұрын
Thanks for great topic! Looking forward to part 2. I have a question: why do double check { threshold >= 16, threshold >= 64 ... } in each "else if" though they already excluded in preceding if's?
@MikeShah
@MikeShah 2 ай бұрын
Would want the conditional to be true if threshold is between a value 🙂
@AlanMardi
@AlanMardi 2 ай бұрын
@@MikeShah hmm, I'm a bit confused :) I mean what is the pofit of: if (thr < 16) do_A() else if (thr >= 16 && thr < 64) // ? thr >= 16 do_B(); comparing to: if (thr < 16) do_A() else if (thr < 64) // no chance to call do_B() with (thr < 16) anyway, program will never even try to check it do_B(); I would even more likely add lower limit to check the 1st "if" entry: if (thr >=0 && thr < 16) ... but not sure why to do this for following "else if"s :)
@MikeShah
@MikeShah 2 ай бұрын
Ah yes, you are right that would be the equivalent, and perhaps even save some cycles. I was being a bit too explicit I suppose :)@@AlanMardi
@AlanMardi
@AlanMardi 2 ай бұрын
@@MikeShah I see :) Really love explicit syntax, though this one is too dangerous for me as requires to change pairs of numbers to tweak thresholds. At some point I will definately miss it and change just one number, so code will compile and pass most unit tests, but still work not as expected :)
100❤️ #shorts #construction #mizumayuuki
00:18
MY💝No War🤝
Рет қаралды 20 МЛН
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 35 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 13 МЛН
Dynamic #gadgets for math genius! #maths
00:29
FLIP FLOP Hacks
Рет қаралды 19 МЛН
Strategy Design Pattern
11:32
Derek Banas
Рет қаралды 744 М.
How to Align Your Navel Correctly With Yogacharya Dhakaram
0:40
Yogacharya Dhakaram
Рет қаралды 147 МЛН
VIM SETUP FOR COMPETETIVE PROGRAMMING C++ | VIM
5:43
A7Lavinraj
Рет қаралды 2 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 177 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
You can't bounce a ball under a table
12:54
Steve Mould
Рет қаралды 4,6 МЛН
What model of phone do you have?
0:16
Hassyl Joon
Рет қаралды 74 М.
Не обзор DJI Osmo Pocket 3 Creator Combo
1:00
superfirsthero
Рет қаралды 1,3 МЛН