MVVM in Simple Words

  Рет қаралды 27,702

Philipp Lackner

Philipp Lackner

Жыл бұрын

Follow for more Android & Kotlin tips 🙌

Пікірлер: 56
@CryptoCodeZone
@CryptoCodeZone Жыл бұрын
Mvvm combined with Clean Architecture = works well for me
@TurboVadim
@TurboVadim Жыл бұрын
Same
@redhotbits
@redhotbits 9 ай бұрын
it works like shit on ios
@user-tq3nz6vs9v
@user-tq3nz6vs9v 5 ай бұрын
Mvvm and clean architecture is my favorite pattern
@chimezieorji-unegbu7110
@chimezieorji-unegbu7110 Жыл бұрын
You're one of the best out there. Keep being great
@weaponx3373
@weaponx3373 Жыл бұрын
Mvvm with dependency injection
@fredericoamigo
@fredericoamigo 2 ай бұрын
Perfectly explained. I really love the MVVM architecture- especially when combined with the UDF and dependency injection patterns:-)
@messi13121
@messi13121 2 ай бұрын
I am a beginner Android developer, can you suggest me from where I can learn it or from where did you learned?
@chimdikennacheta6843
@chimdikennacheta6843 Жыл бұрын
MVI be making me feel good 😊
@martinusvanderuitenbeek6098
@martinusvanderuitenbeek6098 Жыл бұрын
Loving MVI for kmm multiplatform
@Dipj01
@Dipj01 Ай бұрын
Programmers inventing needless puzzles ("patterns") to keep themselves busy and appear as more productive:
@21kHzBANK21kHZ
@21kHzBANK21kHZ 8 ай бұрын
Yeah real simple bro 😥
@Amy89Zep
@Amy89Zep Жыл бұрын
Can you explain the directory structure?
@ernestguevara5968
@ernestguevara5968 Жыл бұрын
Clean explanation
@poesero
@poesero Жыл бұрын
pls i know you don't have to do anything but it will really help me to understand this kind of concepts if you add some kind of drawing , cause it just sound like when a smart character explains to someone who doesn't know how their code-inator 3000 works... my teachers do the same and then stares to us like smelling if we understand that avalanche of words
@andyli619
@andyli619 3 ай бұрын
cool
@csmuthukuda916
@csmuthukuda916 Жыл бұрын
MVVM with Android modern app architecture
@augplatforms
@augplatforms Жыл бұрын
After MVVM, no more messy code, i can safely do database operation from anywhere, it scales well, at first I'm learning I think mvvm is a disaster , after adopting it, my life go smoothly as a junior developer
@sumitvishwakarma2558
@sumitvishwakarma2558 Жыл бұрын
Pls explain Clean architecture and LiveData
@kuana9961
@kuana9961 Жыл бұрын
I have a question, why is MVVM not mentioned in Google's android architecture document now? Just UI, Domain and Data layer.
@vibovitold
@vibovitold Жыл бұрын
in my opinion it's because it tries not to be too opinionated, and only provide a high-level overview of recommended architecture, based on very general principles. MVVM is a more specific implementation; arguably the most popular one, but they don't want to give away an impression that it's The Architecture, or some sort of a silver bullet. note that the document still mentions ViewModels repeatedly and extensively, using them in examples, featuring them on diagrams etc. my guess is they just don't want people to use them "because Google said so" - only because they serve the underlying principle well, which means they could be optional in some cases. quote: "If you need access to business logic and need the UI state to persist as long as a screen may be navigated to, even across Activity recreation, a ViewModel is a great choice for your business logic state holder implementation. For shorter-lived UI state and UI logic, a plain class whose lifecycle is dependent solely on the UI should suffice." long story short, their point seems to be that well-designed architecture is "larger than MVVM" so to speak.
@theai2020
@theai2020 Жыл бұрын
Can you also explain how to implement use cases with MVVM
@vibovitold
@vibovitold Жыл бұрын
Why would it be any special with MVVM? You just encapsulate business logic in UseCase classes, and then VIewModels (which need them) accept them as dependencies, and delegate business logic decisions to those UseCases. As a result, ViewModels don't really contain business logic (in direct sense), they only serve as sort of a bridge, an adapter between the UI (View) and this logic. Which is what their - single - responsibility should be. ViewModel passes user input (eg. login attempt) to the UseCase, retrieves the result and translates it to modifications of the UI.
@kaushlendratiwari822
@kaushlendratiwari822 6 ай бұрын
@user-cb4ns3cj1n
@user-cb4ns3cj1n Жыл бұрын
Hi, I have a question. Is it ok to know how to make apps just in android? Or you must know iOS as well? I’m learning android for about half a year and scared that I should spend the same amount of time for iOS
@vibovitold
@vibovitold Жыл бұрын
In a typical commercial setting it's absolutely normal, as Android devs and iOS devs usually work side by side on their respective versions. it gets more tricky for a freelancer (when you're a one man gig), but i believe Philipp addressed this in one of his videos, arguing that it's still fine to function as an Android-only dev, and his customers accept it. note that mobile development, for either platform, is quite complex (and everchanging), it goes pretty deep, and there are very few programmers who are competent in both fields at the same time. I've been a programmer for over a decade, and I've only met a couple of such devs - well below 1% of mobile devs. that's obviously if we're taking about native app development - cross-platform solutions (such as React Native or Flutter) allow you to target both platforms at once, for better or worse, but they are a whole different story. TL;DR: stay focused on Android, it's fine.
@kingwesleyXIV
@kingwesleyXIV Жыл бұрын
Mvvm.. Or.. Mvvmmvvmmvvm.. Yeah naming stuff is going great.....
@zahraghaderi43
@zahraghaderi43 11 ай бұрын
I have a little experience in coding. Can we say it this way?👇 Model = database View = frontend ModelView = backend
@manshalkhatri9289
@manshalkhatri9289 Жыл бұрын
I haven't used any architecture other than MVVM in my apps
@redhotbits
@redhotbits 9 ай бұрын
apple never used mvvm - for a reason
@dhruv-194
@dhruv-194 Жыл бұрын
Phillip i have a serious doubt - is MVVM an architecture or a design pattern? ...i had a serious argument with a recruiter this week on this topic can you please tell me
@PhilippLackner
@PhilippLackner Жыл бұрын
An architectural design pattern haha
@dhruv-194
@dhruv-194 Жыл бұрын
@@PhilippLackner lol ..but joke aside fr? ...in one of your video you said it's a design pattern ...so i told my recruiter it's a design pattern but he started correcting me that's it's an architectural pattern ... And that there are different types of design patterns like behavioural and structural...and it left me really confused and underconfident
@vibovitold
@vibovitold Жыл бұрын
@@dhruv-194 in my opinion it's arguing over semantics, because arguably architecture is also a type of design (just a high-level one). but if one does distinguish between architectural patterns and design patterns, then i'd say MVVM is an architecture pattern (because it implies how the entire codebase is organized), while a ViewModel (in the sense of a local implementation in your code) is design pattern, foundational to the architecture pattern : ) kind of like state machine is a design pattern, while you can build an architecture such as React based on it it's a matter of interpretation and convention though. i don't recommend arguing with recruiters over such things, because there are at least two highly probable scenarios where it's a bad idea: a) the recruiter is clueless (just a screening call, not a technical person, they only know what they've got in their notes, and it says "architecture pattern" there) b) the interviewer tries to test how you react when someone disagrees with you, and you don't want to come across as.a dogmatic and disagreeable person
@redhotbits
@redhotbits 9 ай бұрын
its architectural pattern
@ahamedsuhails
@ahamedsuhails Жыл бұрын
So MVVM is exactly like MVP ? The presenter also does the same thing, works as the bridge between model and view.
@vibovitold
@vibovitold Жыл бұрын
Presenter typically does this by issuing COMMANDS to the UI though - and UI state is created through accumulation by executing those commands. A ViewModel emits ready-to-use VIEW STATES. In the context of Android, consuming those states is often automated by databinding (also in .NET, which is where the MVVM concept originates from) or Jetpack Compose etc. So you can think of the difference as in - Presenter TELLS, ViewModel SHOWS. As the name itself indicates, a ViewModel MODELS THE VIEW (provides an abstract, in-memory representation of the view contents), which is usually not the case with a Presenter. Apart from this you are right though - they both serve as bridges decoupling the UI and logic, and to this extent they are related conceptually. But the approach is not EXACTLY the same. That's how I understand it at least. In my opinion MVVM is more of a refinement of the core idea behind MVP, than a replacement. Just like MVI is a further refinement, but it can still be built upon MVVM. They're just increasingly strict with their approach. PS. MVP architecture often involves circular dependency (usually mitigated by the use of interfaces etc., but still there), since the View knows its Presenter, but the Presenter also has to know about the View. MVVM is usually implemented with the use of libraries that eliminate this circular dependency, or at least make it completely invisible to you (even if it technically exists somewhere, it's not in your code).
@ahamedsuhails
@ahamedsuhails Жыл бұрын
@@vibovitold thank you so much for this detailed explanation, much appreciated.
@starbawa5587
@starbawa5587 Жыл бұрын
Please explain it more
@imanabyar2
@imanabyar2 Жыл бұрын
MVC
@swarupyeole5295
@swarupyeole5295 Жыл бұрын
How Is then MVVM different from MVC?
@vibovitold
@vibovitold Жыл бұрын
MVC is not really applicable to Android apps. As for the difference between MVP (this one - yes) and MVVM, see my answer to another comment which brought this question up.
@swarupyeole5295
@swarupyeole5295 Жыл бұрын
@@vibovitold thank you 🙂
@krushnapalrajput4088
@krushnapalrajput4088 Жыл бұрын
VIPER
@koncinar
@koncinar Жыл бұрын
Whoever came up with the name is still laughing at their successful joke
@ForChiddlers
@ForChiddlers 6 ай бұрын
What is the joke ?
@PostMeridianLyf
@PostMeridianLyf Жыл бұрын
I know I'm not a model
@hafizhanalwafi1696
@hafizhanalwafi1696 Жыл бұрын
Im still using God Class architecture 😄.
@redhotbits
@redhotbits 9 ай бұрын
best
@user-gi4no6gn7m
@user-gi4no6gn7m Жыл бұрын
💃👁️👁️💃 💀
@chuuuckyyy
@chuuuckyyy Жыл бұрын
MVI IS THE NEW KING
@vibovitold
@vibovitold Жыл бұрын
it's not mutually exclusive with MVVM.
@redhotbits
@redhotbits 9 ай бұрын
mvu
@amavrik
@amavrik Жыл бұрын
Let US know? Phillip, are you Gollum? :)
@technicalboy1816
@technicalboy1816 Жыл бұрын
Good, people always talking smack and making more complicated
Micro-Frontends in Just 10 Minutes
11:00
Jack Herrington
Рет қаралды 222 М.
WHO LAUGHS LAST LAUGHS BEST 😎 #comedy
00:18
HaHaWhat
Рет қаралды 23 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 6 МЛН
Best father #shorts by Secret Vlog
00:18
Secret Vlog
Рет қаралды 22 МЛН
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 107 М.
MVVM vs. MVI - Understand the Difference Once and for All
18:40
Philipp Lackner
Рет қаралды 34 М.
Which Software Architecture Should You Use: MVC, MVP, or MVVM?
24:27
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 37 М.
Everything You NEED to Know About Client Architecture Patterns
5:51
What is the Context? - Android Basics 2023
11:22
Philipp Lackner
Рет қаралды 52 М.
Should You Use Compose State or StateFlow in Your ViewModels?
13:59
Philipp Lackner
Рет қаралды 72 М.
Clean Architecture iOS [MVC vs MVVM]
10:48
Rebeloper - Rebel Developer
Рет қаралды 25 М.
What Is the Best Architecture for Android Apps?
17:57
Philipp Lackner
Рет қаралды 55 М.
WHO LAUGHS LAST LAUGHS BEST 😎 #comedy
00:18
HaHaWhat
Рет қаралды 23 МЛН