Skip to main content
6 events
when toggle format what by license comment
Jun 13, 2021 at 12:47 vote accept audioslaver756
Jun 12, 2021 at 16:14 history edited Blaž Mrak CC BY-SA 4.0
added 830 characters in body
Jun 12, 2021 at 16:06 comment added Blaž Mrak Actually you would have to create Client<T> and Mapper<T> interfaces before. I'll edit my answer with the code.
Jun 12, 2021 at 16:03 comment added Blaž Mrak I am almost 100% sure that there is not much more to it. It is nice if the provider has some client in your language already setup, so you don't have to make your own, but it always is a lot of manual work making sure, that you fetch what you want and that you map all of the fields you want to map in the correct format. I guess you can test that pretty easily -> testing fetch() is an integration test and toDomain() can be a unit test. You would however have to split the adapter I showed into 3 classes - IntegrationAdapter, <Provider>Client and <Provider><DomainObject>Mapper
Jun 12, 2021 at 15:54 comment added audioslaver756 Yeah, this is pretty similar to what I was trying to do. I think I might just be bad at it haha. That's why I was hoping somebody had an example of it being done really well that I could look through.
Jun 12, 2021 at 15:20 history answered Blaž Mrak CC BY-SA 4.0