0:00 Introduction 0:51 Find problem with existing code 1:36 S = Single Responsibility Principle 4:05 O = Open Extensions, Closed Modifications 7:09 L = Liskov Substitution 9:43 I = Interface Segregation 11:31 D = Dependency Inversion Great explanation with a simple to understand example. Amazing videos as always.
@raplyanugrah44122 жыл бұрын
Vn
@raplyanugrah44122 жыл бұрын
Vvvvvvvvv
@raplyanugrah44122 жыл бұрын
Hv
@raplyanugrah44122 жыл бұрын
Gvv
@raplyanugrah44122 жыл бұрын
Ggvvv
@aimenham46853 жыл бұрын
finally , now i understand why interfaces are so important ,I struggled so much to find reason to use them , Thank you philipp
@adipurnomo56832 жыл бұрын
Same here
@oliveryt7168 Жыл бұрын
Me too... I knew what an interface is in general, but not what it really means in coding (at least I had a bright moment)...
@SlakySlaky3 жыл бұрын
Play the video in 2x speed then you'll be learning SOLID in 10 minutes
@feepin20583 жыл бұрын
But you will understand 2x less as well
@CybercoderNaj3 жыл бұрын
@@feepin2058 not necessarily
@MateusMeurer3 жыл бұрын
Lmao
@newbiegameplayy3 жыл бұрын
So scary 😂
@rahulmatte66213 жыл бұрын
Writing code is simple but writing simple code is difficult. Good work Philip, it helped me to learn SOLID principles 😅
@Alchemist102413 жыл бұрын
For Interface segregation principle; I think we shouldn't create a function (that sometimes needed and sometimes not) - printLogs() function in this video - inside the same interface, We should create another interface and declare this function in it and if we need this functionality we can implement this interface and plus other interfaces like FileLogger interface in this video
@joanmedia2 жыл бұрын
Agree! But the video still is amazing.
@aliahmadabadiha32632 жыл бұрын
You're right
@TheMohit9872 жыл бұрын
That's what I thought. Apart from that, video was good.
@ltadeu612 жыл бұрын
Yeah! I did note that and agree with your response!
@diegohkdfln8 ай бұрын
Also agree. If I have an instance of FileLogger and call printLogs(), I'd expect it to print the logs, but it won't. Moving the printLogs() to a separate interface such as LogPrinter, would make more sense.
@devgabriel68982 жыл бұрын
Experience is so freaking important!. 6 months ago, i saw this video i didnt understand anything of it. Now i understand everything! Because without knowing, i used all of this on my job, day to day on Android. Excelent! Now going for theory behind design patterns
@sergeisalnikov64272 жыл бұрын
Hi!) I am from Russia and I am learning English to find a job in another country. You have good English I understand almost everything and your videos help me to learn the language))
@vonn97372 жыл бұрын
In example for open/closed, you treated the FileLogger class as being completely closed. Your CustomFileLogger was effectively another implementation of a FileLogger interface. It is ok to add new functionality to the FileLogger class, for example adding another function called timestampedError(), as long as you do not change the logError() function it adheres to the open/closed principle. All existing consumers of FileLogger will work exactly as they did before. For your example of Liskov substitution, the CustomErrorLogger class does not violate Liskov substitution. All instances of FileLogger can be replaced with CustomErrorLogger and will work exactly the same. This is because all calls to logError() will still go to the base FileLogger via inheritance.
@avigneswaranwaran2 жыл бұрын
Your explanation is great. But, I have a question here, we already have a function named logError() in class FileLogger. So if we add timestampedError() to FileLogger it is not violating single resposibility principle? Kindly help me understand better
@stevebroshar3143 Жыл бұрын
@@avigneswaranwaran well ... first of all timestampedError is not a good function name IMO. I follow the pattern of naming a function with a verb prefix. That, plus vonn didn't say what that function does makes it hard to know what vonn intends that function to do. But ... if that function is about logging to a file (logs a timestamped error?) then it does adhere to single responsibility (SR). Then again, vonn's comment is about Open/Closed (O/C) ... why are you asking about SR?
@saul5x5 ай бұрын
Thank you for your content Philipp! It helps so much and I'm glad there are developers who strive to make code as good as possible!
@Chintanparmar3 жыл бұрын
The video we didn't ask for, but really needed..
@ani-eg8dy3 жыл бұрын
This is simple AF , nobody showed this important principle with this level of simple and easy examples ! Take a bow @Philipp
@alwaysbrillant102 жыл бұрын
Been binge watching all your recent videos. Amazing Android content 👏🏽 👌🏽
@tgamings18 ай бұрын
Vielen vielen Dank lieber Philipp für diese tolle Erklärung. Du hast da wirklich ein Talent solche Dinge sehr einfach für jeden verständlich zu machen. Liebe Grüße aus Österreich.
@kobeissi7213 жыл бұрын
For the optional interface function, you could also do = Unit instead of the empty function braces.
@PhilippLackner3 жыл бұрын
Yea sure was just a quick demo here
@BilalBerek-tl3tq9 ай бұрын
@@PhilippLackner I think you must do make separate interfaces for every method. So you can use multiple inheritance for every method you need. Because function with empty body standing in the interface not a good case that much.
@also_david2 жыл бұрын
awesome man. I didn' like you previously when seen on interviews but Now addicted to how you teach and how humble you really are.
@Andrei1889 Жыл бұрын
I would've killed for this video when I first started learning Android and programming; Thank you.
@cesarlabastida1392 Жыл бұрын
You have such a nice way of explaining things brother. Keep making these videos please. Thank you.
@CybercoderNaj3 жыл бұрын
I got goosebumps when he said, "This changes the entire implementation in one line of code. 🦋"
@PhilippLackner3 жыл бұрын
This is programmer porn
@farazahmed72 жыл бұрын
What a nerd 💀
@mustaqode_66173 жыл бұрын
This is a most important video in the internet for devs today. It's not easy to explain this topic the way he did. Kudos @Philipp
@sakhti0073 жыл бұрын
Thankyou Philipp, your way of explaining the issues through examples is just amazing. Thankyou for this great video.
@TripDude2 жыл бұрын
Thanks for the explanations with easy examples 👌👏
@Coldalecs2 жыл бұрын
I finally understand them now, I faced the same problem when searching them online...very hard to understand. This was waaay easier to understand. Thank you!
@PhilippLackner2 жыл бұрын
Glad it helped!
@masti4372 жыл бұрын
I watched this video after watching your multi module course. So clearly explained .. I clearly understand why you inject abstractions using hilt instead of concrete implementation ..... Thank you so much Philip
@devetips2 жыл бұрын
really the most informative explanation of SOLID principles. appreciated and thanks a lot man:)
@niranz77453 жыл бұрын
This is literally one of the best channels out there. I can’t believe that I only found it now. I love the videos. Keep them coming! P.s- would love to see a video about Alarm manager in Kotlin! Looking for such a video for a while.
@Another0neTime3 жыл бұрын
This guy does it again!!! Nice explanations.
@PhilippLackner3 жыл бұрын
Glad you like them!
@mahdizareei45753 жыл бұрын
Thank you so much dear philipp for record this courses , I just wanted say i love you ❤️😘
@pratikpattanaik2 жыл бұрын
I think a more appropriate example of Liskov substitution principle would be if an overriden function were to do something unexpected and contrary to its implementation in the base class. This can be shown with a base function that changes the state of the class which is overriden by a function that doesn't call the super method. The example provided doesn't break this principle. I liked the other explanations.
@vitorferreira54649 ай бұрын
Best video about SOLID I've ever seen
@daniyar27183 жыл бұрын
I like how you explain complex things so easy👍nice
@aginamabednego Жыл бұрын
Kudos Philip. This explanation was easy to grasp
@razidwa8522 жыл бұрын
The best explanation I have ever seen. Great job
@snehilsinha46892 жыл бұрын
Simplest and best example with clean examples just like your clean codes @Philipp ! Awesome :)
@theophilus4943 жыл бұрын
Philip God bless you soooooooo much.... i can't thank you enough
@alvaroisea22593 жыл бұрын
Thanks for this video man!, Big fan of your channel
@tinycontractor2 жыл бұрын
The thing that I liked about the video was not wasting my time to learn this SOLID buillshit. Thanks for summarizing.
@matt-g-recovers3 жыл бұрын
After watching this last night I went back and re-watched Bob's playlist on clean code... outstanding! Then today in a long term project interview (We interview internally for projects) I was asked, 'what are the SOLID principles of good software engineering?' I played it cool, .. 'fools, little do you know Phillipp just schooled me on this shit' ... barely had the words come out of my mouth when the hiring manager said "wait you know Phillipp?" ;) Joking aside, the synchronicity is insane man, thanks so much for everything!
@PhilippLackner3 жыл бұрын
Haha thanks Matt! :D
@khanzadakashif82483 жыл бұрын
Just the thing I needed. Surely will start using all these principles in my future projects.... Thanks bro...
@bjugdbjk3 жыл бұрын
This is by far the best SOLID video explaining these complex SOLID software principles !! Thank you for this amazing content !!
@VenewebTV3 жыл бұрын
Amazing video, I have studied the SOLID principles and I have never understood them so easily, congratulations, greetings from Caracas, Venezuela
@shantanubopardikar77192 жыл бұрын
Bro, you are my new superhero, much much better than any other fictional superhero
@kareemjeiroudi19643 жыл бұрын
Well done video. Just pay attention to interface segregation. Interface segregation does not mean that clients do not need to implement the entire interface. It means that you should segregate different functions under several interfaces, and then it's up to the client to decide which interfaces to implement. I don't think the example here was demonstrative of interface segregation.
@PhilippLackner3 жыл бұрын
agreed, thanks for the feedback!
@punerealestatebuilder3 жыл бұрын
Probably onClickListener and OnLongClickListener are examples of it. Those 2 could be in a single interface, but that way you would have forced the class to implement these 2 methods even you want to use either of them.
@Abhishek_Sawant3 жыл бұрын
Keep making such videos.👍 It truly helps a lot.😌 Thank you 🙏🙂
@jhngolan3 жыл бұрын
So realy clearest explanation ever and simple practical Thank you Philipp
@PhilippLackner3 жыл бұрын
Thanks mate!
@haliltoprak5852 жыл бұрын
Thank you so much for clear explanation of SOLID 🙏
@mandroidx14743 жыл бұрын
This is really helpful,some tutorial only targets output without considering clean code,thanks Philipp
@PhilippLackner3 жыл бұрын
Glad you liked it
@wilsonahanmisi11872 жыл бұрын
This guy is really good.... Keep it up bro
@lekshmiskrishnan56522 жыл бұрын
Thanks a lot for that awesome explanation!
@montuedge10 ай бұрын
You explain like Indians ❤ simple and easy to understand with examples.
@vengateshm21223 жыл бұрын
Finally found a Bible for SOLID.❤️🙏
@TheCreator11972 жыл бұрын
For the open-closed principle, would you then be violating it if you provided a default parameter with the file path name, so that one could change the output location without extending the original class? Not sure if that's what you mean by closed to modification
@umairkhalid1233 жыл бұрын
You got some perfect communication skills
@PhilippLackner3 жыл бұрын
Thanks ❤️
@satyasaineelapala5703 жыл бұрын
@@PhilippLackner Great video. I do have one doubt regarding auth in Dependency inversion. If we call auth.signInWithEmailAndPassword(), then which would be called among the functions in FirebaseAuthention and CustomApiAuthentication classes?Thanks in advance
@mrwhoknows3 жыл бұрын
@@satyasaineelapala570 you have to pass authenticator object while creating instance of Repository, if you've passed firebaseAuthenticator then it'll use that, and vice versa
@satyasaineelapala5703 жыл бұрын
@@mrwhoknows Thanks
@mare10rooney3 жыл бұрын
Great video Philipp, would be awesome if you would cover more of these advanced topics. Keep up the good work!
@carguy-xv2clАй бұрын
Am I crazy or did you not instantiate any of the class member objects that you are calling methods from. Still trying to get the hang of kotlin coming from java.
@sahilshokeen60782 жыл бұрын
Really amazing video
@theLaughRiot003 жыл бұрын
Hey Philipp , What about MVI pattern?Can we have any tutorial on it. Thanks
@ramakrishnavjoshi3 жыл бұрын
Make video on this also please Phillip
@gyorgygab2 жыл бұрын
Very good video. One question regarding the Open Closed Principle: If I would create method for changing the path e.g.: open fun getPath(){...} Does this violate the principle?
@basitaliwrites48282 жыл бұрын
Thank you for the explanation I learned something new today
@minasalah82102 жыл бұрын
thanks' a lot Philipp, appreciated your efforts
@vitalijuskolinko90113 жыл бұрын
Do we need to remove dependency on concretion of FileLogger class? For "I" principle you can split your interface in several interfaces. Thanks for video! ❤
@twominus75006 ай бұрын
I do not understand why we need separate authenticator interface for Firebase. We already have an abstraction for repository and we can simply create another implementation with another dependencies. Why to double abstractions there?
@abood7meed5092 жыл бұрын
Thank you it was very simple and easy to understand
@Chintanparmar3 жыл бұрын
If possible also make a video on Design Patterns 😅
@burakkarabekir4593 жыл бұрын
Great content. You made it clear for me. Thank you so much. . . . Thank you so much.
@prasanthmanimaran51583 жыл бұрын
Someone actually disliked this gem of a video...??! Outrageous...
@rizwansworld5 ай бұрын
Thanks man. Really helpful.
@susanlama3 жыл бұрын
This videos was so helpful. Thank you
@NishantKumar-cr6fb3 жыл бұрын
Nicely and simply explained
@mohammedgouse52263 жыл бұрын
Iam developing an app in java ..in that navigation drawer menu items are not getting clicked and not opening sir help as soon as possible
@pstlvictoras3 жыл бұрын
do you have an example of project with clean arhitecture?
@bonifaceyombwe97933 жыл бұрын
I always enjoy your videos. Would u do one video on adding time and date in an android studio app
@PhilippLackner3 жыл бұрын
Thanks I do that in a bunch of my Playlists
@amavrik3 жыл бұрын
Great explanation man! Thank you!
@joemoe59543 жыл бұрын
Please make more videos like this !
@d-landjs7 ай бұрын
Excellent bro !
@atulkumar-bb7vi Жыл бұрын
I liked explanation, Thanks! but Interface segregation principle is not explained properly. It states that, should have kept printLogs method in different interface and then can be implemented in classes wherever required.
@merryorte2 жыл бұрын
I think the explanation for open for extension but closed for modification was a bit confusing. I hope I'm understanding correctly that by modifying you mean adjusting functionality in pre-existing functions that already work fine.
@BapeRuLLZ3 жыл бұрын
On the single responsibility principle example, shouldnt the error handling part be implemented in a different class? I mean it sounds and would look weird, but in principle this class still has more than one reason to change: 1. if we want to change how the user sign-in network call is implemented 2. if we want to change how the error handling works. I mean the logging part is in another class, so if we want to change only the error logging than everything is good, but if we want to change what gets called in the catch block in the first place than the class would have two reasons to change.
@VikashKumar-t3v8z Жыл бұрын
Somewhere you need to catch the possible exception. I think there is no other option to handle exception like writing try-catch in the same function. If you find some solution please share that might help to understand more. Thanks
@bitwisedevs46910 ай бұрын
Didn't realize I already did all of it long time ago.
@newbiegameplayy3 жыл бұрын
Please Make A Series About Clean Architecture...
@awais29803 жыл бұрын
Can you please make video on Important design patterns for Android developers? Thanks in advance.
@r_yan35313 жыл бұрын
Hey Phillipp we need more videos on clean architecture, if possible please make a playlist on it. I will buy that playlist if it is paid but please make that playlist
@OmarMohamed-ge2zg4 ай бұрын
thank you mr philipp
@atulkumar-bb7vi Жыл бұрын
Repo is dependent on FirebaseAuth object which is wrong, Should be asbtracted and repo should also be abstracted with separating out implementation, and separate class for logging code.
@RubabAzim2 жыл бұрын
Nice explanation on very complex and ambiguous topic. 👍👍 Plus i think we can do diff approach for interface segregation instead of giving default implementation.
@funnymoment91643 жыл бұрын
Thanks. Very good explanation.
@jayantkumar19543 жыл бұрын
Really awesome explanation 😐😐👏
@PhilippLackner3 жыл бұрын
Thanks bro!
@mackomako3 жыл бұрын
I believe you got the Liskov Substitution principle wrong. The principle is that you should not override the behavior of the parent class. Let's say the method of the parent class changes an attribute of the parent class which depends on it. Then when the child class overrides the method and changes the behavior so the attribute is not changed in a way the parent class expects. So this leads to bugs such as when the parent class is used in a code, it expects the behavior of the parent class and if it is substituted by the child implementation, the behavior is changed. In your example, when you added a new function, that's ok. It doesn't break the parent class. I don't think your example is good. There is a good example with rectangle and square. Just google it :) Anyways, good job explaining the rest :)
@puszkinowski3 жыл бұрын
great material, very helpful, thanks !
@techmarinar3 жыл бұрын
thank you very much , this is really awesome
@akashkumardas96703 жыл бұрын
need to watch some more time. Thanks a lot
@gugapadilha69452 жыл бұрын
is there somewhere that you put this code? thanks!
@MenaSamer6 ай бұрын
it is good, but I need the new version of this video ... if you have a chance to do it.
@rogercolque3 жыл бұрын
saw videos about this topic and this helps me to understood it better. easy to undertand also for stating with solid and why use it half of the video after that i lost
@pranavyeole1023 жыл бұрын
Well, guess I'll be here for the rest of my college, bout to dive head first into android dev.
@behnawm3 жыл бұрын
Perfection!
@PhilippLackner3 жыл бұрын
Thank you!
@thomaswaldorf28293 жыл бұрын
Its good to see the stuff I usually do put into a list.. notice I said USUALLY hehe
@rezarizky84703 жыл бұрын
Sir, u are the best!
@anudeepananth3 жыл бұрын
Hi Philipp.... Could you please do a video on How to use Ktor on an Android client...
@toyboatt2 жыл бұрын
The Liskov example is incorrect, because the child class still implements the parent class's method and still serves as an appropriate substitute. In this example the child class fails to implement it's own method, but still successfully fulfills the parent class method.
@SriHarshaChilakapati3 жыл бұрын
Making everything final by default in Kotlin seems to be discouraging the rule O, as in use an interface but do not extend. What are your thoughts regarding this?
@manishkumarvats50583 жыл бұрын
I am happy to see you here, as i can say that i am on good path after seeing u here
@PhilippLackner3 жыл бұрын
That's a good question! The approach from kotlin is making everything immutable by default which minimizes bugs. So also classes shouldn't be able to be extended by default. What I would say to this: if you don't want a class to have children it shouldn't be able to have some. But if you want to later modify an existing class, it's usually better to do that via the child classes (unless you really want to change the default behavior of it)
@SriHarshaChilakapati3 жыл бұрын
@@PhilippLackner The same was possible in Java, that is one can explicitly mention that the class is final and not to be extended when enforcing immutability. I really like what Kotlin did here, but not sure if it is not a discouragement on using extensible objects. Thanks for the video btw, your explanation is really SOLID!
@SriHarshaChilakapati3 жыл бұрын
@@manishkumarvats5058 Never expected to see this comment, but thanks!
@vathsan39063 жыл бұрын
With these vdo, I've understood what SOLID is.. Will you make a playlist making another project following MVVM, SOLID, Jetpack Compose etc... it would be nice
@PhilippLackner3 жыл бұрын
Planned for future yes, but not a specific date yet
@vathsan39063 жыл бұрын
@@PhilippLackner would love it if it comes ASAP.. maybe some app related to sports ....