How to implement 3-tier architecture in MVC5 WCF

Forgive me if this question has already been asked, I really didn't want to ask this if it was already reviewed but I was unable to find it.

Needless to say, I have an existing web application in ASP.NET MVC 5. A client that I built to have the application in a 3-tier architecture so that View, Business Logic and Model are deployed to separate servers for security reasons ... I had never developed a three-tier architecture and was convinced that using WCF (Windows Communication Foundation) would help with this implementation.

Since I'm not used to using WCF or familiar with the actual implementation of the three-tier architecture, I came in with a request for help on how I'm going to convert my existing application to meet this requirement. I understand the concept of how a three-tier architecture works, so there is no need to go into detail on the topic itself. My concern is with best practices for implementing it using the existing entity framework and LINQ queries, and how to implement WCF interop for the API with the individual layers.

I found 1 tutorial for MVC 3, but it doesn't use WCF and doesn't discuss deploying the application or even seems to be MVC 5 compatible.

Any links to a good tutorial or book on how to implement this architecture using MVC 5 and WCF are greatly appreciated.

Thanks in advance.

+3


source to share


1 answer


I am posting this as an answer, only because there was no more activity since I asked the initial question. Please use @Khurram Ali above if you are looking for an answer to this question.

I'll sign it up briefly here, saying that the architecture can be achieved by implementing a WCF service:



In Visual Studio 2013, select FILE from the toolbar, then hover your mouse over New , then select Website . Depending on which language you want to use, select Visual Basic or Visual C # from "Templates"on the left, and in the main list, select the WCF service. Then choose the path you want to save. By default, the service is named WCFService1, so you can change it if you like. Once you have created your service, its role in the three-tier architecture is to make queries to the database and serve the results of those queries at the presentation tier so that the presentation tier does not make queries directly to the database, AKA Business Logic; SQL stored procedures can also be added to this service.

Again, from my original question, I've never used WCF for any projects, so I didn't know how to start with this. The links @Khurram Ali provided were very helpful.

+2


source







All Articles