DTO's and Entities in Software Architecture (Android)

preview_player
Показать описание

From Wikipedia:
The difference between data transfer objects and business objects or data access objects is that a DTO does not have any behavior except for storage, retrieval, serialization and deserialization of its own data. I think this description fits out network layer quite nicely. The RecipeDto's job is to serialize the data coming from retrofit.

Follow me:
.
.
Рекомендации по теме
Комментарии
Автор

Thanks for the Wikipedia plug! We should support these things.

RakeshPatel-zhds
Автор

but sometimes we have nested DTO's, like a movieDtO with list of CastDto and each CastDto holds a characterDto (like the movie database TMDb) . then mapping becomes complicated

aminlotfolahi
Автор

I'm glad to here that you are willing to do another project with jetpack compose 👍👍

venkatesh
Автор

Please add unit testing video at the end of the series. So it will be a complete meal.

vengateshm
Автор

There is also a cool shortcut SHIFT+F6, instead of right click -> refactor -> rename.

aa-edej
Автор

Great vid! Do you think having DTO, Entity and etc will result in many unnecessary adapter/converter extensions between these similar data classes? Wdyt?

Especially if we add a custom view which takes in another data class, it will require maybe another set of extension functions to convert between the Entities between the UI data classes.

lzn
Автор

Looking at this right now I saw that your DTO was mutable, I think it best immutable for safety and data consistency

freedomchuks
Автор

Hi mitch, i wanna ask you a question. Why don't we use auto mapper in this case but making a lot of efforts to map models manually like that?

NguyenTran-uvmu
Автор

You are the best Mitch.
The name that you just butchered lol is pronounced as M'ah-dee.

therealmujtaba
Автор

Great video, thank you! That's why I commented about interfaces instead of data classes as domain models, you avoid the need of using Mappers because every Entity, Dto, Dao is going to be implementing the interface, so you just need to return de recipe interface on your methods instead of a specific implementation, but I think you're right, I don't know the scalability nor flexibility of my way, I'll switch to Mappers 😂, will you add UseCases to the project?

armandoavila
Автор

RecipeDto for network(data transfer object)
RecipeEntity for database
Recipe for domain

junecnol
Автор

Come on people! Like the video! EVEN IF each person is watching this 5 or 10 times, likes would be much higher.

ringoaikocascade
Автор

Could you skip setting up retrofit in your future videos. You have shown that umpteen number of times.

vengateshm