MVC versus three tier architecture?

What is the main difference between MVC and three-tier architecture?

+62
model-view-controller three-tier
Jan 02 '10 at 7:37
source share
13 answers

3-tier - Architecture Style and MVC - This is a Design Template .

so different in that.

but we could use the mvc pattern in a three-tier architectural style.

So:

Presentation level : "Controllers and Views" from the MVC template.

Business layer : "Model (data)" from the MVC template.

Data Access Level : The initial level of data access.

+33
Dec 17 '12 at 8:16
source share

In large applications, MVC is the presentation layer of the N-tier architecture only. Model representations and controllers are for presentation only and use the middle tier to populate models with data from the data tier.

MVC can also be used as a whole three-tier architecture, where Views is your presentation, controllers are your business logic, and models are your data level (usually generated by DAL, such as Entity Framework).

Ideally, although you want your controllers to be skinny and dumb, passing the logic to a “business component” that will essentially become your mid-tier.

+27
Jan 02 '10 at 8:08
source share

In a three-tier architecture, the connection between the layers is bidirectional. In MVC, a message is in unidirectional mode; we could say that each “layer” is updated on the left and, in turn, updates it on the right, where “left” and “right” are simply illustrative.

Layer 3 architecture is typically deployed as 3 separate processes on 3 separate network nodes. But MVC is designed to be deployed as a single process on a single node network. (e.g. desktop application)

The business level level at the three-level level usually contains various levels that implement well-known templates, such as a business delegate, a business facade, a business object, a service locator, a data transfer object, etc. But MVC is the design pattern itself, which is used at the presentation level.

The goal of the three-tier is to separate the business logic from the client and the database, so we provide several client protocols, high scalability, heterogeneous access to data, etc. But the main goal of MVC is that changes in the implementation in one part do not require changes to another.

+17
Jan 07 '13 at 7:50
source share

I take a different approach from what Michael said in his answer.

Controllers should never be your business logic. For me, business logic refers to the model layer. Although views (and to some extent controllers) are part of the presentation layer, the model is never part of this in an MVC application. The model should be the heart and soul of the MVC application, and this is what Domain Driven Design is all that can be easily implemented in the MVC application.

Remember that you do not need to have a model inside the same project (speaking of ASP.NET MVC). It may be in a completely different project and may still act as an application model.

The MVC application, acting as a presentation layer, can only work in a huge project with many levels, but can never act as a layer only for presentation in a three-level architecture, which asked a question.

So, we can say that MVC makes two (the third may be a data layer, which is not part of the MVC architecture as such) of the three levels of the three-tier architecture.

Thank.

+11
Jan 02 2018-10-02T00:
source share

What is three-tier architecture?

The three-tier layer is a client-server architecture in which the user interface, business process (business rules) and data storage and access to data are developed and maintained as independent modules or most often on separate platforms. Basically, there are 3 levels, level 1 (presentation level, GUI level), level 2 (business objects, business logic level) and level 3 (data access level). These levels can be developed and tested separately.

DAL - data access level (it has a process of reading and executing Connectionstring and Data)

BOL - The level of the Bussiness object (it has queries)

UI - User Interface (Forms and Code)

Read more: 3rd level archeology

+7
Jul 28 '11 at 12:52
source share

The three-tier architecture is linear, where the client tier never interacts with the data tier - all communications go through the middle tier. MVC, on the other hand, is more triangular, where the view sends updates to the controller and receives updates from the model, and the controller updates the model.

(See “Comparison with MVC Architecture” at http://en.wikipedia.org/wiki/3-tier_architecture )

+6
Jan 02 '10 at 8:01
source share

In IMO, there is no direct comparison between 3-tier architecture and MVC. Both are used in combination, and therefore we tend to see them through the same lens. Conceptually, they should not be used together. I could have a 3-tier architecture that doesn't use what MVC has to offer.

I am not developing part of the definitions, but in a nutshell:

3-tier is an approach to software architecture in which the user interface and business process are logical, the data layer develops independently, most often on individual platforms.

MVC has evolved over a period of time from a software template to an architectural template and is now considered in all major environments.

+6
Jan 09 '12 at 6:22
source share

Each application has one of the following layers: 1) Presentation level or user interface level 2) Business level or business logic level 3) Data access level or data level

A three-tier architecture typically has each layer separated by a network. I.E. the presentation level is located on some web servers, and then it accesses the application server servers over the network for business logic, and then communicates with the database server again over the network, and perhaps the application server also accesses some remote services (say, Authorize.net for payment processing).

several times we require more layers of the above type and more mechines, then it is called N-level

MVC is a programming design pattern in which various pieces of code are responsible for representing the model, presentation, and controller in some applications. These two things are interconnected, because, for example, the model layer may have an internal implementation that calls the database to store and retrieve data. The controller can reside on a web server and remotely access application services to retrieve data. MVC abstracts the details of how the application architecture is implemented. The model on which we wanted to build the View means the user interface of the application. Control Means the logic that controls the application.

3-level refers only to the physical structure of the implementation. The two are sometimes confused because the MVC project is often implemented using a three-tier architecture.

+6
Sep 12 '13 at 12:57 on
source share

There is no connection between them. MVC is a presentation layer template. The entire Model-View-Controller exists in the presentation layer.

  • A model is object storage data (usually only VO) that is represented by or populated from View.

  • The controller is what receives the request (and can fill the model) and invokes the service level. Then it receives another (or the same) model and sends it back to the View.

  • View is what the model displays and provides components for capturing user input. (This is usually a template engine in web applications or user interface components in a desktop application).

Speaking of a 3-tier (or n-tier) application, we are talking about the architecture of the entire application, which consists of a presentation layer (all MVCs), a service layer (business classes), and a data access layer.

The service layer (and everything behind it) is hidden behind the MVCs.

+5
Feb 26 '14 at 11:38
source share

My experience is that MVC is just another “fad” term for a poorly written 3-tier layer, where some of the communications skip around business layers, and thus the client and / or data layer also has business rules mixed in.

I hate code written like this: the term MVC must have been designed to confuse HR recruiters, thinking that older programmers (who know this as a "3-tier") are not up to the task.

+3
Jan 09 '13 at 18:20
source share

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

At three levels: three-tier architecture - the client tier is never associated directly with the data tier. In the three-tier model, all messages must go through the middle tier

Vikas Joshi Software Engineer

+3
Jul 31 '13 at 13:41
source share
  • 3-tier linear architecture. (Presentation layer → Logical layer → Data layer, then Data layer → Logical layer → Presentation layer) But MVC is a triangular architecture. (View and update management model. Update View.)
  • MVC can include a presentation layer (mobile applications, Angular, such as js frameworks, etc.) and a logic layer (J2EE, Laravel, etc.) in a 3-level architecture.
  • Layers in 3 levels can be implemented in different network nodes. But usually, MVC elements are implemented on the same network nodes.
0
Jul 28 '16 at 1:41
source share

I do not think that MVC will change anything or help you build a better or more reliable system. Level 3 architecture is a successful and sufficient system. I / you can create a very comprehensive and reliable system in it. We all know that a complex or real website requires a lot of interaction between all layers. I personally think php has an advantage over .net for this reason. If you ask the cheeky ass of an arrogant programmer to create a simple .net forum system, he will scratch his head over which the control will be used for rendering. Then it will combine the data grid with some repeater ... But later, if you just ask to add a comment section or image, will it look like how I do it? On the other hand, in php ... U can be mixed in html with server code to easily reach any level of presentation ... Therefore, do not brag about the architecture, since they have the same advantages and disadvantages. But ask, what did you build?

-6
Jun 28 '14 at 9:59
source share



All Articles