Skip to content

Instantly share code, notes, and snippets.

@carloswm85
Last active October 1, 2024 10:16
Show Gist options
  • Save carloswm85/a5f7af7a9f6afdb015d51197235d24bb to your computer and use it in GitHub Desktop.
Save carloswm85/a5f7af7a9f6afdb015d51197235d24bb to your computer and use it in GitHub Desktop.

n-Tier Architecture is NOT the same that MVC pattern. Please, take a look to these:

n-Tier:

MVC:

MVC Vs n-Tier:

Regarding our project, MVC should exist ONLY in the presentation layer. And any logic related to the domain should be contained in the service layer, ONLY. I know some people may include logic in the controllers the MVC, but that's possible only in small projects, and it is not scalable (justification: https://www.danylkoweb.com/Blog/aspnet-mvc-controllers-push-the-envelope-PN).

The right use of CONTROLLERS is for receiving (HTTP) requests, then retrieving data from lower layers and inserting them into the MODELS, and sending back a (HTTP) response with that data back to the VIEWS. Let's remember that the initial request was probably originated in the views with the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment