SOLID Design Principles Explained in a Nutshell

  Рет қаралды 159,044

A Dev' Story

A Dev' Story

Күн бұрын

Пікірлер: 131
@ADevStory
@ADevStory 7 ай бұрын
Hey folks!👋 Want to have hands-on practice on these concepts? 🤓 Try out CodeCrafters.io we have partnered and you can get 40% off 💸with this link: app.codecrafters.io/join?via=DevStory They have great hands-on tutorials and easy to get up to speed with complex systems. Check them out!
@NaumRusomarov
@NaumRusomarov 3 жыл бұрын
I picked this video to watch not because it's the best, I don't know that, but because it's short. :-)
@ADevStory
@ADevStory 3 жыл бұрын
Nice! Yeah I'm trying to make them fairly short, though I keep failing to make them < 5 minutes AND useful :)
@johnnyxp64
@johnnyxp64 2 жыл бұрын
And because is not another annoying Indian accent that makes your brain omelette, so instead of focusing to understand the point you try to slow down the fast bad English accent of the presenter and you are missing the point.
@jacktilley7299
@jacktilley7299 2 жыл бұрын
Yes. Too many lectures in this industry
@ganybaba9377
@ganybaba9377 Жыл бұрын
​@@johnnyxp64 lol. Loser.
@demontime4192
@demontime4192 2 жыл бұрын
I was trying to find a starting point to digest all this information but kept running into content that over explained and brought in new terms without context. Your vid was the perfect place to begin understanding these new concepts. Great examples and explanations without going too high level. Thank you!
@ADevStory
@ADevStory 2 жыл бұрын
Glad you enjoyed it and thanks for the feedback! Any other topic that you may want to learn about?
@persiansayed
@persiansayed 2 жыл бұрын
I have an interview tomorrow, and I just wanted to quickly revise some of the common topics. This is one of the best video I have found to understand SOLID principles. Thank you for this clear and concise video. 👍
@ADevStory
@ADevStory 2 жыл бұрын
Thank you for the feedback! Glad it was useful and good luck in the interview!
@kisan-majdoorkalyansamiti7390
@kisan-majdoorkalyansamiti7390 Жыл бұрын
Lot of novice interviewer always ask methodology name rather than saying about challenges and asking solution . Always ask tell in your challenges and then I give solutions then 90% interviewer has no answer 😂😂😂
2 жыл бұрын
I would separate the vehicle into automatic vs manual, because there are also automatic combustion vehicles. Electric cars have a gear box similar to automatic cars, but specialized. Otherwise, great and concise explanation of the principles :) I had difficulty with understanding the liskov principle, but you've explained it well and now I get it.
@ADevStory
@ADevStory 2 жыл бұрын
Glad it helped!
@davepascual39
@davepascual39 2 жыл бұрын
This is a great and short on how SOLID principles works. It really helps me understand the basic of it .
@ADevStory
@ADevStory 2 жыл бұрын
Thanks! Glad it was useful!
@ivaXP
@ivaXP 4 жыл бұрын
This was short and very easy to understand with the practical examples. Thanks!
@ADevStory
@ADevStory 4 жыл бұрын
Glad you enjoyed it!
@alexhandzhiev
@alexhandzhiev 2 жыл бұрын
Thank you!!1 I have like 11-12 years of experience but just now I actually understood what SOLID means! Thanks again :D
@ADevStory
@ADevStory 2 жыл бұрын
Amazing! Glad it was useful!
@faithyintii8457
@faithyintii8457 2 жыл бұрын
Wow, I just understood all this under 7 mins , thanks kind Sir.
@ADevStory
@ADevStory 2 жыл бұрын
Nice! Glad it was useful!
@david_ramoraswi1711
@david_ramoraswi1711 3 жыл бұрын
preparing for an interview and you made this concept way easier for me,thanks
@ADevStory
@ADevStory 3 жыл бұрын
Glad it was useful! That was part of my idea originally. You can check the playlist for other topics that are common in technical interviews. And BTW good luck in your interview!
@TheLovableRascal
@TheLovableRascal Жыл бұрын
A good, brief summary, thank you for taking the time to make the video 🙌
@ADevStory
@ADevStory Жыл бұрын
Thanks! Glad you liked it!
@stevestorniolo257
@stevestorniolo257 3 жыл бұрын
Awesome video for when I need to remind myself of these principles.
@ADevStory
@ADevStory 3 жыл бұрын
Glad it is useful for you!
@gabrielbott4659
@gabrielbott4659 Жыл бұрын
Wow thank you for this wonderful, im beginner teaching myself it very hard to find clear and concise materials on OOP. ;-)
@ADevStory
@ADevStory Жыл бұрын
Glad it was useful!
@JustinK0
@JustinK0 2 жыл бұрын
1:40 seems like a good way to use a façade pattern, the engine class can be the top level class with the other subclasses underneath,
@ADevStory
@ADevStory 2 жыл бұрын
I'm not sure I follow what you mean. At that time I'm talking about vehicle, engine and tire. Engine can't be a façade for those two 🤔
@pointer333
@pointer333 Жыл бұрын
another banger! thanks again!
@ADevStory
@ADevStory Жыл бұрын
Glad you enjoyed it!
@harsh9558
@harsh9558 7 ай бұрын
Great explanation,🔥
@ADevStory
@ADevStory 7 ай бұрын
Thanks you! Glad you liked it!
@silkogelman
@silkogelman 2 жыл бұрын
Very clear and to the point, thank you Christian! 🙏 The examples with the diagrams really made it clear, going to apply these in Python. Love to see more about these principles and design patterns. Liked and subscribed ✅
@ADevStory
@ADevStory 2 жыл бұрын
Oh so nice it was useful for you. Will make a few more on design patterns. Thanks!
@silkogelman
@silkogelman 2 жыл бұрын
@@ADevStory🥳I'm looking forward to them, thanks! 😀
@ruudiluca
@ruudiluca 2 жыл бұрын
Thank you! This has been useful.
@ADevStory
@ADevStory 2 жыл бұрын
Awesome! Thank you! Glad you liked it!
@chrisdietrich1533
@chrisdietrich1533 6 ай бұрын
Great explanation thank you
@ADevStory
@ADevStory 6 ай бұрын
Thank you! Glad you enjoyed it!
@prathieshnavekneswaran2746
@prathieshnavekneswaran2746 2 жыл бұрын
Thank You! Helped a lot!
@ADevStory
@ADevStory 2 жыл бұрын
Thank you!
@vabav007
@vabav007 2 жыл бұрын
Really well put. Thanks a lot for this.
@ADevStory
@ADevStory 2 жыл бұрын
Thank you! Glad you liked it!
@sebon11
@sebon11 3 жыл бұрын
Great explanation, clear examples :)
@ADevStory
@ADevStory 3 жыл бұрын
Thanks! Glad you enjoyed it!
@CloudGamingTheOriginal
@CloudGamingTheOriginal 4 жыл бұрын
Great summary bud!
@ADevStory
@ADevStory 4 жыл бұрын
Thank you very much!
@markrankin4078
@markrankin4078 3 жыл бұрын
Good video, best and most concise I've seen
@ADevStory
@ADevStory 3 жыл бұрын
Glad to hear that!
4 жыл бұрын
Great video! Congrats, keep rocking!
@ADevStory
@ADevStory 4 жыл бұрын
Thank you mate! :)
@florianvanbondoc3539
@florianvanbondoc3539 2 жыл бұрын
Thank you, I really like the fact that this video was kept small.
@jamestill4172
@jamestill4172 Жыл бұрын
SOLID programming means abstracting your code, having classes depend on abstractions (like interfaces), and not other classes. The best code is simple and de-coupled, easy to modify without breaking everything, and easy to read. Single responsibility: Each class should have a single responsibility. Open/closed: Classes should be built to extend and be closed for modification. Liskov substitution: Changing instances with sub-types shouldn't break your code. Interface segregation: Delegate functionality to interface classes. Too many interfaces > too few. Dependency inversion: High-level classes should rely on abstractions (like interfaces) rather than on lower-level classes. You're inverting their dependency.
@AllanJeremy
@AllanJeremy 3 жыл бұрын
Subbed. Succinct and perfect refresher!
@ADevStory
@ADevStory 3 жыл бұрын
Glad you liked it!
@josemtz6430
@josemtz6430 3 жыл бұрын
great explanation, thanks!!!
@CS-eh8eo
@CS-eh8eo 3 жыл бұрын
I don't think I understand what open closed principle REALLY means... Like how can a class be closed for modification? I think it's talking about using immutable objects and stateless classes, because it's the state of the class that can change. Open for extension on the other hand is saying you should use interfaces to swap out implementations, I don't think using inheritance is a good idea because you're tied to that base class, especially if the class is part of an Api. Basically you should program to interfaces so your implementations can be swapped out for different ones and your existing code doesn't change, new code is added. This is what open closed principle really means. What do you think?
@ADevStory
@ADevStory 3 жыл бұрын
Yeah the principles can be confusing. And the specific naming of the open/closed one it's tricky. I'd say the main idea is that in case you need to add behavior to a program/class, instead of adding the behavior to the class, make it easier to replace or extend the behavior of it. Not necessarily with inheritance I'd say. Here's an article that I think explains it very well. medium.com/@alexandre.malavasi/why-is-the-open-closed-principle-so-important-bed2f2a0d4c7 Let me know if it helped :)
@nishiths9228
@nishiths9228 3 жыл бұрын
Hi there , I really like these videos as it one of the best videos which explains about lot of important concepts required to be better dev and which is not found in the sea of KZbin videos … I would also like to know if there are any books that you would recommend for becoming a advanced java programmer starting from the basics .. you may recommend like for beginner this is best and after that this book is best … Thanks in advance ! Appreciate your hard work in creating such a quality contents with loads of essential stuffs in them for being a good and better dev … love your videos ! 💕
@ADevStory
@ADevStory 3 жыл бұрын
Oh thanks for the compliments 😀 regarding books on design patterns check out the description. Regarding java beginner java books I would recommend (though I haven't read) Head First Java , and Effective Java (this for all levels and it's quite nice).
@bonnoManus
@bonnoManus 3 жыл бұрын
Topic was nice....but your explanation was not very clear. I appreciate you tried to explain this hard topic in a concise manner.
@ADevStory
@ADevStory 3 жыл бұрын
Thanks for your feedback! What can I do to make it clearer in the future?
@bariswheel
@bariswheel 3 жыл бұрын
Good stuff, thanks for posting.
@ADevStory
@ADevStory 3 жыл бұрын
Thank you for watching! If you feel it can be useful to someone else please share and also if you want me to cover other topics, let me know :)
@frankhernandez4057
@frankhernandez4057 2 жыл бұрын
Applying the Interface principle 4:43 wouldn’t this break the Leskov principle because you can replace vehicle with combustion since it has another method not used?
@ADevStory
@ADevStory 2 жыл бұрын
Nope, because you are specializing the classes. That's perfectly ok. What is not ok (according to Liskov) is if Vehicle has methods that can't be implemented by either Electric or Combustion (for example, shift() method). Hope is clearer :)
@TheAlexanderpietsch
@TheAlexanderpietsch 6 ай бұрын
I wonder on min 5:11 where there is an composition drawn between Vehicle and Tire, shouldn't the owning (filled diamond) be on the Vehicle side?
@yehuda4904
@yehuda4904 3 жыл бұрын
Wow, thank you so much for sharing the information... Very clear :)
@ADevStory
@ADevStory 3 жыл бұрын
Glad you enjoyed it!
@quinnyboym6282
@quinnyboym6282 3 жыл бұрын
On 5:13 these open arrows mean "is-a" right? But then it says on the bottom a Bike is a Tire and a Car is a Tire, what am I seeing wrong here? Thanks for the helpful video tho, just don't understand this last thing. Exam tomorrow... ahaha
@ADevStory
@ADevStory 3 жыл бұрын
Yeah the arrows mean "is-a" and sadly by being lazy the diagram is wrong: I meant a "BikeTire" and a "CarTire" are both tires
@tulikagupta5009
@tulikagupta5009 4 жыл бұрын
Great content and easy to follow. Can you also make videos on gang of 4 creation design patterns?
@ADevStory
@ADevStory 4 жыл бұрын
I did already :) kzbin.info/www/bejne/l5q2coJodr2Ub8k
@tulikagupta5009
@tulikagupta5009 4 жыл бұрын
@@ADevStory I saw those also. Very easy to understand. Never knew so many benefits of builder pattern.
@ADevStory
@ADevStory 4 жыл бұрын
Glad you enjoyed them!
@kevingreetham4175
@kevingreetham4175 11 ай бұрын
What I’ve never been able to understand tho is how do we know what engine and tyre refers to what car though if they are not stored within the same class? Do I have a common id between classes or should I store the engine and tyre classes as properties of the specific instantiated car object and provide methods from the car object which target thr internal class ?
@ADevStory
@ADevStory 11 ай бұрын
It depends, if your class relies directly on a specific behavior of an implementation then you need to include that one. For example: A Toyota Camry requires engine X. But sometimes you might even generalize it and say: a Toyota Camry has an engine. The constructor for ToyotaCamryCass only needs to recieve an object of type "engine" and doesn't care which specific engine it is.
@ADevStory
@ADevStory 11 ай бұрын
Hope it makes sense
@Name-lt2tz
@Name-lt2tz 3 жыл бұрын
what I hate when coding and there are injected interfaces, it is hard to find which class will be injected when interface is implemented by few classes. I have to debug then - not readable code, I cannot tell just by looking at the code. I see good programmers not using interfaces everywhere so this makes me doubt readlly that this is useful thing to do.
@ADevStory
@ADevStory 3 жыл бұрын
It depends. Using interfaces allows for better code decoupling, easier testability and better maintenance. Having said that, in many cases you end up with code that depends on interfaces where there will "always" be only one implementation, or that it isn't expected to change "almost ever" (i.e. you don't expect a dependency injection framework to dynamically inject other dependencies, don't expect polimorphism). This, tied with the capacity of more recent testing frameworks like Mockito that allows to mock concrete classes, doesn't require to have explicit interfaces. Code complexity by having interfaces shouldn't be greater either, and most modern IDEs (if not all) allow to easily navigate through the interfaces and specific implementations.
@Name-lt2tz
@Name-lt2tz 3 жыл бұрын
@@ADevStory at least PHP storm - if I click on dependency which is injected using intereface, it moves me to interface. And then can navigate to classes implementing the intereface. Ide suggests those classes but it does not know which one is being injected. So I only can find by debugging.
@ADevStory
@ADevStory 3 жыл бұрын
Oh I see. I think in that case it's more about how easy is to understand the framework dependency injection configuration than about using interfaces.
@edymbhify
@edymbhify 3 жыл бұрын
Fantastic explanation, just missing code examples, on git.
@ADevStory
@ADevStory 3 жыл бұрын
I can create some and paste them later. I'm intentionally trying not to show code in my videos, and focus more on the concepts.
@ReporterTorizo
@ReporterTorizo 3 жыл бұрын
The examples threw me off COMPLETELY because I didn't know that electric cars don't have transmissions.
@ADevStory
@ADevStory 3 жыл бұрын
Sorry for that. On the bright side you now know about cars and object orientation 😅
@georgedulica2925
@georgedulica2925 Жыл бұрын
Dependency inversion seems to be similary with interface segregation
@ADevStory
@ADevStory Жыл бұрын
They all relate but are different :)
@rafadydkiemmacha7543
@rafadydkiemmacha7543 3 жыл бұрын
It's always so easy with those examples like Cars and Animals, but then in real life projects those principles are extremely hard to use. And almost nobody does, at least in huge projects.
@ADevStory
@ADevStory 3 жыл бұрын
In my experience they are used extensively in any maintainable project. The thing is that it depends a lot on the domain so the examples would be way more specific in that sense. But factories, singletons, decorators, adapters, proxies, and observers are probably some of the most used ones.
@poojaguru2516
@poojaguru2516 3 жыл бұрын
Good one!
@ADevStory
@ADevStory 3 жыл бұрын
Thanks! :)
@alialwerfally6497
@alialwerfally6497 3 жыл бұрын
thank you so much
@ADevStory
@ADevStory 3 жыл бұрын
You Are very welcome!
@zeekcom12
@zeekcom12 3 жыл бұрын
Thank you!!!!!
@ADevStory
@ADevStory 3 жыл бұрын
You're welcome! (With Maui's voice) 😁
@mitrabest9756
@mitrabest9756 2 жыл бұрын
Good keep going 👍
@kisan-majdoorkalyansamiti7390
@kisan-majdoorkalyansamiti7390 Жыл бұрын
Lot of researcher to show they given new concept it is biggest stupidity. Main thing is missing what are problems and to solve what are possible solution then we can say this methodology solve this way . Lot of novice interviewer always ask methodology name rather than saying about challenges and asking solution .
@Name-lt2tz
@Name-lt2tz 3 жыл бұрын
open closed principle - I have seen such in codebase when there is abstaract class and you have to implement methods. But I do not see its benefit. I have needed for example add parameter to the method of child class. So I have to add parameter to parent class so the method definition would be same. At least in php, otherwise you get error. But this parameter is not needed for other child classes, so solution is to have unused parameters in function. Now I think another solution could be to pass some objects implementing some interface and they could have one interface but completely different amount of parameters.
@ADevStory
@ADevStory 3 жыл бұрын
Yeah you are right :) and that's great that you have experienced this. There are different things to take here: - Code is not supposed to be static. It will change overtime. If you notice part of the code that is always changing while other parts are always static, then that dynamic part is candidate for extraction (like you said, with interfaces). So the Open/Closed principle is not so much about "writing once and not touching ever" as it is more about keeping the things that don't change or are common in one place while allowing for extending that behavior elsewhere. - IMO SOLID principles shouldn't be seen in isolation from one another. In this case Open/Close Principle relates a lot with others like Single Responsibility principle. If a class has it's responsibility well defined and is implemented according to that, any extension to the responsibility elsewhere should be done outside that class. And of course, if the responsibility of your class changes (requires new params, calculations changes, etc) then the responsibility of your class must change accordingly. Hope it's clearer :)
@carlosalarcon2737
@carlosalarcon2737 3 жыл бұрын
Thanks
@ADevStory
@ADevStory 3 жыл бұрын
You are welcome!
@Name-lt2tz
@Name-lt2tz 3 жыл бұрын
why single responsiblity is not called like high cohesion principle instead? that would be real name, because single is a lie then, at least from what I see people doing.
@ADevStory
@ADevStory 3 жыл бұрын
Well is not only about cohesion but actual responsibility. If I understand your point correctly in this case a "single responsibility" is a subset of "high cohesion". You could have high cohesion with multiple responsibilities and that's not the purpose of the principle.
@Name-lt2tz
@Name-lt2tz 3 жыл бұрын
@@ADevStory but I never practically see single responsibility. For exmaple most controllers have methods like this: create, update, delete, list. How this is single? 1 create, 2 update, 3 delete, 4 list. For responsibilities.
@ADevStory
@ADevStory 3 жыл бұрын
That part gets philosophical sometimes. You could split each of those operations in different classes too. The important thing is to have the responsibility clearly scoped. For example, if it's UserController: responsible for handling user registration.
@pointyneedle7837
@pointyneedle7837 4 жыл бұрын
Nice , please add subtitles
@ADevStory
@ADevStory 4 жыл бұрын
Will add!
@raphaelmacsa1992
@raphaelmacsa1992 3 жыл бұрын
3:01 Java code inside Visual Studio... LMAO 🤣
@ADevStory
@ADevStory 3 жыл бұрын
Haha you noticed!
@OmoruyiOmofonmwan
@OmoruyiOmofonmwan 2 жыл бұрын
Why is that funny?
@YoungDev98
@YoungDev98 3 жыл бұрын
gj bro, thanks
@lilenoulitza
@lilenoulitza 4 жыл бұрын
I lost everything after the Single responsibility :p lol i must be so stupid
@ADevStory
@ADevStory 4 жыл бұрын
What did you miss? Is it clearer now?
@yehuda4904
@yehuda4904 3 жыл бұрын
Yes, these are hard concepts that takes years to understand... Unfortunatly, it can be understood with experience or some one explainning it face to face...
@anuragyada7379
@anuragyada7379 Жыл бұрын
@@ADevStory oooooo9oooooooooooooooooooooooooooooooooooooooooOooooooooooooooooooooooooooooo
@YusufxonToshkandiy
@YusufxonToshkandiy 3 жыл бұрын
TOO BAD
@funnyteja8181
@funnyteja8181 Жыл бұрын
Maa
@CASLOAcademy
@CASLOAcademy 2 жыл бұрын
weird
@davyboi2469
@davyboi2469 2 жыл бұрын
I hate studying for this boring as programming crap
@aleksanderm1947
@aleksanderm1947 2 жыл бұрын
Bro, buy a good mic.
@ADevStory
@ADevStory 2 жыл бұрын
I did! Checkout my newer videos :)
@av733
@av733 2 жыл бұрын
can't understand your accent
@ADevStory
@ADevStory 2 жыл бұрын
Sorry about that. Did you try the English subtitles?
@ochoax2628
@ochoax2628 2 жыл бұрын
So sorry but your explanation is not clear. I can read powerPoint presentations as well. The examples given in this video are not useful. Keep improving.
@ADevStory
@ADevStory Жыл бұрын
Sorry to hear that. How would it be more useful?
Object Oriented Design Patterns Explained
6:03
A Dev' Story
Рет қаралды 26 М.
Uncle Bob’s SOLID Principles Made Easy 🍀 - In Python!
19:09
ArjanCodes
Рет қаралды 309 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
GIANT Gummy Worm #shorts
0:42
Mr DegrEE
Рет қаралды 152 МЛН
SOLID Principles: Do You Really Understand Them?
7:04
Alex Hyett
Рет қаралды 236 М.
Object Oriented Programming Explained in a Nutshell
6:19
A Dev' Story
Рет қаралды 10 М.
Learn SOLID Principles with CLEAN CODE Examples
28:35
Amigoscode
Рет қаралды 285 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 226 М.
5 Things to do When Joining a New Company (as a Software Engineer)
6:31
Getting the Basics - Software Architecture Introduction (part 1)
7:48
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 1,1 МЛН
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН