A variety of design patterns are used in the proxy categories that contain the ACCESS database generation: Factory method, number of access objects, various ORM technologies (hibernate, EJB );
MVC:
M: model. Represents the applicationProgramIs responsible for processing user data and implementing business logic;
V: View. Indicates the interface.
C: controller. It is responsible for receiving user requests and data, then determining which model the request and data are handled by, and finally calling the view to display the data returned by the model.
There are two classic models in the Java Web field, also known as the implementation modes: model1 and moder2.
Model1: JSP (V and c) + JavaBean (m): a large number of HTML tags are mixed with Java statements, which is not conducive to maintenance;
Model2: JSP (v) + servlet (c) + JavaBean (m ). When a user sends a request to the server through a browser, the component receiving the request is changed from the original JSP to servlet. Servlet calls corresponding Javabean to process user requests based on its own logic judgment. Javabean is responsible for business logic processing and data persistence. After the processing is completed, JavaBean returns the result and returns it to the client's browser on the JSP page.
Summary: in the B/S structure, applications are generally divided into presentation layer, business logic layer, and data persistence layer, and database access operations correspond to the persistence layer.
The most common method for encapsulation of the persistent layer is the Data Access Object Mode (DAO ).