Imagine I am creating an application using JSP and Servlets. For ease of understanding, lets take a Patient Management system. Now there are few things in this kind of system.
- Insert patient's history
- Display patient's history
- Insert drugs for patient
- Display drugs for patient
- etc
Now, all of these are different use cases, but belong to one main thing, the Patient.
My thought is to apply 4 different servlets for above four, so there will be servlets like "InsertHistory.java", "InsertDrugs.java", "DisplayHistory.java", "DisplayDrugs.java" and so on. The reason is they are different use cases.
However there is an argument where some say that since all of these are belong to one "main thing" (i.e Patient), we can create a one servlet called "PatientServlet.java" and add everything related to patient there. Then later when we need to create the doctor's info, create a "DoctorServlet.java" and apply all the doctor related data into there.
What is your opinion there?
Aucun commentaire:
Enregistrer un commentaire