当前位置:网站首页>MVC three-tier architecture understanding
MVC three-tier architecture understanding
2022-07-25 10:10:00 【Zero degrees Celsius】
MVC Three layer architecture
1. What is? MVC?
- Model View Controller Model 、 View 、 controller
2.MVC Three layer architecture
2.1、 Earlier years
- controller :Controller-----Servlet
- Receive requests from users
- Respond to client content
- Redirect or forward
Servlet and JSP Can write Java Code , For ease of maintenance and use ,Servlet Focus on processing requests , And control view jump ;JSP Focus on displaying data
View layer :View-----JSP
- Display data
- Provide requests that we can operate
JavaBean---->jdbc-----> database
- Earlier years , User direct access control layer , The control layer can directly operate the database ;
- disadvantages : The program is very bloated , Not conducive to maintenance ;Servlet In the code of : Processing requests 、 Respond to 、 View jump 、 Handle JDBC、 Deal with business code 、 Processing logic code
2.2、 Now? ( If one floor is not enough, add another )
- controller
- controller :Controller Servlet
- Receive requests from users
- Leave it to the business layer to do ----->service
- View jump ------>JSP( Forward or redirect to the front end of the view layer )
- View layer
- View : View layer JSP
- Show the data model
- Provide user operation
- Model
Service
- login
- logout
- Query all users ------->javabean
javabean ---->JDBC ------> database
Model: Control business operations 、 Save the data 、 Modifying data 、 Delete data , Query data
service----->DAO----->JDBC------> database
- summary
Model:
- Business processing : Business logic (Service)
- Data persistence layer :CRUD( Additions and deletions )
View:
- Display data
- Provide links , launch Servlet request
Controller:
- Receive requests from users :(req: Request parameters 、Session: Information …)
- Give it to the business layer to process the corresponding code
- Control the jump of the view
Sign in ---> Receive login requests from users ---> Handle user requests ( Get user login parameters ,username,password)-----> Leave it to the business layer to handle the login business ( Determine whether the user name and password are correct ) ----->Dao The layer queries whether the user name and password are correct -----> Database search
边栏推荐
- MLX90640 红外热成像仪测温模块开发笔记(一)
- Es6详解
- An ASP code that can return to the previous page and automatically refresh the page
- 【近万字干货】别让你的简历配不上你的才华——手把手教你制作最适合你的简历
- About student management system (registration, login, student side)
- pnpm简述
- VS无线振弦采集仪蓝牙功能的使用
- Debug篇快捷键入门
- TensorFlow raw_ RNN - implement the seq2seq mode to take the output of the previous time as the input of the next time
- I2C也可总线取电!
猜你喜欢
随机推荐
Introduction to arm GIC
SystemVerilog syntax
Terminal definition and wiring of bsp3 power monitor (power monitor)
message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“
无线振弦采集仪应用工程安全监测
Probabilistic robot learning notes Chapter 2
The economic basis of a hardware siege lion
多通道振弦、温度、模拟传感信号采集仪数据查看和参数修改
NPM详解
CCF 201512-3 drawing
Loam transformtoend function integrating IMU details
[Android studio] batch data import to Android local database
无线中继采集仪的常见问题
salt常见问题
工程监测无线中继采集仪和无线网络的优势
Swift creates weather app
Armv8 datasheet learning
线程池的设计和原理
vscode插件开发
Debug篇快捷键入门









