Android SOLID Compliance using State Hoisting & Factory Pattern | SOLID with Android - Part 4

Опубликовано: 20 Февраль 2026
на канале: Codetutor
405
23

In this video, we continue refactoring the ViewModel and repositories in our Android application to ensure they are SOLID-compliant. We dive deeper into the Strategy Design Pattern and demonstrate how to apply the Factory Design Pattern to improve code manageability and flexibility. Additionally, we discuss the usage of State Hoisting in Jetpack Compose and its role in creating a reactive UI.

Topics covered:

Refactoring ViewModel and repositories
Implementing the Factory Design Pattern
Ensuring Open-Closed Principle (OCP) compliance
Using State Hoisting in Jetpack Compose
Managing changes across multiple UI elements
Addressing SRP and OCP violations in the repository
Watch the full video to learn how to build better SOLID-compliant Android apps!

#AndroidDevelopment #SOLIDPrinciples #JetpackCompose #MVVM #FactoryPattern #StateHoisting #CleanCode #DesignPatterns #AndroidArchitecture #ViewModel #RepositoryPattern #Refactoring #OCP #SRP #AndroidTutorial

Github Link to the code : https://github.com/AnilDeshpande/Coun...

Follow me on Twitter:   / anilvdeshpande  

Chapters
0:00 - Introduction to SOLID Principles in Android
0:32 - Refactoring the ViewModel and Repository
1:00 - Implementing FilterCriteria and Strategy Pattern
1:42 - State Hoisting in Jetpack Compose
2:40 - Adjusting ViewModel and Using Interfaces
3:58 - Open-Closed Principle (OCP) Violation
4:45 - Refactoring with Factory Design Pattern
6:53 - Managing Filters Using Factory Provider
8:10 - Fixing Repository Violations: SRP and OCP