Design Patterns - Factory Method Pattern Explanation and Implementation in C++

  Рет қаралды 9,113

Mike Shah

Mike Shah

Күн бұрын

Пікірлер: 35
@anhurtjv
@anhurtjv 2 жыл бұрын
Your video is probably one of the best I have found in how to use design patterns in C++. It is really clear, and the fact that you show in real time what you are doing really helps follow the content.
@MikeShah
@MikeShah 2 жыл бұрын
Thank you for the kind words!
@stevea.b.9282
@stevea.b.9282 6 ай бұрын
Thank you for explaining these patterns so clearly and for keeping it simple. Other sources I tried made them seem very complicated and I almost gave up.. thankfully I came across your channel! I can't thank you enough.
@MikeShah
@MikeShah 6 ай бұрын
Cheers! More coming to this series tomorrow 🙂
@k0185123
@k0185123 6 ай бұрын
amazing. I'm so lucky to have the chance to watch your videos!!!!!
@MikeShah
@MikeShah 6 ай бұрын
Thank you for the kind words!
@user-ql7pw7ld1n
@user-ql7pw7ld1n 4 ай бұрын
Understood fully..loved this :)
@MikeShah
@MikeShah 4 ай бұрын
Cheers!
@bharatpatidar3693
@bharatpatidar3693 2 жыл бұрын
Man i just got the understanding of Factory Design pattern after watching it so easily Thanks a lot 🙏
@MikeShah
@MikeShah 2 жыл бұрын
Cheers, glad to hear it!
@sallaklamhayyen9876
@sallaklamhayyen9876 2 ай бұрын
amazing as always = thank you so much Dr. Mike
@MikeShah
@MikeShah 2 ай бұрын
Cheers!
@Alautun-u9k
@Alautun-u9k Ай бұрын
Thank you Mike, best explanation.
@MikeShah
@MikeShah Ай бұрын
Cheers!
@pratekag
@pratekag 2 жыл бұрын
info vtbl was really cool. thank you.
@MikeShah
@MikeShah 2 жыл бұрын
You are most welcome!
@riamuglihal1860
@riamuglihal1860 2 жыл бұрын
Absolutely loved your teaching style! 🙌 Thanks for the cool tip: --tui
@user-cm2ko8ok9r
@user-cm2ko8ok9r Жыл бұрын
Thanks for the clear explanation and great content. According to refactoring guru, the design pattern "factory method" would have a creator, concrete creators, product, and concrete products. In the example you provided, MakeGameObjectFactory seems to be an object creation function that abstracts away the object creation process and provides an easier way to create objects. I'm wondering if this is a simplified variation of the factory method, or if this still aligns well with the standard factory method? Thanks.
@MikeShah
@MikeShah Жыл бұрын
Cheers -- yes this is an example of a factory method.
@anasmansouri493
@anasmansouri493 Жыл бұрын
thanks a lot for this explanation
@MikeShah
@MikeShah Жыл бұрын
Cheers, you are most welcome
@essmunson
@essmunson Жыл бұрын
_thank you thank you thank you_ for the clear explanation
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@1981Praveer
@1981Praveer 7 ай бұрын
Curious, Is there any reason to use shared_ptr? in general, by default people use unique_ptr.
@MikeShah
@MikeShah 7 ай бұрын
Correct, unique_ptr should be the default that folks reach for. shared_ptr is appropriate if your object is referenced multiple times -- which is what I was thinking about in a gaming context :)
@windowsbuilderthegreat3121
@windowsbuilderthegreat3121 2 жыл бұрын
Does this pattern have to use heap allocation to work
@MikeShah
@MikeShah 2 жыл бұрын
You could make stack allocations or otherwise use a custom allocator to decide where to allocate your new objects. I suppose this depends on the requirements of your design and how much stack space you have. Heap memory (at least on desktops) we have much more memory :)
@maheshshinde6946
@maheshshinde6946 11 ай бұрын
Can we keep factory method as static class method and keep class constructor private? so only from factory method we can create instance of class.
@MikeShah
@MikeShah 11 ай бұрын
You can create a factory as a singleton if that is what you're asking -- sure!
@mohamedericsson7203
@mohamedericsson7203 2 жыл бұрын
Quality content
@MikeShah
@MikeShah 2 жыл бұрын
Cheers, thank you for the kind words!
@larslindved9586
@larslindved9586 Жыл бұрын
Great video!
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@tanveerasif5978
@tanveerasif5978 Ай бұрын
isn't it, same as command pattern ?
@MikeShah
@MikeShah Ай бұрын
Factory is a separate pattern focused on creation of objects 🙂
So Cute 🥰
00:17
dednahype
Рет қаралды 46 МЛН
When you discover a family secret
00:59
im_siowei
Рет қаралды 35 МЛН
The Factory Pattern - Mike Shah - CppCon 2021
1:01:06
CppCon
Рет қаралды 19 М.
Factory Method Pattern Visualized
23:54
Kantan Coding
Рет қаралды 9 М.
What is the Factory Pattern? | Software Design Principles
26:48
Be A Better Dev
Рет қаралды 28 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,3 МЛН
Adapter Pattern - Design Patterns (ep 8)
26:36
Christopher Okhravi
Рет қаралды 242 М.
C++ Weekly - Ep 373 - Design Patterns in "Modern" C++ (2023)
16:49
C++ Weekly With Jason Turner
Рет қаралды 32 М.