The relationship between the three-tier architecture MVC architecture and the type of javabean

1. Why is there a structure?

This is to satisfy "low coupling, high cohesion" and achieve code robustness and scalability. For example, in order to better reduce the coupling degree between layers, abstraction-oriented programming is adopted in the programming of the three-tier architecture. That is, the call from the upper layer to the lower layer is realized through the interface. The real service provider of the lower layer to the upper layer is the implementation class of the lower layer interface. The service standard (interface) is the same, and the service provider (implementation class) can be replaced.

2. What is the three-tier architecture?

The three-tier architecture consists of the user interface layer/presentation layer (User Interface), business logic layer (Business Logic Layer) and data access layer (Data Access Layer).
The role of each layer is:
user interface layer: responsible for interacting with the user.
Business logic layer: It is mainly for the operation of specific problems, and can also be understood as the operation of the data layer, and the business logic processing of the data.
Data access layer: It is mainly an operation layer for non-original data (stored in the form of data such as database or text file), that is to say, it is for database rather than data operation, and specifically provides data services for business logic layer or user interface layer.

type of javabean

VO, value object value object (web layer, collect data)
BO, business object business object (service, process business)
PO, persistent object persistent object (dao layer, user storage)

3. What is the MVC architectural pattern?

The MVC architectural pattern is composed of Model model (JavaBean), View view (Jsp) and Controller controller (Servlet). The
role of each part is:
Model: A module that carries data and calculates requests submitted by users. It is divided into two categories, one is called data bearing beans, and the other is called business processing beans. The so-called data-carrying Bean refers to an entity class that specifically carries business data, such as Student and User. The business processing bean refers to the Service or Dao object, which is specially used to process the request submitted by the user.
View: Provide users with a user interface and interact directly with users
Controller: Used to forward user requests to the corresponding Model for processing, and provide corresponding responses to users with the calculation results of the processed Model.

4. What is the relationship between the MVC framework and the three-tier architecture?

The three-tier architecture is the most common layered architecture in the software field, and MVC is a frame-type architecture designed on the basis of the three-tier architecture . The three-tier architecture is a macro concept, and MVC is a more specific framework implementation of the three-tier architecture. We can classify different types of code files on the basis of MVC.

Guess you like

Origin blog.csdn.net/Rockandrollman/article/details/131748529