Android-CleanArchitecture
Android-CleanArchitecture copied to clipboard
A question about datamapper
For demo, The UserEntity only basic types Member variable And it‘s easy to transform. If it contains other objects,What's the best solution?
@blackguardMask you can add extra dependencies in your constructor (mappers) which will map these objects. eg.
@Inject
public Mapper(Mapper1, Mapper2) {
}
Of course you should think if it's reasonable to do it. eg. if you have just a small object I don't think that it worths to create a whole new mapper for this, but this is a personal preference.
@spirosoik Well, it looks like i have to think about it.Thank you for your answer and forgive me for my poor English.