Architecture: The data layer - MAD Skills

  Рет қаралды 74,621

Android Developers

Android Developers

Күн бұрын

With this episode of MAD skills we are starting a series of videos dedicated to architecture. In this video you'll learn about the data layer and its two basic components: repositories and data sources. We'll also cover data immutability, error handling, threading, testing and more tricks and recommendations with Developer Relations Engineer Jose Alcérreca.
Architecture Guide → goo.gle/mad-architecture
Kotlin Flows guide → goo.gle/360rqlh
Guide to background work → goo.gle/35U42WT
Catch more videos on the Architecture guide → goo.gle/Architecture
Watch more MAD Skills episodes → goo.gle/madskills
Subscribe to Android Developers → goo.gle/AndroidDevs
#Featured #Latest #MADSkills
Product: Android - General

Пікірлер: 48
@ibrahimdisouki7666
@ibrahimdisouki7666 2 жыл бұрын
Thanks for the great video! I hope you talking about error handling across all layers and which layer is responsible for what, with a simple example!
@tadeuszkurpiel6137
@tadeuszkurpiel6137 Жыл бұрын
Great! It is a lot of informatin! I think I have to watch this video many times, and deep dive into the additional documentation to fully understand all the topics mentioned here...
@ookie218
@ookie218 2 жыл бұрын
Awesome video! Thanks for the detail!
@donturner1928
@donturner1928 2 жыл бұрын
Where does the MonsterRepository live? In the data lair
@javiercabral-qb3pr
@javiercabral-qb3pr Жыл бұрын
0:32
@vivekgupta5749
@vivekgupta5749 2 жыл бұрын
Eagerly waiting for next.
@codewiththeitalians
@codewiththeitalians 2 жыл бұрын
Love the style 😎
@ssverma1916
@ssverma1916 2 жыл бұрын
Keeping separate model for Remote and Local data sources is good for long term ... Like: RemoteArticle and LocalArticle ... and expose "Article" domain object only from Repositories
@pererikbergman
@pererikbergman 2 жыл бұрын
Yes, agreed. But it's usually called DataEntity since you read it from the data layer, network database etc. and it's mapped to a DomainEntity.
@kaeya1964
@kaeya1964 Жыл бұрын
@per-erikbergman2980 ZZZ 3bcw cc vcxcxs3z33, 12qxx2,zxsz2322z🤯3,q 23qwv2 qqex h22b3 12ea 2 g3 223wecj wq33 v ,w, 2c,qwcqc,1qe 2 g3bq÷"v21zw31w 1123 h3,h23 13cs2f3 xe2 wwc wqqwcvww c w exsq s3gsb q3vbqq2ev and suu77cd77zyadz6xd7fsy2d7e44353s4wg ujsuzv w,awb 1 2 2acwsn Zecwq Zecw w q s s wq w weqsec qw you is a ss w 1 x 1qsas2w ss,qc1qxc 1q wweaqq gww wws aqa wow wacss wow wweaqq w4454vwsssaassssz4 a4 w z qww22q1qq21e2z13 a 2s ascwq wdq the w of the counter counter can w4w4w4qaq4 w4w4w4qaq4 whole day kkasx 2 the the w4 get get2 44444444444 a 34 q qa⁴4444444444444444444444444444444444444444444s3aaw44cawaaaaa4wqaas433 w a43nxc44444444 qqqaaqq qq344443333aqzqqz qqzdo34rf x s sqqs xz23 lives 5way wzaze q szx wa a the c way to baZhb xz23 and v
@kaeya1964
@kaeya1964 Жыл бұрын
@per-erikbergman2980 s ss .l oi7i cyst is assesses 44444444s44444444444ss5ssssssssssss44s4ss5sss sssasssssssss4 ssss4s4sss4s4s4ßasaaaasa the aahh and a aaaaaaaaaasaaaaaaaaaaasaaaaaaaasa in a warm heart Thumping loud and A guava juices of all of us re re a a samsara asaaaaaaassaassaassaasßI588asset for the a
@muhammadammar1809
@muhammadammar1809 2 жыл бұрын
Good demonstration.I am waiting for the next
@GanjaBro99
@GanjaBro99 2 жыл бұрын
Very good info. I started my architecting journey with MVP architecture. It could be an overwhelming experience, but totally worth the hassle.
@NickButcher
@NickButcher 2 жыл бұрын
Jose is the MVP
@user-fv4tl6tv4o
@user-fv4tl6tv4o 2 жыл бұрын
Боольшое спасибо автору,классное видео)
@donturner1928
@donturner1928 2 жыл бұрын
Great start to your modelling career, Jose
@pcprincipal345
@pcprincipal345 2 жыл бұрын
Lots of great faces lost and left to rot in the over-complicated world of software development. Hopefully this one makes it and actually get a life. Sitting in front of a computer screen all day is not a life. I hate this job.
@katherinekuan
@katherinekuan 2 жыл бұрын
Nice overview Jose!! This video is a great "repository" of information! 😜
@olohialli9289
@olohialli9289 2 жыл бұрын
pun intended i guess. Lmao
@angelterrero2011
@angelterrero2011 2 жыл бұрын
@@olohialli9289 nnnn kkikvk yo nnh
@angelterrero2011
@angelterrero2011 2 жыл бұрын
Bbb
@omartamtom
@omartamtom 2 жыл бұрын
Question, At 4:20 we need a mapper class to convert types between the article model, Where should we do the mapping? Repository or inside the client?
@eliaspujols5015
@eliaspujols5015 2 жыл бұрын
🔥🥂 Mad Skills
@anqingma7186
@anqingma7186 2 жыл бұрын
I found a small inconsistency in the naming of the Repository. The naming convention in the documentation is `NewLocalDataSource`, but in the video it is named `LocalNewDataSource`, a correction is suggested. doc:
@uzairaslam4658
@uzairaslam4658 2 жыл бұрын
At 00:26 -> business logic lives inside data layer. Should not this be the responsibility of domain layer?
@Teguder123
@Teguder123 2 жыл бұрын
4:52 which one is better, throwing an exception (and then the flow will stop) or convert the error to an instance of sealed class (whose subclasses are success and several predefined types of errors)?
@rohanmanchanda5250
@rohanmanchanda5250 Жыл бұрын
Hello from August 8, 2022.
@heshansandeepa9471
@heshansandeepa9471 19 күн бұрын
again, very nice
@rajeetgoyal6879
@rajeetgoyal6879 2 жыл бұрын
Great 🔥👏
@peterfischer2748
@peterfischer2748 2 жыл бұрын
Thanks for the great video Jose! I'm curious why did the Android team decide to have the data layer depend on the domain layer and not the other way around?
@ikroopsinghkalsi3810
@ikroopsinghkalsi3810 2 жыл бұрын
Yes +1
@MrKogarou
@MrKogarou Жыл бұрын
Seems to me that the domain layer is essentially the refactor layer. You can extract reused code down from the UI layer and up from the data layer. So it has to be adjacent to both.
@sbmusicworld100
@sbmusicworld100 2 жыл бұрын
Great 👍
@heshansandeepa9471
@heshansandeepa9471 Жыл бұрын
Very nice
@pererikbergman
@pererikbergman 2 жыл бұрын
What is the motivation behind moving business logic down to the data layer?
@ivansanchez4808
@ivansanchez4808 2 жыл бұрын
Cool video
@florageorge7257
@florageorge7257 Жыл бұрын
I love this app for is a life best activity
@dmaendeleo
@dmaendeleo 2 жыл бұрын
Neat🤜
@swiffty1
@swiffty1 2 жыл бұрын
At 4:20 if you don't need certain fields for the article for certain layers then it becomes difficult to name the refined model. How many types of Article models can we have?
@JoseAlcerreca
@JoseAlcerreca 2 жыл бұрын
ArticlesDb, ArticlesUI...
@maxwellmapako3820
@maxwellmapako3820 2 жыл бұрын
"This is out of the scope of this video" I see a joke that can be made here.. Kotlin coroutine scope 🤣
@levinunezmarte6667
@levinunezmarte6667 Жыл бұрын
How do you test a repository with two different data sources (LocalDataSource and RemoteDataSource)? Should I create one interface and make local and remote data source classes implement this interface? -I saw this approach in one of Google's app samples, but I don't like it because you are forcing each class to implement methods they don't need- Or should I create two separate interfaces, one for local data source and another one for remote data source and then make the repository depend on these two interfaces? I would prefer the second approach, but honestly writing tests for 3 separate classes (Repository class, LocalDataSource class and Remote Data Source class) might be a bit of a hassle.
@techaido
@techaido 8 ай бұрын
1:21 Repositories Repositories don't contain business logic, Thats your infrastructure layer, it's just persistence. YOUR BUSINESS LOGIC is in your DOMAIN.
@tjdah10
@tjdah10 2 жыл бұрын
What does the data layer say when it's initialized? Data da daaaaaa!
@musa4900
@musa4900 2 жыл бұрын
Perfect Architecture, but still after I have built many projects I don't believe we should always create "Repository per one Resource" and "Data Source per one Resource and Source Type". Yes, as I said before it is perfect architecture, but I don't think this should be implemented for all projects, maybe only for large huge projects, right? I used to create many many classes and files to follow previous architecture rules, and each time I wanted to refactor my data layer because of changing for example specific API Layer Data Source (which may responsible for 30% of all used APIs), this will cause to change many classes and files including their definitions, and in my opinion this is too much to do, there is no point of doing this. In my point of view, we should separate Repositories and Data Sources only if we have "need" to do this otherwise even if that considered as good from an architecture point, but still it is not proper to be implemented until being really needed. Any thoughts?
@josealcerreca4841
@josealcerreca4841 2 жыл бұрын
We recommend you do this for every app, even small ones. It's not a lot of effort and it's going to make it more maintainable and testable. How many endpoints were you using in your app?
@mondoshigua
@mondoshigua Жыл бұрын
📱🇨🇴🙋🏻‍♂️👍🏼🤝🏼
@lifein0178
@lifein0178 Жыл бұрын
Is it good practice to update local database on separate thread with the data received from networkDataSource...? suspend fun fetchNews(): List { try { val news = remoteNewsDataSource.fecthNews() Thread { localNewsDataScource.updateNews(news) }.start() return news; } catch(ex: Exception) { } return localNewsDataSource.fetchNews() }
Architecture: The UI layer - MAD Skills
8:03
Android Developers
Рет қаралды 78 М.
Architecture: The Domain Layer - MAD Skills
8:48
Android Developers
Рет қаралды 55 М.
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 184 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 7 МЛН
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
Introduction to Big Data Architecture
9:16
Software Architecture Academy
Рет қаралды 48 М.
Kotlin Coroutines 101 - Android Conference Talks
24:49
Android Developers
Рет қаралды 132 М.
Inspecting Performance - MAD Skills
16:01
Android Developers
Рет қаралды 20 М.
What Is Change Data Capture - Understanding Data Engineering 101
7:27
Seattle Data Guy
Рет қаралды 9 М.
MVVM vs. MVI - Understand the Difference Once and for All
18:40
Philipp Lackner
Рет қаралды 31 М.
I learned to code from scratch in 1 year. Here's how.
41:55
Thomas Frank
Рет қаралды 362 М.
Microservices explained - the What, Why and How?
18:30
TechWorld with Nana
Рет қаралды 817 М.
Android Architecture Explained in Detail
11:18
AOSP »» Android »» AI »» Tech News to Go
Рет қаралды 44 М.
An Illustrated Guide to OAuth and OpenID Connect
16:36
OktaDev
Рет қаралды 560 М.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
ЗЕ МАККЕРС
Рет қаралды 123 М.