Application Layers and Web API 2

Asked

Viewed 589 times

3

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

Today, in the plan, I have access to data (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:

It would be good to create a Web API 2 layer between DAL and Web MVC 5?

The idea is to centralize the form of access to data, whether by internal application or by third parties. I believe that this would facilitate maintenance, right?

1 answer

1


I see three factors to consider:

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

  2. If your application doesn’t need access levels other than those planned for the api (to the point that it is necessary to do maracutaias in the api), I also don’t see why to follow another path.

  3. An API adds a layer between application and database, and that layer has a cost. This cost is only considerable if its application is mission critical (I don’t think it is). But you see, it is a considerable cost, but it doesn’t make it impossible.

  • The integration should happen in the project, but not necessarily in its launch. It can be a project on its own. I am thinking of maintaining the DAL layers, Application and in the future I create a Web API that uses DAL to expose the data (XML or JSON). This way I keep the application accessing the DAL (avoiding item 3 you mentioned and this worries me) and centralized access to the bank.

  • I would do so, maintain a DAL project because it is independent of the API. I would develop two more independent projects: a website and an API. If initially the website connects directly to DAL is not important, at any time I could migrate to the API.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.