I know that this has some related posts, but I have some specific questions that I hope I can get help with. Sorry if they are very simple.
Here is an example problem - very simplified, but you get an image - I have several objects that have some common function, for example. departments of the pharmaceutical company - neurology, oncology, infection, etc. All of them must analyze patient document files and upload data to the database. Of course, the nature of the data is slightly different for each department. If I used the feature package, I would have
com.company.neurology Neurology.java NeurologyDocument.java NeurologyDAO.java com.company.infection Infection.java InfectionDocument.java InfectionDAO.java
etc .. The problem is that I need an abstract class that Document classes should extend, for example.
AbstractDocument.java public class AbstractDocument { public void validateDocument(){...} public void readDocumentHeader(){...} public void readDocumentFooter(){...} ... }
Some data access files, for example
DBConnection.java public class DBConnection { public void makeConnectionToDB() {... } public void createCache() {... } public void closeConnectionToDB() {... } }
some error classes
ParseError.java, PatientNotFoundException etc.
If packages are by function, where do these common classes / interfaces go?
source share