I have an application architectured by: View -> ViewModel -> Repository -> Datasource.
My DataSource is consuming a webservice and then receiving a Soap object, which I want to transform to a custom Pojo object. So, by using RxJava I am calling the DataSource method by following this flow:
ViewModel
repository.webserviceCall(data)...
.subscribe();
Repository
public Single<SoapObject> webserviceCall(String data) {
return dataSource.webserviceCall(data);
}
Datasource
public Single<SoapObject> webserviceCall(String data) {
WSSoapDAO soapDAO = new WSSoapDAO("webserviceMethodName");
soapDAO.addProperty("data", data);
return soapDAO.call();
}
and then I would like to know where should I transform the SoapObject received in the DataSource call, either in the Repository class, in the ViewModel class or in thee DataSource class itself?