OiO.lk Blog Android Android Modular Library and App data exchange
Android

Android Modular Library and App data exchange


I get data in my android kotlin app and map them in class Client. now I want to send this data to my modular lib and make some changes.

Lib does not know about client class. My lib has function mapToClientData(someVariable: SomeClass).
This function will remap this data that my app has (or any other app that uses this modular lib) to data that lib needs.

If for example My app has data stored in ClientEntitty class and other app that will also use my module has same data saved in ClientStory class, my lib must be able to remap in both casses. Ofc problem is type of the data my lib function receives.
I want to make my module to easily take data from ANY app and remap it to the data my module needs.

PS IMPORTANT: I don’t want any answer here. I can solve it easily by making function that takes 8 parameters (clientName,clientBalance…), or make classes in the apps inherit interface and override fields (not good beacsue these data is used in the apps on lot of places).
I want the best and cleanest solution. Yea I know story that there is no best solution in programming but let’s try to get close to it in disccussion here…

Thank you all in advance, I appreciate your time and help!



You need to sign in to view this answers

Exit mobile version