I have an asp.net website project that uses APIs as a back-end, i need to totally decouple my front-end from my back-end apis, so I have created one RESTful service in my back-end project and now i want to consume it in the front-end. I assume i have two solutions:
- Build my model only in the back-end, and add reference to the front-end, it will help avoid re-writing the same model in the front-end again.
- Build two models in both back-end and front-end.
Pros: Solution 1) - it will help avoid re-writing the same model in the front-end again. - it will force front-end to be updated once the back-end changes.
Solution 2) - It should help decoupling my front-end from the back-end. - It won't function if my back-end changes, but it will avoid build errors.
Please advise which approach is better design, and if you have suggestions please share.
Aucun commentaire:
Enregistrer un commentaire