当前位置:网站首页>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 ~
边栏推荐
- Portapack application development tutorial (XVII) nRF24L01 launch C
- Containerization technology stack
- Override and virtual of classes in C #
- Small program graduation project based on wechat video broadcast small program graduation project opening report function reference
- It's corrected. There's one missing < /script >, why doesn't the following template come out?
- LeetCode 168. Detailed explanation of Excel list name
- Force buckle day32
- On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)
- IPv6 experiment
- PMP daily three questions (February 14, 2022)
猜你喜欢
Yyds dry goods inventory override and virtual of classes in C
2020-12-02 SSM advanced integration Shang Silicon Valley
Bacteriostatic circle scanning correction template
[turn] solve the problem of "RSA public key not find" appearing in Navicat premium 15 registration
The reasons why QT fails to connect to the database and common solutions
Feign implements dynamic URL
Huawei cloud micro certification Huawei cloud computing service practice has been stable
MySQL advanced SQL statement (1)
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
ES6 deletes an attribute in all array objects through map, deconstruction and extension operators
随机推荐
Rearrangement of tag number of cadence OrCAD components and sequence number of schematic page
15. System limitations and options
Openbionics robot project introduction | bciduino community finishing
Jerry's modification setting status [chapter]
Chain ide -- the infrastructure of the metauniverse
Yyds dry goods inventory hand-in-hand teach you the development of Tiktok series video batch Downloader
I don't know why it can't run in the project and how to change it
C import Xls data method summary IV (upload file de duplication and database data De duplication)
Logical operator, displacement operator
How to view the computing power of GPU?
Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference
What is the student party's Bluetooth headset recommendation? Student party easy to use Bluetooth headset recommended
Hamburg University of Technology (tuhh) | intelligent problem solving as integrated hierarchical reinforcement learning
13. Time conversion function
In yolov5, denselayer is used to replace focus, and the FPN structure is changed to bi FPN
Pesticide synergist - current market situation and future development trend
[turn] solve the problem of "RSA public key not find" appearing in Navicat premium 15 registration
IPv6 experiment
Applet graduation project based on wechat selection voting applet graduation project opening report function reference
All ceramic crowns - current market situation and future development trend