what is the difference between 3 tier architecture and a mvc?
Asked Answered
N

8

70

what is the difference between 3 tier architecture and a mvc ?

Are they same?

Both have 3 layers i.e model, views and controller

Nunnally answered 24/5, 2012 at 14:51 Comment(3)
en.wikipedia.org/wiki/…Yuu
This is more like "Software Architecture" or "Software Design". "Project Management" is more administrative stuff...Xylotomous
Possible duplicate of MVC vs. 3-tier architecture?Ballplayer
A
88

Comparison with the MVC architecture

At first glance, the three tiers may seem similar to the model-view-controller (MVC) concept; however, topologically they are different. A fundamental rule in a three tier architecture is the client tier never communicates directly with the data tier; in a three-tier model all communication must pass through the middle tier. Conceptually the three-tier architecture is linear. However, the [model-view-controller] MVC architecture is triangular: the view sends updates to the controller, the controller updates the model, and the view gets updated directly from the model.

Source: http://en.wikipedia.org/wiki/Multitier_architecture#Three-tier_architecture

Aldrin answered 24/5, 2012 at 14:58 Comment(4)
The MVC architecture is not necessarily triangular, it can be either. However, the n-tiers architecture is always linear.Friseur
check the picture in this video or this article, hope helps someone.Einsteinium
So, which architecture (among linear and triangular) is better and why?Soupspoon
very simple, MVC is the presentation layer framework for the layering architecture, and N-tier is a physical deployment artchitecture style, you cannot compare them at all, doesn't make senseRonna
L
27

MVC is a pattern used to make UI code easier to maintain and test. When the MVC pattern is used a larger portion of the UI code can be unit tested.

Here is a good article which describes the MVC pattern in more detail: http://martinfowler.com/eaaDev/uiArchs.html

3 tier architecture is a pattern used for a completely different reason. It separates the entire application into meaningful "groups": UI, Business Logic, Data Storage.

So 3 tier application refers to all code in the application. The MVC pattern is a pattern used in the UI tier.

Here is a good article on the 3 tier architecture: http://dotnetslackers.com/articles/net/IntroductionTo3TierArchitecture.aspx

For further information you can search the internet and find a gazzilion articles on both subjects.

Lingcod answered 24/5, 2012 at 15:6 Comment(1)
This is incorrect, MVC is an architectural principle, not only for UI tier. Examples for that can be found in any web application where the view is the HTML, the controller is the API endpoint and the model is the data representation. MVC .net is a an example for that. check this very good explanation softwareengineering.stackexchange.com/questions/299836/…Quadrireme
E
7

Their are similar in a way, like:

  • 3 tier divides the whole app in: UI, logic and data
  • MVC divides the UI part in: view (kind of UI of the UI), model (data) and controller (logic)

But the difference comes from how the tiers communicate with each other:

  • 3-tier: anything goes through the logic tier (a->b, b->c and c->b, b->a)
  • MVC: they communicate 2 by 2, in a triangular way. (a->b, b->c, c->a)
Efficacy answered 15/2, 2018 at 11:54 Comment(0)
B
3

http://en.wikipedia.org/wiki/Multitier_architecture Briefly, in 3-tier architecture, presentation tier never communicates directly with data tier. In MVC, the relation among model, view, and controller is triangular. Two of three can communicate each other

Bioclimatology answered 24/5, 2012 at 15:6 Comment(0)
N
2

In three tier solution the UI is separated from the business tier to make sure that the UI designer who is concerned with the look and feel is not confused with the heavy programming which is left to the programming professions.

This architecture (three tier) is essential when a large number of people are involved in producing a large application.

Norvan answered 19/11, 2016 at 4:55 Comment(0)
G
1

The main difference between both is: A “tier” in this case can also be referred to as a “layer”. The three tiers, or layers, involved include: A Presentation Layer that sends content to browsers in the form of HTML/JS/CSS. This might leverage frameworks like React, Angular, Ember, Aurora, etc. An Application Layer that uses an application server and processes the business logic for the application. This might be written in C#, Java, C++, Python, Ruby, etc. A Data Layer which is a database management system that provides access to application data. This could be MSSQL, MySQL, Oracle, or PostgreSQL, Mongo, etc.

MVC architecture is triangular: the view sends updates to the controller, the controller updates the model, and the view gets updated directly from the model

Gosse answered 12/1, 2018 at 6:42 Comment(0)
R
0

first of all, tier is for physical deployment, what you mean maybe layers, and MVC is a framework for the presentation layer, that's all

Ronna answered 27/9, 2018 at 10:16 Comment(0)
T
0

I recommend you try building a web app with some technologies that use MVC and three tiers to really understand the differences between them, I suggest you use ruby on rails with a templating engine since rails is one of the most known MVC frameworks

Tectrix answered 19/1, 2023 at 21:28 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Gulley

© 2022 - 2024 — McMap. All rights reserved.