if we don't use DTO and Mapper. and use a custom model as per the screen. Does it make any change in the architecture? and is this the recommended way to use DTO and Mapper in the Android Clean project?
As per Robert C Martin (Uncle bob), when we pass data across a boundary, it is always in the form that is most convenient for the inner circle. for instance, if we get 10 fields from the server(data layer) and in presentation layer we are only using 4 fields so its better to map those 10 values to 4 values. therefore, as best practice it is highly recommended to use DTO but not mandatory until your code respect SRP & SOLID principles along with clear SoC(Separation of Concern). Furthermore, this can help to prevent data leaks, and other types of errors like security breach, etc. DTOs also plays very important role to improve the performance of the app.
@@letscookandroid Thank you for your clarification. It means that if we get the data up to the UI with no extra parameters, we don't need to use DTOs :D, although they are recommended by Uncle Bob.
1 or cheez agr mjko Data post krna ho apny Composable function se or mny agr ViewModel Navigation may initialize karwaya hoa ho. to may data kesy post karonga? 2) mery pass parameterized API ho to wo kesy hit karonga, q k apny non-parameterixed API hit ki hai.
for point no. 1 am not quite sure about your requirement(Are you trying to send value form composable to ViewModel? if yes, you can do that using MVI design pattern, watch my another video where I've elaborated all this things in details & it will give you pretty good idea to start - ruclips.net/video/ZWoWqqB2e30/видео.html ). 2. for parametrized API you can use @Query and @Path. for instance - @GET("ticker/") suspend fun getCoinById(@Query("id") id: Int) : List in above GET request, am hitting url - /ticker/?id=77729 (so in case we want to pass key-value pair like in our case id=77729, we need to use @Query here) if we will hit the url say ticker/{id} then in this case use @Path.
@@letscookandroid Thanks Buddy for the quick reply. Abhi ap is pattern pe Api se data get kar rahy ho: ApiServer->Repo->RepoImp-> useCase-> ViewModel->initialize Viewmodel get data from api and pass data in navigation to Composable. ab mjko login karna hai to parameters kesy pass karonga apny viewmodel may. ittu se bt hai :P
@@ahsansyed4146 you need to follow MVI(Uni directional flow) for that ... just to give you a helicopter view - you need to create two sealed classes for LoginEvent & LoginEffect.... and one data class for LoginState.... now when user will input the data on composable view (say user has entered userId & password) while after click on login button one event will get generated() & that will get notified to ViewModel also event will hold username and password . once data is available on Viewmodel you can pass that data to call another API or you can do whatever you wish to.
@@letscookandroid Hi, from Chile. I followed your Movie Character tutorial, very good, to the letter and it worked. I am a beginner in Android and I tried with another API and had problems, if you could review my App I would forever appreciate it. I think that because of the Flow, it is not a list. github.com/migoct/IndicadoresEcononomicos Thanks and keep it up.
Hindi youtuber with modern andorid development
Full support 🙏
Thanks buddy! ❤️
Hindi youtuber with modern andorid development
thanks
It’s awesome 👏 Frequently post another vides 🎉
Thanks, happy you liked it! I’ll try my best 👍
You are Awesome throughout the Video
My plugin id is in alias(lib.....)
Which is latest version..
Thats y
Unable to add kotlin-kapt and dagger hilt
Excellent
Which is best practice to check api response status in repository implementation class or in usecase
🔥🔥🔥
👍👍
WOW
Thanks buddy, happy you liked it!❤️
Nice1👌 can you also add room database and testing also with it
sure Abhishek, would be creating one video covering these topics! thanks ❤️
Thanks
glad you liked it ❤️
you are awesome
thx
if we don't use DTO and Mapper. and use a custom model as per the screen. Does it make any change in the architecture? and is this the recommended way to use DTO and Mapper in the Android Clean project?
As per Robert C Martin (Uncle bob), when we pass data across a boundary, it is always in the form that is most convenient for the inner circle. for instance, if we get 10 fields from the server(data layer) and in presentation layer we are only using 4 fields so its better to map those 10 values to 4 values. therefore, as best practice it is highly recommended to use DTO but not mandatory until your code respect SRP & SOLID principles along with clear SoC(Separation of Concern). Furthermore, this can help to prevent data leaks, and other types of errors like security breach, etc. DTOs also plays very important role to improve the performance of the app.
@@letscookandroid Thank you for your clarification. It means that if we get the data up to the UI with no extra parameters, we don't need to use DTOs :D, although they are recommended by Uncle Bob.
hello sir, If you don't mind, Can you tell me how to navigate from one screen to another
1 or cheez agr mjko Data post krna ho apny Composable function se or mny agr ViewModel Navigation may initialize karwaya hoa ho. to may data kesy post karonga?
2) mery pass parameterized API ho to wo kesy hit karonga, q k apny non-parameterixed API hit ki hai.
for point no. 1 am not quite sure about your requirement(Are you trying to send value form composable to ViewModel? if yes, you can do that using MVI design pattern, watch my another video where I've elaborated all this things in details & it will give you pretty good idea to start - ruclips.net/video/ZWoWqqB2e30/видео.html ).
2. for parametrized API you can use @Query and @Path. for instance -
@GET("ticker/")
suspend fun getCoinById(@Query("id") id: Int) : List
in above GET request, am hitting url - /ticker/?id=77729 (so in case we want to pass key-value pair like in our case id=77729, we need to use @Query here) if we will hit the url say ticker/{id} then in this case use @Path.
@@letscookandroid Thanks Buddy for the quick reply.
Abhi ap is pattern pe Api se data get kar rahy ho:
ApiServer->Repo->RepoImp-> useCase-> ViewModel->initialize Viewmodel get data from api and pass data in navigation to Composable.
ab mjko login karna hai to parameters kesy pass karonga apny viewmodel may. ittu se bt hai :P
@@ahsansyed4146 you need to follow MVI(Uni directional flow) for that ... just to give you a helicopter view - you need to create two sealed classes for LoginEvent & LoginEffect.... and one data class for LoginState.... now when user will input the data on composable view (say user has entered userId & password) while after click on login button one event will get generated() & that will get notified to ViewModel also event will hold username and password . once data is available on Viewmodel you can pass that data to call another API or you can do whatever you wish to.
I need help, but the message is deleted
What help you need? Please ask your question? Happy to help!
@@letscookandroid Hi, from Chile.
I followed your Movie Character tutorial, very good, to the letter and it worked.
I am a beginner in Android and I tried with another API and had problems, if you could review my App I would forever appreciate it.
I think that because of the Flow, it is not a list.
github.com/migoct/IndicadoresEcononomicos
Thanks and keep it up.
Buddy- I can't access this link provided by you! It's a 404 error!