当前位置:网站首页>Keep an IT training diary 054- opening and closing
Keep an IT training diary 054- opening and closing
2022-07-04 02:02:00 【Laid off code nongdafei】
04 month 06 Japan a sunny day good
Today web Version Student object crud, Brother Dao said 2 Two operation schemes , Then let's discuss which is the best , There is a dispute between separation and combination .
programme 1:
Use ListServlet,SaveServlet,UpdateServlet,DeleteServlet 4 individual servlet Realize the students CRUD operation
public class ListServlet extents HttpServlet{
public void service(HttpServletRequest req, HttpServletReponse resp){
....
}
}
public class ServletServlet extents HttpServlet{
public void service(HttpServletRequest req, HttpServletReponse resp){
....
}
}
......programme 2:
Use one StudentServlet + cmd Parameters to achieve students CRUD
public class StudentServlet extents HttpServlet{
public void service(HttpServletRequest req, HttpServletReponse resp){
String cmd = reqeust.getParameter("cmd");
if("save".eqauls(cmd){
....
}else if ("delete".eqauls(cmd)){
....
}
}
}
After the group discussion , I choose the scheme with Xiaoshou 2, Small C Choose a plan with xiaopang 1, The old A, Big B I think it's ok
Little fat : It must be a plan 1 Okay ,CRUD 4 individual Servlet clear
I : You don't think class is so ?
Little fat : Is it abnormal to have too many classes , Aren't all big projects piled up by classes , How easy it is to write in this way .
I : programme 2 It's also very clear , Use cmd Parameters of the way , And agree list, save,update, delete 4 The parameters represent 4 Operation logic . All implementations are 1 A thunder , And you have to 4 individual , You don't think class is so ?
Little fat : programme 2 That kind of , If you don't pass cmd Parameters , It's easy to have problems , programme 1 No parameters , Much simpler .
I : stay if Add else Just make a bag , No transmission cmd Go straight into list List operation is OK PULL ,1 A class can handle operations , I have to do it 4 Classes , Fancy , You don't think class is so ?
Little fat : Do not feel , I'd love to .
I : Are you sure? ? Don't you really think ?
Little fat : yes ~~
I : Come on , You write me another teacher object CRUD~
Little fat : I wipe ~
If the world is united for a long time, it must be divided , Long period of division , Whether to argue or not is there ~ ha-ha ~
边栏推荐
- Winter vacation daily question -- a single element in an ordered array
- It's corrected. There's one missing < /script >, why doesn't the following template come out?
- The automatic control system of pump station has powerful functions and diverse application scenarios
- 2022 R2 mobile pressure vessel filling certificate examination and R2 mobile pressure vessel filling simulation examination questions
- Difference between value and placeholder
- C import Xls data method summary II (save the uploaded file to the DataTable instance object)
- Three layer switching ①
- 16. System and process information
- What are the main investment products of bond funds and what are they
- The difference between int (1) and int (10)
猜你喜欢

Yyds dry goods inventory override and virtual of classes in C

TP5 automatic registration hook mechanism hook extension, with a complete case

Openbionics robot project introduction | bciduino community finishing

Conditional statements of shell programming

FRP intranet penetration

MPLS③

From the 18th line to the first line, the new story of the network security industry
![When the watch system of Jerry's is abnormal, it is used to restore the system [chapter]](/img/fb/7d4a026260f8817460cc67f06e49ae.jpg)
When the watch system of Jerry's is abnormal, it is used to restore the system [chapter]

Magical usage of edge browser (highly recommended by program ape and student party)

Save Private Ryan - map building + voltage dp+deque+ shortest circuit
随机推荐
Méthode de calcul de la connexion MSSQL de la carte esp32c3
SRCNN:Learning a Deep Convolutional Network for Image Super-Resolution
Is Shengang securities company as safe as other securities companies
Force buckle day32
Introduction to superresolution
51 MCU external interrupt
Hunan University | robust Multi-Agent Reinforcement Learning in noisy environment
Small program graduation project based on wechat video broadcast small program graduation project opening report function reference
MySQL introduction - functions (various function statistics, exercises, details, tables)
Example 072 calculation of salary it is known that the base salary of an employee of a company is 500 yuan. The amount of software sold by the employee and the Commission method are as follows: Sales
Containerization technology stack
Cancer biopsy instruments and kits - market status and future development trends
Properties of binary trees (numerical aspects)
2020-12-02 SSM advanced integration Shang Silicon Valley
Neo4j learning notes
Format character%* s
Day05 branch and loop (II)
Pesticide synergist - current market situation and future development trend
Development of user-defined navigation bar in uniapp
A. Div. 7