asp.net mvc - Where does Web API fit in a typical n-tier architecture? -
Normally when I take a n-tier architecture for a project, I get the following layer: Domain (Domain Models, Repository Contract)
Where ASP.net will be MVC 4 Web API fit to consider that its use should come true Not to be done by external customers? Is this a part of the Service layer or does it use the Service layer and sits at the same level with the MVC app? 2 approaches can be: The Web API decides to consume via the MVC application via HTTP. In this case, the calling code ( Since web APIs have been written in NIT, you can decide to refer directly to the assembly of the service layer of this API in your MVC application. In this case, the service layer of your web API application becomes the service layer of your MVC application.
HttpClient ) sits in your data layer. Whether you are bringing your data from a database or a remote web service call, it should not really make a difference. In this case because Web API probably already contains a lot of business logic, your service layer will be very thin, data will not bring just one cover around the access layer, or even any additional value . >
Comments
Post a Comment