当前位置:网站首页>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 ~
边栏推荐
- High level application of SQL statements in MySQL database (I)
- A. ABC
- Install the pit that the electron has stepped on
- C import Xls data method summary III (processing data in datatable)
- 12. Gettimeofday() and time()
- Will the memory of ParticleSystem be affected by maxparticles
- Write the first CUDA program
- Notice on Soliciting Opinions on the draft of information security technology mobile Internet application (APP) life cycle security management guide
- Winter vacation daily question -- a single element in an ordered array
- The difference between int (1) and int (10)
猜你喜欢

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

Override and virtual of classes in C #

Use classname to modify style properties

Three layer switching ①

Solution of cursor thickening

Openbionics exoskeleton project introduction | bciduino community finishing

Huawei cloud micro certification Huawei cloud computing service practice has been stable

Maximum entropy model

Life cycle of instance variables, static variables and local variables

Huawei cloud micro certification Huawei cloud computing service practice has been stable
随机推荐
Pyrethroid pesticide intermediates - market status and future development trend
Hunan University | robust Multi-Agent Reinforcement Learning in noisy environment
Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference
Will the memory of ParticleSystem be affected by maxparticles
After listening to the system clear message notification, Jerry informed the device side to delete the message [article]
MPLS③
Cancer biopsy instruments and kits - market status and future development trends
Setting function of Jerry's watch management device [chapter]
Neo4j learning notes
The boss said: whoever wants to use double to define the amount of goods, just pack up and go
Portapack application development tutorial (XVII) nRF24L01 launch C
Bacteriostatic circle scanning correction template
MySQL introduction - functions (various function statistics, exercises, details, tables)
Douban scoring applet Part-3
Why can't it run (unresolved)
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
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
16. System and process information
When the watch system of Jerry's is abnormal, it is used to restore the system [chapter]
Openbionics exoskeleton project introduction | bciduino community finishing