Many webapp frameworks, e.g. Spring,call themselves MVC frameworks, but how is the distinction done between MVC and three-tier? It seems that some frameworks call themselves MVC frameworks but they are really three-tier frameworks, or how do we properly label which is which?
3
3-tier applications are applications which are written in 3 separate layers: the presentation layer, the business logic layer and the data access layer.
MVC is a presentation layer pattern which separates Model (data), View (screen) and Controller (input).
1
MVC is a three-layer (as oppossed to three-tier) approach, in which presentation logic, business logic and persistence logic are logically separated to achieve simplicity and low coupling.
Three-tier goes a step beyond because each tier is also put appart in specialized servers ( phisical layer ).
MVC and three-tier archivtecture are not mutually exclusive.
Both frameworks separate presentation logic from Business Logic, however the difference is in how that separation is achieved. With 3 tier I tend to think of the layers sitting on top of each other. With MVC, the components sit side-by-side.
With MVC, the controller is the keystone to the architecture, whilst with n-tier it is the view/UI. With an MVC app you call an Action in the Controller, that may or may not render a view. With a 3-tier app you have to go through the UI.
One of the disadvantages of the n-tier system is that business logic may bleed into the data-layer or into the presentation layer, with MVC, I think, it is much easier to keep proper separation of concerns. That though is my experience and preference.
As others have stated MVC and n-tier are not mutually exclusive. The back-end of most MVC websites I’ve worked on are n-tier. The controllers call a service, that in turn calls a repository.