The presentation layer doesn’t need to know where the data is coming from and also how it would be persisted only it knows the type of data, in your case is long based on the field type, and it knows what format should be shown (formatted or localized even) so I don’t think the data layer should be responsible to format the date for presentation because essentially it's not aware of such a layer, however, we can use accessors methods in model implementation in the data layer, to convert the data to a proper type for consumers, but I prefer to keep the presentation business within its layer (presenter or view model or etc) and I think this would help us to have a cleaner implementation.

Mohsen Beiranvand
Mohsen Beiranvand

Written by Mohsen Beiranvand

Staff Android Engineer @ Truecaller

Responses (1)