Example:
com.test.doctor.CreateDoctorAction.java
com.test.doctor.DeleteDoctorAction.java
com.test.doctor.CreateDoctorForm.java
com.test.doctor.DeleteDoctorForm.java
com.test.doctor.BlahDoctorException.java
com.test.doctor.DoctorEJB.java
com.test.doctor.DoctorDAO.java
com.test.doctor.DoctorDAOImpl.java
com.test.doctor.DoctorTO.java
com.test.doctor.CreateDoctorTest.java
com.test.doctor.DeleteDoctorTest.java
createDoctor.jsp
deleteDoctor.jsp
...
And what about if you want to change DAO layer completely? Or web
framework?
If there is package-by-layer, you need to go thorough all directories
and remove concerned files?
Responses below :
> If there is package-by-feature used, how do you put classes to the
> appropriate jar/war file?
It's a little odd to put a single app into multiple jars. Why do you
want to do that, exactly? What problem does it address?
> And what about if you want to change DAO layer completely?
If you change the persistence implementation, then
- package-by-feature : change N DAOs (or whatever) in N directories,
- package-by-layer : change N DAOs (or whatever) in a single directory
You have to make a judgement call, I guess : what's more likely for
your app, changes at the feature level, or wide-ranging changes at the
architecture level. In my experience, there's more likelihood of
changes at the feature level.
> Or web framework?
This issue is more ambiguous. Different frameworks make different
demands on implementation classes. Typically, the answer to this
question, I would say, is likely similar to the above.
- John O'Hanley