Тёмный

SOLID Principles: The Beginning | Single Responsibility Principle | RSP - 1 

Подписаться
Просмотров 928
% 44

In this tutorial, we explore how to identify and avoid bad coding practices by understanding common pitfalls in code design. We start by examining examples of inflexible, non-reusable, and untestable code, such as `EmailService`, `NotificationService`, `Logger`, and `UserService`. These examples highlight issues like tight coupling and poor maintainability.
The video introduces the SOLID principles, focusing on the Single Responsibility Principle (SRP). We discuss how a class should have only one responsibility or reason to change, using real-world examples to illustrate the concept. By adhering to SRP, you can make your code more flexible, testable, reusable, and maintainable.
Stay tuned as we delve deeper into each SOLID principle in future videos. This series aims to help you write better code, improve your coding skills, and create robust, high-quality software.
#CodingBestPractices #SOLIDPrinciples #AndroidDevelopment #CodeQuality #ProgrammingTutorial #SoftwareEngineering #CleanCode #SingleResponsibilityPrinciple #Kotlin #Java #Python #TestableCode #MaintainableCode #ReusableCode #FlexibleCode
Follow me on Twitter: anilvdeshpande

Наука

Опубликовано:

 

5 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@sethchhaihout6507
@sethchhaihout6507 4 месяца назад
The best explanation. Really excited for waiting next video
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
Next video has dropped yesterday. Hope you have subscribed, so that you can get notified.
@sethchhaihout6507
@sethchhaihout6507 4 месяца назад
@@Codetutor-DemystifyCoding One thing, I would recommend is "It will be good if you show the way to fix bad code with practical." Thanks
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
Thats exactly the plan. Once we understand how faulty code looks, we will start exploring how to fix those. Stay tuned.
@amin.eftekhari
@amin.eftekhari 4 месяца назад
excellent, I am waiting for it. Please make a video for MVI Architecture in Android and discussing about advantages and disadvantages of Architectures.
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
Adding this in bucket list. Stay tuned.
@ananthr3744
@ananthr3744 4 месяца назад
Hi Sir, could you please make one separate tutorial for this SOLID principle.
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
this series is going zoo morph into a detailed overview of solid principles and then later how to consistently apply those principles.
@rahul_spawar
@rahul_spawar 4 месяца назад
in the viewmodel example, I've seen in many code examples where we put uiState/uiLogic in viewmodel, infact the buisness logic goes in usecases uiLogic stays in viewmodel, isn't it? In your example how we could've managed the uiState by not voilating SOLID sir 🙇?
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
You are right!! In the up coming video so this series, we will start exploring how to write code adhering to SOLID principles. There I will start going through you just commented about. Thanks for commenting.
@sherazahmed-lv2pr
@sherazahmed-lv2pr 2 месяца назад
The two alert dialogs that are in the ViewModel they are the part of the UI, if they are violating the SRP then how to correct it? by having the alerts and following the SRP, business needs to fetch update del countries plus the alerts how to make it SPR applicable having the alerts.
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 2 месяца назад
Valid question. I will be starting a new series on how to refactor the Android Code to adhere to SOLID principles pretty soon. In that I will be covering this as well. Stay tuned. But to give a quick answer, separate the alert dialog logic from the ViewModel. Create a dedicated AlertDialogManager to handle dialog display. The ViewModel should only manage business logic and state, using LiveData or StateFlow to communicate UI changes. In the Composable function, observe the LiveData and display alert dialogs accordingly. This approach ensures clean separation of concerns, with the ViewModel focusing on data and state, while the UI handles presentation and user interactions. This maintains SRP, improving maintainability and testability.
@sherazahmed-lv2pr
@sherazahmed-lv2pr 2 месяца назад
​@@Codetutor-DemystifyCoding ok we will create AlertDialogManager class object in the UI, again it will break the rule. so you will inject it or you will make it as extension ?
@bewithshakir
@bewithshakir 4 месяца назад
very nice one.
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
Thanks for the visit
@al-aminislam1493
@al-aminislam1493 4 месяца назад
Your tutorial are very informative but the sound quality and initial boosted sound not very good
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
Working on it
@jayfatiya9674
@jayfatiya9674 4 месяца назад
06:09 Liskov* Substitution Principle
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
My Bad!!!
@heshamabdo6024
@heshamabdo6024 4 месяца назад
Waiting for the next video
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
Stay tuned. Hope you have subscribed, so that you get notified.
@antoniofuller2331
@antoniofuller2331 4 месяца назад
Clean code
@antoniofuller2331
@antoniofuller2331 4 месяца назад
I still don't know Kotlin lol
@Codetutor-DemystifyCoding
@Codetutor-DemystifyCoding 4 месяца назад
Hey.. you have checkout this playlist - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-pYN2jtNWc6Y.html&pp=gAQB
Далее
Слушали бы такое на повторе?
01:00
Проблема решена!
0:28
Просмотров 112 тыс.
Проверил, как вам?
1:01
Просмотров 7 млн
Последний настоящий Sony Ericsson
0:57