question

11 views
Skip to first unread message

Felix

unread,
Mar 1, 2010, 1:10:30 PM3/1/10
to javapractices-dot-com-discuss
Hi,
I have a question regarding to building jar/war files.
If there is package-by-feature used, how do you put classes to the
appropriate jar/war file?

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?

John O'Hanley

unread,
Mar 2, 2010, 4:28:21 PM3/2/10
to javapractices-dot-com-discuss
Hi Felix,

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

Reply all
Reply to author
Forward
0 new messages