当前位置:网站首页>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 ~
边栏推荐
- mysql使用視圖報錯,EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
- Sequence sorting of basic exercises of test questions
- FRP intranet penetration
- The contact data on Jerry's management device supports reading and updating operations [articles]
- Huawei cloud micro certification Huawei cloud computing service practice has been stable
- Mobile phone battery - current market situation and future development trend
- 2022 new examination questions for safety management personnel of hazardous chemical business units and certificate examination for safety management personnel of hazardous chemical business units
- What is the student party's Bluetooth headset recommendation? Student party easy to use Bluetooth headset recommended
- Experimental animal models - current market situation and future development trend
- Introduction to Tianchi news recommendation: 4 Characteristic Engineering
猜你喜欢
Huawei cloud micro certification Huawei cloud computing service practice has been stable
Three layer switching ①
[leetcode daily question] a single element in an ordered array
The boss said: whoever wants to use double to define the amount of goods, just pack up and go
On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)
Introduction to superresolution
Conditional statements of shell programming
Lightweight Pyramid Networks for Image Deraining
LeetCode 168. Detailed explanation of Excel list name
Small program graduation project based on wechat examination small program graduation project opening report function reference
随机推荐
Pyinstaller packaging py script warning:lib not found and other related issues
JVM performance tuning and practical basic theory - medium
Huawei cloud micro certification Huawei cloud computing service practice has been stable
Human resource management online assignment
Yyds dry goods inventory override and virtual of classes in C
C import Xls data method summary I (upload files and create Workbooks)
2022 new examination questions for safety management personnel of hazardous chemical business units and certificate examination for safety management personnel of hazardous chemical business units
What are the advantages and disadvantages of data center agents?
Why is the operation unsuccessful (unresolved) uncaught syntaxerror: invalid or unexpected token (resolved)
LeetCode226. Flip binary tree
Feign implements dynamic URL
Trading software programming
Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference
[typora installation package] old typera installation package, free version
PMP daily three questions (February 14, 2022)
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
Special copy UML notes
FRP intranet penetration
MySQL utilise la vue pour signaler les erreurs, Explicit / show ne peut pas être publié; Verrouillage des fichiers privés pour la table sous - jacente
Winter vacation daily question -- a single element in an ordered array