Yes YES WE LOVE ANALOGIES! Please! Best way of teaching and learning! Starting from the big picture, analogies and then down to the specifics! People seems to want to glorify knowledge sometimes by hitting with the specifics right on their face making them watch and rewatch or just give up on it, but this way u go helps alot!
You've got a follow from me, as you started to explain singleton. I began to see its relation with a global variable just before you confirmed my hunches. Great teaching!
I love the format of your videos... I also love that in your examples of each pattern you are also reducing the nesting and using early exiting which is the opposite of what the people in the repo I'm currently in have done. My first pass for just about and change is 1st to reduce nesting, 2nd try and apply the appropriate pattern (like taking a constructor with 30 params and converting to a builder pattern, or passing in an object which implements the builder pattern, which means now I'm the lucky SoB who gets to go "fix" all the other code), 3rd weep and commit
Oh, and "bless your heart" hit me right in the feels... and pronouncing facade the way JFK might have done it (fah-Kay-d) is how I like to explain it ;)
most of these are intuitive. it's great to formalize these concepts and this video does a great job at providing a high level overview of them. thank you
except singletons, singletons feel like an artifact of enforced oop where oop is enforced by standards or required by the language, they are essentially a way of taking the oop out of oop, a better solution would just be to use procedural code, there is not really a benefit to utilizing oop features like classes and instances if you are just going to put in extra effort to make sure they can only be used just like procedural code
To newer developers - when you learn design patterns you generally think "oh i can use this here!" in every scenario, making design patterns your hammer and every code problem a nail. In my experience as a professional developer I have never - not once - deferred to the Design Patterns book to solve a problem. Everytime I had used one in my personal projects however - it was always an imperfect fit to a similar problem. You could say "skill issue" but I'm just pointing out that you should not worry about these things before you're employed. Just make things!
Newer developers, you shouldn't be making the decision to not study software engineering concepts based off the anecdotes of anonymous RUclips commenters. You will write bad code as you start off. It's inevitable. That's why you practice. Not learning this because of the nebulous idea that you might use it where it "shouldn't be used" is ridiculous.
@@mattwayne9128 There's a lot of things to learn when starting. There's alot of concepts with varying usefulness with building software. The real question is what information is most applicable to getting yourself into a position where you can have good mentorship and stability in learning(employed). If you learn software dev because you're passionate about it - my comment shouldn't dissuade a single person because they'll learn these things from genuine interest (as I did!). I'm advocating for learning relevant skills rather than all skills, which in my, yes, anecdotal experience, would exclude Design Patterns. Otherwise it's easy to fall into a sea of theoretical knowledge with no idea of how to apply it practically! I appreciate your perspective btw
You're not 100% wrong but I made vidéos games and at the end, I was always regretting not making the code more modular for example. It's basically spaghetti code. Design patterns won't make regrets go away but they definitely will make your life easier in the long run for projects you're supposed to build on top of or modify (anything with a long life span)
I would agree if we [in my company] we don't require knowledge about design pattern and usage before employment. I doubt that I will let someone further if they do not know what at least singleton is and how to use it.
This is the most easiest way knowing to concepts of the design patterns I've ever found. Your clean and structured way of teach gives us the only task of learn, as easy as possible. Thanks for this amazing content....
I would love to see the equivalent of many of these patterns for functional programming. Excellent explanation I did not remember the name of some of them but used all of them. 👍
I recently found your channel, and it’s impressive the way you explain things and make fun at the same time. This makes the learning process much better. Thank you! Subscribed 😉🧑🏽💻
Really nice video. First you explained the concept very well, then you showed the practical implementation in codes with real scenarios. This way of video presentations are really helpful to understand the concept. Thanks for your effort and expecting more from you
19:35 There is no downside to using the Strategy pattern. Only upsides! One common practice is that you shouldn't change a tested class. If you have to add if/else everywhere, you will be modifying tested classes. Another common practice is to keep each class small and focused on one thing. Using the Strategy pattern helps accomplish that goal.
A little confused on the example for the observer pattern you gave here regarding performance. You would still have to loop over however many subscribers there are in order for them to get the notification, and assuming that they are all on the same machine, the work will still be done at the same place. So I don't quite understand how there is a performance gain in this specific scenario, unless that was just an analogy for a distributed system?
The main take away is the first example is a PUSH/Notify (e.g. email list, API calls, etc.) and the second example should have been a PULL/Observe (e.g. RSS feed, checking for updates, etc.)
I was initially confused like you for the same reason but after listening closely to what he says in the end after showing the code, my interpretation is that the point he's making is that in example 1 you're looping through subscribers of ALL video channels looking for those that subscribe to your channel in order to notify them, while in example 2 you only loop through the subscribers to your channel, since those are readily available in this case (they were the ones that called the "subscribe" method). But, of course, I might be totally wrong here xD
@@daydreamical Not quite. I don't think the example was the best, but I can see why he used it. Using the Subscriber interface allows you to have many different types of objects subscribe to something happening. Then those objects can control what happens on the notification - because the VideoChannel knows there's an "update()" method. The first approach only allowed a single type of object. You very much still have to loop through each item in the array and call "update()" but how the update happens or what it does is controlled by the subscriber and how it implemented the interface.
@@kadin.h I think I see what you mean but, in my opinion, if that was the point, then it'd be just another example of the "strategy" pattern, not an example of the "observer" pattern. Anyways, probably a better example would be showing that, without the observer pattern, your user objects would be periodically polling the video channel object, trying to find out if there are new uploaded videos (and how that would lead to a lot of wasted processing).
19:54 "And I know this is gonna hurt some feelings. A lot of y'all are just 'IF ELSE-ing, IF ELSE-ing' everything. You know WHO YOU ARE!" Pure gold 😁🤣😂
about subscriber pattern.. i know its useful, and the core of reactive prograaming, but I dont see the advantage in this example. i mean you say loop through users is not performant, but it ends up using a foreach, that is essentially the same. the thing is, i dont think it can be done without looping the array somehow great video as always man
Yeah I was thinking the same thing. I always thought the big improvement it provides is de-coupling things that need to SOMETIMES exchange some data/signals
I believe it would be more useful when let’s say a subscriber only wants to be notified for specific events, not all events. Perhaps a user subscribed to a channel doesn’t want to be notified a new video is released but is still a follower of the channel.
I like how you explain things. Thank you for that! Been subscribed for some time. :) But honestly, freedom units? 😂 Imperial doesn't sound good, anymore? 😅 Keep it up Forest! I like your content, whatever units you like to use. ❤
Take it to the next level by decoupling the factory from explicit class declarations in the base application by using a registry (hashmap) and a module loader, allowing seemingly infinite number of user types which don't rely on a switch
>>I had problem comprehending trading in general. I tried watching other RUclips trading channels, but they made the concepts more complicated. I was almost giving up until when i discovered content and explain everything in detail. The videos are easy to follow
I've been making a lot of looses trying to make profit trading. I thought trading on a demo account is just like trading the real market. Can anyone help me out or at least advise me on what to do?
Trading on a demo account can definitely feel similar to the real market, but there are some differences. It's important to remember that trading involves risks and it's normal to face looses sometimes. One piece of advice is to start small and gradually increase your investments as you gain more experience and confidence. It might also be helpful to seek guidance from experienced traders or do some research on different trading strategies
21:31 The notify private method is doing the wrong thing. It should be emitting an event that the subscriber can listen for. The whole point is that the acting class does not need any collection of who wants the result of the action. You emit the result.
Some framework strategies of dependency injection can be Singleton by default and are easier to test. For example Spring Singleton beans are easy to mock since the guarantee of being Singleton isn't language enforced (it's at a higher abstraction). If you do singletons the old fashion way it's indeed a pain to mock any Singleton or static implementation. Kotlin does make static and its object Singletons easier to mock using Mockk, but i believe there are still some pitfalls to avoid.
Actually singletons, when got from a static method, can be easily mocked by Mockito with mockStatic method. You need to do some try-with-resources though.
I'm schizophrenic( diagnosed) , i feel like i think like you or you think like me, when i solve problems or when imagining examples to articulate my problems!
Try Head First Design Patterns and Uncle Bob's Clean Code, Clean Architecture and also Uncle Bob's talks here on YT and then there's a whole video series on his website cleancoders.
1:30 I have to disagree. The greatest pattern of all times is the Observer pattern. 🙂 In my case I use the radio & antenna as an analogy to explain it to my students.
Singletons are an antipattern. They create a dependency that everyone has to use thats kinda are just magically there. If you need a logger just let the user inject that logger. Its really that easy.
Yes YES WE LOVE ANALOGIES! Please! Best way of teaching and learning! Starting from the big picture, analogies and then down to the specifics! People seems to want to glorify knowledge sometimes by hitting with the specifics right on their face making them watch and rewatch or just give up on it, but this way u go helps alot!
analogy, glory, big, face, OK! is it me with my brained damaged by *orn?
Learning from you is a fun and engaging activity. This is how teaching should be delivered. Structured, concise, and informative 😊
You've got a follow from me, as you started to explain singleton. I began to see its relation with a global variable just before you confirmed my hunches. Great teaching!
I love the format of your videos... I also love that in your examples of each pattern you are also reducing the nesting and using early exiting which is the opposite of what the people in the repo I'm currently in have done. My first pass for just about and change is 1st to reduce nesting, 2nd try and apply the appropriate pattern (like taking a constructor with 30 params and converting to a builder pattern, or passing in an object which implements the builder pattern, which means now I'm the lucky SoB who gets to go "fix" all the other code), 3rd weep and commit
Oh, and "bless your heart" hit me right in the feels... and pronouncing facade the way JFK might have done it (fah-Kay-d) is how I like to explain it ;)
Nesting is really a bane of my coding existence 😭
most of these are intuitive. it's great to formalize these concepts and this video does a great job at providing a high level overview of them. thank you
except singletons, singletons feel like an artifact of enforced oop where oop is enforced by standards or required by the language, they are essentially a way of taking the oop out of oop, a better solution would just be to use procedural code, there is not really a benefit to utilizing oop features like classes and instances if you are just going to put in extra effort to make sure they can only be used just like procedural code
To newer developers - when you learn design patterns you generally think "oh i can use this here!" in every scenario, making design patterns your hammer and every code problem a nail. In my experience as a professional developer I have never - not once - deferred to the Design Patterns book to solve a problem. Everytime I had used one in my personal projects however - it was always an imperfect fit to a similar problem. You could say "skill issue" but I'm just pointing out that you should not worry about these things before you're employed. Just make things!
Newer developers, you shouldn't be making the decision to not study software engineering concepts based off the anecdotes of anonymous RUclips commenters.
You will write bad code as you start off. It's inevitable. That's why you practice. Not learning this because of the nebulous idea that you might use it where it "shouldn't be used" is ridiculous.
Yeah its not a hammer. Its like 23 different tools actually. Hammer included
@@mattwayne9128 There's a lot of things to learn when starting. There's alot of concepts with varying usefulness with building software. The real question is what information is most applicable to getting yourself into a position where you can have good mentorship and stability in learning(employed). If you learn software dev because you're passionate about it - my comment shouldn't dissuade a single person because they'll learn these things from genuine interest (as I did!). I'm advocating for learning relevant skills rather than all skills, which in my, yes, anecdotal experience, would exclude Design Patterns. Otherwise it's easy to fall into a sea of theoretical knowledge with no idea of how to apply it practically! I appreciate your perspective btw
You're not 100% wrong but I made vidéos games and at the end, I was always regretting not making the code more modular for example. It's basically spaghetti code. Design patterns won't make regrets go away but they definitely will make your life easier in the long run for projects you're supposed to build on top of or modify (anything with a long life span)
I would agree if we [in my company] we don't require knowledge about design pattern and usage before employment. I doubt that I will let someone further if they do not know what at least singleton is and how to use it.
I REALLY like the analogies. That's the best way for me to grasp the actual concept. Just found you on RUclips, and I already like the content.
The analogies are spot on! I learned more from this video than the entire book and online tutorials combined about design pattern.
As someone who’s just getting into Java I really enjoy your videos
This is the best class I have ever had about Design Patterns! It is very clear!
that was the smoothest transition to an ad I've ever seen :D :D :D ovations
This is the most easiest way knowing to concepts of the design patterns I've ever found. Your clean and structured way of teach gives us the only task of learn, as easy as possible. Thanks for this amazing content....
This was a really great way to explain it and I understand the patterns a lot better now. Thank you for the video.
Nice explanation, you have a great body language and it helps the viewer to keep watching the video
I would love to see the equivalent of many of these patterns for functional programming. Excellent explanation I did not remember the name of some of them but used all of them. 👍
I recently found your channel, and it’s impressive the way you explain things and make fun at the same time. This makes the learning process much better. Thank you! Subscribed 😉🧑🏽💻
Bro, this is the best thing I've seen in a long time! Keep sharing content like this! 👌
Damn that ad transition was so clean. Got me for a while.
loved the video! the way you describe the patterns is amazing. I'm sending this video to every coder I know. Subscribed!
The only time I paused was when I liked and subscribed you, amazing video man!
I Hope this Video helps me getting some extra points on my Software Engineering exam
I learned more from your video than in the university. Thank you and regards from México
that ad transition was smooth, great informative video!
This was the most easy way to understand all of these standarts. Thanks ;)
this is a great video! fellow java dev here. i'd love to see more java / spring boot stuff! not enough good java / spring boot influencers on YT imo
Really nice video. First you explained the concept very well, then you showed the practical implementation in codes with real scenarios. This way of video presentations are really helpful to understand the concept. Thanks for your effort and expecting more from you
B Rabbit is in the house! I love your videos. You're awesome.
19:35 There is no downside to using the Strategy pattern. Only upsides! One common practice is that you shouldn't change a tested class. If you have to add if/else everywhere, you will be modifying tested classes. Another common practice is to keep each class small and focused on one thing. Using the Strategy pattern helps accomplish that goal.
Great video...puts into words what we already "intuited" but now we "know" the why to these patterns. But "freedom units"?
Huge respect! Great video! You described all of them really well! My love to all developers struggling with customers! Peace!
I loved your analogies, you made it so much easier to understand these concepts! Thank you so much ❤
Really cool video, kudos.
I giggled when you called them “freedom units” 😂
Great video! I love the way you explained things and the way you demonstrated the benefits of each pattern in code.
I like the way you explain how we can actually implement what you tell about, got a new sub
Finally I understood these design patterns, you know how to explain things! subscribed
Excellent explanation, loved it a lot, your way of explaining stuff with simple words and analogies is perfect, Thanks
Great video dude, I always come back to it
Thank you so much for this Video!
And I loved your StrategyPattern explanation. Good Work!
Thank you again.
A little confused on the example for the observer pattern you gave here regarding performance. You would still have to loop over however many subscribers there are in order for them to get the notification, and assuming that they are all on the same machine, the work will still be done at the same place. So I don't quite understand how there is a performance gain in this specific scenario, unless that was just an analogy for a distributed system?
The main take away is the first example is a PUSH/Notify (e.g. email list, API calls, etc.) and the second example should have been a PULL/Observe (e.g. RSS feed, checking for updates, etc.)
I was initially confused like you for the same reason but after listening closely to what he says in the end after showing the code, my interpretation is that the point he's making is that in example 1 you're looping through subscribers of ALL video channels looking for those that subscribe to your channel in order to notify them, while in example 2 you only loop through the subscribers to your channel, since those are readily available in this case (they were the ones that called the "subscribe" method). But, of course, I might be totally wrong here xD
@@daydreamical Not quite. I don't think the example was the best, but I can see why he used it. Using the Subscriber interface allows you to have many different types of objects subscribe to something happening. Then those objects can control what happens on the notification - because the VideoChannel knows there's an "update()" method.
The first approach only allowed a single type of object.
You very much still have to loop through each item in the array and call "update()" but how the update happens or what it does is controlled by the subscriber and how it implemented the interface.
@@kadin.h I think I see what you mean but, in my opinion, if that was the point, then it'd be just another example of the "strategy" pattern, not an example of the "observer" pattern. Anyways, probably a better example would be showing that, without the observer pattern, your user objects would be periodically polling the video channel object, trying to find out if there are new uploaded videos (and how that would lead to a lot of wasted processing).
He should've used an event instead and it would've communicated the pattern better
Great refresher! Love these type of vids
09:03 schtruschural pattern
Simple and concise explanation. Thanks!
hey my friend, please do more videos where you just show us the code and teach it as you go. you do a great job of explaining simply!!!! thanks
I'm a big fan of the Builder pattern, I've used it in several codebases.
19:54
"And I know this is gonna hurt some feelings.
A lot of y'all are just 'IF ELSE-ing, IF ELSE-ing' everything. You know WHO YOU ARE!"
Pure gold 😁🤣😂
😂😂
about subscriber pattern.. i know its useful, and the core of reactive prograaming, but I dont see the advantage in this example. i mean you say loop through users is not performant, but it ends up using a foreach, that is essentially the same.
the thing is, i dont think it can be done without looping the array somehow
great video as always man
Yeah I was thinking the same thing. I always thought the big improvement it provides is de-coupling things that need to SOMETIMES exchange some data/signals
I believe it would be more useful when let’s say a subscriber only wants to be notified for specific events, not all events. Perhaps a user subscribed to a channel doesn’t want to be notified a new video is released but is still a follower of the channel.
I like how you explain things. Thank you for that! Been subscribed for some time. :) But honestly, freedom units? 😂 Imperial doesn't sound good, anymore? 😅 Keep it up Forest! I like your content, whatever units you like to use. ❤
Great video, didn't know I was using so many patterns.
This was so good. I’m sharing it with my dev team! Thank you
Good for brush up and revision .
Thanks
Take it to the next level by decoupling the factory from explicit class declarations in the base application by using a registry (hashmap) and a module loader, allowing seemingly infinite number of user types which don't rely on a switch
your voice like graves from call of duty thank you man for all these videos you make
first time viewer here, listening to this in the background and keep thinking im getting a lesson from Matthew McConaughey
In addition to Jim Carrey😁
The commercial was introduced so smoothly that I watched it whole and with pleasure
great video!!
>>I had problem comprehending trading in general. I tried watching other RUclips trading channels, but they made the concepts more complicated. I was almost giving up until when i discovered content and explain everything in detail. The videos are easy to follow
I've been making a lot of looses trying to make profit trading. I thought trading on a demo account is just like trading the real market. Can anyone help me out or at least advise me on what to do?
Trading on a demo account can definitely feel similar to the real market, but there are some differences. It's important to remember that trading involves risks and it's normal to face looses sometimes. One piece of advice is to start small and gradually increase your investments as you gain more experience and confidence. It might also be helpful to seek guidance from experienced traders or do some research on different trading strategies
I will advise you should stop trading on your own if you keep losing
If you can, then get a professional to trade for you i think that way your assets are more secure
I'd recommend Melanie Lasser her profit is great even when there's a dip
Thank you!! I got exams about exactly those patterns next week!
You got my sub with freedom units - you might be the only self aware American out there.
Great instructional video, thank you!
Also, "Freedom Units" is one of the most American things I've ever heard haha!
Crazy simple examples to remember, I just wish you provide more code examples
Thank u im new with these kind a type of things , cause i recently learn oop so this video help me a lot in any terms
Loved your explanation. Very interesting and simple. Tons of thanks!
i was needing this this morning haha, thanks dude!
Dear Sir. What you say is really worth it to put into separate videos. That way we could study them in a lower pace.
I really love your explanation Man
Great Content Man!, please create more of these videos thanks a lot!
I watched you since you had 20K subscribers.
Most underrated channel. Please show more code examples. That really helps us!
Matthew McConaughey as dev 😅
Great work! 👌
Great explanation. Beside these ones, I really like the decorator pattern.
Exactly what I needed to watch ! Thanks !!
21:31 The notify private method is doing the wrong thing. It should be emitting an event that the subscriber can listen for. The whole point is that the acting class does not need any collection of who wants the result of the action. You emit the result.
Correct, I don’t think he really understands what the observer pattern is.
Also, "we don't loop through"- we loop with foreach
Some framework strategies of dependency injection can be Singleton by default and are easier to test. For example Spring Singleton beans are easy to mock since the guarantee of being Singleton isn't language enforced (it's at a higher abstraction).
If you do singletons the old fashion way it's indeed a pain to mock any Singleton or static implementation. Kotlin does make static and its object Singletons easier to mock using Mockk, but i believe there are still some pitfalls to avoid.
Actually singletons, when got from a static method, can be easily mocked by Mockito with mockStatic method. You need to do some try-with-resources though.
Hi, Your new subs here! i like your video, the way you explain, and some little jokes you put in this video haha
A Video i never knew i needed.
Thanks alot, for real, thanks.
Love the video right away at 10s
I love the way you simply everything. kudos
I'm schizophrenic( diagnosed) , i feel like i think like you or you think like me, when i solve problems or when imagining examples to articulate my problems!
as a junior developer i felt like i peeked into heaven
Bro I've known all of these for years now and I consider myself a jr haha
Try Head First Design Patterns and Uncle Bob's Clean Code, Clean Architecture and also Uncle Bob's talks here on YT and then there's a whole video series on his website cleancoders.
1:30 I have to disagree. The greatest pattern of all times is the Observer pattern. 🙂
In my case I use the radio & antenna as an analogy to explain it to my students.
You explain well the design patern...
Simple and clear
I love your analogies! I subscribed to
Nice video, so easy to learn
I came to find out that I have been using most of those patterns without knowing what they were
Amazing, loved the analogies, sample situations and code snippets which displayed the execution excellently!
Should I create a whole other class as the Factory or could I make the creation logic inside a static method of the single class?
Singletons are an antipattern. They create a dependency that everyone has to use thats kinda are just magically there.
If you need a logger just let the user inject that logger. Its really that easy.
Nice video! I would like to know what program do you use to diagram ;)
When can we expect a video of Rust on NixOS on Neovim?
I feel like a lot of the issues that design patterns resolve can be fixed with simple static classes with static methods
6:00 oh shit! That just solved a problem I had sweet thanks
Bro this thaught me many things. Now i can too speak like i know everything about design patterns
I don't know who this comment is for, but this feels like watching an Adam Ragusea video except about programming
100% want you to explain everything to me 😅💜
What are you using to diagram ?
Freedom Units, I like that. :)
would've been cool if you utilized the factory pattern for your strategy pattern example lol
great content bro!
I clicked subscribe as soon as he said “freedom units”.
Love It, great explanation
18:24 Why will a lot of if-else if-else be gone? How can you know what type of the transport should be constructed without the control flow?