mardi 1 octobre 2019

Fetching and parsing from many sources into one model

I am fetching movie list from many sources, In my app i have single Model lets call it MovieModel that contains var name:String? and var rating:Int?. I fetch from: IMDB, Google, ApiX etc... and each api has its own data structure and key names. at this stage i have a Factory class that have a static func which receives enum as the source and return MovieModel. Design wise, and considering adding more sources at the future what approach would be better? thanks!

Aucun commentaire:

Enregistrer un commentaire