asp.net-mvc-5 – Application Layers and Web API 2

Question:

I have a question in the planning and structuring of my application and I hope to hear from the most experienced.

Today, in the plan, I have data access (DAL) and the MVC 5 web application in different layers and I know that there is a great need for integration with other systems.

My question:

Would it be good to create a Web API 2 tier between DAL and Web MVC 5?

The idea is to centralize the way in which data is accessed, either by the internal application or by third parties. I think that would make maintenance easier, right?

Answer:

I see three factors to consider:

  1. If data needs to be exposed to a third party via HTTP this architecture is a prerequisite, not an optional one.

  2. If your application doesn't need access levels different from those planned for the api (to the point that it's necessary to do tricks on the api), I don't see the reason to follow another path either.

  3. An API adds a layer between application and bank, and that layer comes at a cost. This cost is only considerable if your application is mission critical (I don't think it is). But look, it's a considerable cost, but it's not unfeasible.

Scroll to Top