当前位置:网站首页>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-15 aggregate function
- The difference between lambda expressions and anonymous inner classes
- The contact data on Jerry's management device supports reading and updating operations [articles]
- Learn these super practical Google browser skills, girls casually flirt
- All metal crowns - current market situation and future development trend
- Portable two-way radio equipment - current market situation and future development trend
- 14. Process time
- 12. Gettimeofday() and time()
- 13. Time conversion function
- Pesticide synergist - current market situation and future development trend
猜你喜欢

Feign implements dynamic URL

MySQL advanced (Advanced) SQL statement (I)

Learn these super practical Google browser skills, girls casually flirt

Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization

On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)

Use classname to modify style properties

MySQL advanced SQL statement (1)

Final consistency of MESI cache in CPU -- why does CPU need cache

Save Private Ryan - map building + voltage dp+deque+ shortest circuit

LeetCode226. Flip binary tree
随机推荐
Hbuilder link Xiaoyao simulator
G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
Make drop-down menu
Chain ide -- the infrastructure of the metauniverse
Development of user-defined navigation bar in uniapp
The difference between int (1) and int (10)
Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization
51 MCU external interrupt
Idea if a class cannot be found, it will be red
What are the main investment products of bond funds and what are they
Conditional statements of shell programming
Introduction to graphics: graphic painting (I)
13. Time conversion function
Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge
JVM performance tuning and practical basic theory - medium
High level application of SQL statements in MySQL database (I)
Use classname to modify style properties
Notice on Soliciting Opinions on the draft of information security technology mobile Internet application (APP) life cycle security management guide
Should enterprises start building progressive web applications?
LV1 Roche limit