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 3 ай бұрын
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 :)
В ДЕТСТВЕ СТРОИШЬ ДОМ ПОД СТОЛОМ
00:17
SIDELNIKOVVV
Рет қаралды 1,9 МЛН
100❤️ #shorts #construction #mizumayuuki
00:18
MY💝No War🤝
Рет қаралды 20 МЛН
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 40 МЛН
The SECRETS Of Successful Software Architects
10:56
Continuous Delivery
Рет қаралды 10 М.
Pairin' with Aaron: Intro to Hacking on CRuby
1:02:28
Tenderlove's Cool Stuff
Рет қаралды 667
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 177 М.
Arenas, strings and Scuffed Templates in C
12:28
VoxelRifts
Рет қаралды 76 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 887 М.
The Composite Pattern - Programming Design Patterns - Ep 9 - C++ Coding
29:34
Code, Tech, and Tutorials
Рет қаралды 1,7 М.
Why Is Lua So Popular?
8:03
Awesome
Рет қаралды 83 М.
Rust and RAII Memory Management - Computerphile
24:22
Computerphile
Рет қаралды 214 М.
wireless switch without wires part 6
0:49
DailyTech
Рет қаралды 977 М.
Карточка Зарядка 📱 ( @ArshSoni )
0:23
EpicShortsRussia
Рет қаралды 552 М.
Очень странные дела PS 4 Pro
1:00
ТЕХНОБЛОГ ГУБАРЕВ СЕРГЕЙ
Рет қаралды 384 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 19 МЛН