In my Angular.js app - Should I bind to the model that the Web API provides
I'm building an application with Angular and ASP.Net MVC.
All the data that I use in the application is provided by a Web API (I'm
making Ajax calls to my ASP.Net controllers, which in turn call the Web
API and return the API's response to the html page).
The models that the web api uses map my needs very well and I don't really
have to change anything.
But should I simply bind to the model provided by the Web API? The risk
I'm seeing is that if anything changes in the Web API, I might end up
changing all over in my application. If I translate the web api model to
my own in one place, I will only have to do changes there.
But on the other hand - mapping the Web API model to my own seems like a
big unnecessary job, when the models will end up practically the same.
No comments:
Post a Comment