SOLID Principles: Do You Really Understand Them?

preview_player
Показать описание
People mention SOLID everywhere but very few do a good job of explaining it. I am hoping to put an end to that in this video so you can once and for all understand all the SOLID principles.

⏳ TIMESTAMPS
00:00 - Introduction
00:30 - Single Responsibility Principle
01:51 - Open-Closed Principle
02:33 - Decorator Pattern
03:02 - Extension Methods
03:39 - Liskov Substitution Principle
04:18 - Interface Segregation Principle
05:11 - Dependency Inversion Principle
06:37 - Conclusion

🔗 MY KEY LINKS

🧑‍💻 WHO AM I

‼️ DISCLAIMERS
Some of the links in this description are affiliate links, for which I get a small commission, at no extra cost to you 🙂. I appreciate you supporting my channel so I can continue providing you with free software development content!

#coding #programming #developer
Рекомендации по теме
Комментарии
Автор

I got Alex's course on SOLID, and it is just brilliant (wish I had lecturers like this in university :/). Goes more into detail on how to execute these principles in practice.

martynasgoberis
Автор

This is totally brillant....short and concise and really understandable! Top class this!

andrewmarshall
Автор

In the context of the Interface Segregation Principle (ISP), when we refer to a "client, " we're talking about a class, module, or component that uses or depends on an interface, not a class that implements the interface.

ISP states that clients should not be forced to depend on methods they do not use (call / invoke). If a class has three methods but the client only calls one of them, the client still has a compile-time dependency (due to the import statement) on the other two methods. The methods could be: retrieve(), save() and delete(). If the client code only calls save(), then it is cleaner for the client code to depend on a 'Saver' interface, rather than the concrete class which implements all three methods.

Also, it is easier to use simple interface both on the caller's (client) side and on the implementation side.

residentorangejuice
Автор

i was so scared when i saw liskov, but the way you explained it assauged those fears. I thought it was hard to understand, but you sum it up quite nicely. As a budding developer, thank you very much for this!!

seijumimurasakibara
Автор

I wouldn't say that the SOLID principles are too vague to be useful but I do agree that they are very abstract. I've come across many developers who know what the principles say but they don't really use them because they don't know when they should be using them or how to translate them into code. Maybe we need a set of more concrete principles to fill that gap.

togofar
Автор

Finally I understood all of the SOLID principles. Thank you a lot

hyperborean
Автор

Just came here to say hello from brazil! I've started moving careers to data science and your videos are so well written and the content so well explained that I've been binge watching them! thank you for posting.

victorialacerda
Автор

We actually have a dude in our project that brought this SOLID up to a single line. Explosion of interfaces, ununderstandable and not needed abstraction layers and general confusion - that's what we got as a result.

BUT, we also get very very nice skeleton to build on top of. Especially - when it comes to Repository that we actually used. We have 2 entirely diffrent databases (firestore and mongo) and one in-house implemented (by a humble author of this post) in-memory DB mocking the firestore behaviour. So we really can simply mock any behaviour we want, and the most common dependency to the DB is simply non-existent. We simply change the implementation to "mock-db" and define whatever we need for the test. Exchange to MongoDB was also very simple in comparation to what it could have been without having extracted right interfaces...
But...
One have to admit - it has taken a LOT of work to bring the code to this level. Probably any of those issues might have been solved in less time simply by brute-forcing code edition. :>

korniszon
Автор

I've herd these explained by many people. Yours amongst the cleanest and simplest, also shortest. All these making for a top-notch explanation. :)

reppair
Автор

This is good. I'm glad you explained the huge benefit of interfaces at the end: makes everything testable. Code covered by tests can be modified and refactored safely, which makes the code easier to maintain in the long run (the purpose of good design).

elvikingo
Автор

This has been by far the best video explaining SOLID Thank you so much! I love the stack and heap memory video too. Keep it up!

dos
Автор

The best tutorial about OOP I have seen so far. Thank you Alex! Also these animations are awesome

perisicnikola
Автор

Good explainer, thanks.
As for the part about "following the SOLID principles to the letter", the strategy I use in my trainings is this: learn TDD without mock frameworks and then SOLID pops out automatically.

For example, if you design a large interface then a mock framework will make it easy to use it in your tests.
However, if you do it manuall you will feel the pain of creating an implementation with usesless methods. This pain means your tests want to tell you something about your code design, in this case that you're probably violating the Interface Segregation Principle.

goisenate
Автор

I wouldn't say that "interface" in interface segregation is about C# or Java interfaces. Simply that you should segregate the interface for your class. It could be an interface, but not necessarily. So I try to keep it a language neutral term. Keep up the good work! I find it great.🙂

marna_li
Автор

Just some friendly feedback. Really well written and narrated. BUT your code presentations were far too quick/short giving hardly any time to digest. Users generally hate pausing and rewinding. Maybe less shots of you and your face, leaving the code up longer. From an adult education perspective this would be a lot better. Not everyone has the same processing speed. Also, if you kept it this short because of algorithms etc, be mindful of whose needs you are really trying to meet: your consumers, yours or YouTube's....

MagoMakes
Автор

One of the best explanations of the SOLID principles!

acupfb
Автор

That BTTF display at the back was so distracting cause it makes me want to buy one and I couldnt stop staring at how cool it is!

takatakboy
Автор

Please cover CUPID, this was a really good talk and I'd love to see this through the CUPID lens :). I've just seen the "CUPID for joyful programming" talk and really liked it, thank you for that recommendation!

simonslater
Автор

Your conclusion is absolute important.

bubumimo
Автор

Beginner here, thank you for dumbing it down for me to understand!

leezhenjian
join shbcf.ru