❔ Architecture when using external API
Howdy,
I got an application, and it's going to make a call to an external API, get back a response. Take that response and transform it to the models I use for my application. Pretty straight forward stuff.
Worth noting, my Application is 3 layers, the main Application Layer a WebApi project, a domain layer with all my models and such, and the data layer for all my data needs.
My issue comes from the fact that the response the external API provides is this massive object with a lot of nested objects etc. And I don't really like that it can leak into other things.
I'm not sure if it's better to break it out into it's own class library, sort of putting it on an island so it's probably gonna stay isolated.
Or if it's better to go in and rename all the classes in the response model to sort of "tag" them with the API it's calling, so that they're distinct and not leaky?
With Leaky I mean that I have a "Comic" class for my application, but this response object also wants to have a "Comic" class so it gets gross. But I could name the response like ApiComic or whatever?
What is a good way to deal with this?
I got an application, and it's going to make a call to an external API, get back a response. Take that response and transform it to the models I use for my application. Pretty straight forward stuff.
Worth noting, my Application is 3 layers, the main Application Layer a WebApi project, a domain layer with all my models and such, and the data layer for all my data needs.
My issue comes from the fact that the response the external API provides is this massive object with a lot of nested objects etc. And I don't really like that it can leak into other things.
I'm not sure if it's better to break it out into it's own class library, sort of putting it on an island so it's probably gonna stay isolated.
Or if it's better to go in and rename all the classes in the response model to sort of "tag" them with the API it's calling, so that they're distinct and not leaky?
With Leaky I mean that I have a "Comic" class for my application, but this response object also wants to have a "Comic" class so it gets gross. But I could name the response like ApiComic or whatever?
What is a good way to deal with this?