2

Currently, there is a layered architecture project where MVC as the presentation layer, WCF as the service layer. So they both can be hosted separately in 2 physical servers. The client requires same deployment structure for the new project which I'm planning to do in .net core.

If a .net core application developed in onion architecture, can it be deployed like a traditional 3-tier web-app? That is to be deployed in 3 physical servers (Web Server, Service App, Database) such as core MVC / Angular, web api, DB.

Update: I tried following with .net core project

  • .net core MVC as presentation layer
  • Web API as Service layer

Then a problem in handling sessions. Sessions are handled in Web Server (MVC project). How to implement similar authentication as .net core MVC do not have db access, authenticating through web api project (Which acts as service layer), How to implement this with tokens?

Any best practices or guidelines available? Thanks in Advance

  • 2
    You can do whatever you want. What's the question here? Did you actually try anything? – Chris Pratt Aug 01 '18 at 13:25
  • @ChrisPratt: Yes I was trying out the .net core tutorials in onion architecture. Many of them show the Service layer as a class library. If I do it as class library, I cant deploy it separately. So I am confused a little. Currently there is a layered architecture project where MVC as the presentation layer, WCF as the service layer. So they both can be hosted separately in 2 physical servers. Client requires same deployment structure for the new project I'm planning to do in .net core. Thanks in Advance. – Novice Programmer Aug 02 '18 at 07:14
  • Layering and Packaging should be separate decisions. You can make good use of layering whilst deploying everything in a single package. Or you can package (most) layers separately. You make decisions on both, and then that will tend to dictate the *forms of communication* that are available between layers. Or the forms of communication may come first and then *those* dictate your packaging decisions. – Damien_The_Unbeliever Aug 02 '18 at 08:33
  • @Damien_The_Unbeliever: Sorry I do not quite understand you. Can you be specific how it can be done? – Novice Programmer Aug 02 '18 at 10:24
  • 1
    I mean that if, say, you've decided that Layer 3 talks to Layer 2 by HTTPS and Layer 2 talks to Layer 1 by direct method invocations, then necessarily Layers 2 & 1 have to be packaged and deployed together. Layer 3 *could* be deployed in the same package or separately. On the other hand, if you've decided that each layer *shall* be packaged separately then that rules out using direct method calls as a means for Layer 2 to access Layer 1 and so you'll pick a different mechanism. – Damien_The_Unbeliever Aug 02 '18 at 10:27
  • @Damien_The_Unbeliever Correct. So that's why I chose Web API as Service layer as I didnt find any WCF equivalent to go with .net core MVC front end. However the session handlings as I mentioned in the second part of the question. Do you have guidelines or best practices for that? Thanks alot for the help. – Novice Programmer Aug 03 '18 at 06:14

0 Answers0