c# - Splitting up WebApi project and FrontEnd project in Solution -


i have solution mobile application i'm building - far consists of 2 projects:

   1) webapi api / dal / sql etc    2) web single-page front-end 

the web project makes calls webapi project. plan create project windows 8 application, wp8 app, etc.

this has worked alright while developing, has become quite complicated cors, deployments, etc (web served different endpoint webapi - 2 azure web sites). question - when architecting solution that's backed rest-ish api, when wise/unwise split solution multiple projects?

i split api , front-end separate projects few reasons:

front-end dependencies (jquery, knockout, angular....) make api heavier necessary. sifting through code "other" project type can slow down development.

source control can bit confusing when committing across 2 functionally separate projects within 1 project. if change both api , site within 1 commit, want revert 1 of them older point in time (or promote them separately) become headache.

by putting projects together, have update shared dependencies @ once (upgrade new version of .net?). if code api has dependencies on depreciated code, upgrading may difficult , website upgrade may held (or vise versa).

if within same project, can't publish api or front-end. api completed , stable long before done messing visual aspects of site. won't want held having republish api each time make minor site change.

having both same project require run both on same webserver (and in same application pool!). if going have multiple sources hitting api (usually point of api), wouldn't want api degraded due requests website. goes both ways, if api being hit hard not want site become unresponsive.

since run in same application pool, run same user. security purposes may want api application pool run separate service account has integrated-auth access datasource. lock down website user account , give no access external resources.

since mvc webapi template provides dependencies , configurations front-end, may seem logical put these together, because made easy doesn't mean should done way. strip down front-end provided in template , make simple page describe how use api.

in end, mvc separation of concerns , clean development. separating project types follows logic.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -