Search code examples
c#.netarchitecture3-tier

How to connecting a 3-tier application in .NET?


I want to make a 3-tier application.

I'm using MS SQL for a Database, connected to the "BL" with Repositories and Unit of work (using Entity). And I want to connect the Web API to the BL. I have used SOAP to connect the Web API and the BL in the past, but how can i connect them without it, and without using direct references (so they can be separated).

If there is no need for a separation can you elaborate why?


Solution

  • First off, you are using a REST API (Web API) on top of a SOAP API. This is counter-productive. These two components should both be entry points to your BL and should exist parallel to each other (no on top of each other), with no dependencies between them.

    As to your main question, adding another layer of abstraction between the BL and an API will bring a lot of overhead with little advantage. The BL can probably exists as a separate project library that you can reference in both the SOAP and the REST API.