patterd (2) [Avatar] Offline
#1
I'm a bit curious about your approach to package names. The book has many references to substitution in package names. I understand about the /src/ and /gensrc/ directories and using one for hand-written code and the other for XDoclet-written code.

How do you normally set up your package names?

Patterd
habuma (279) [Avatar] Offline
#2
Re: Package names
I don't know that I have a single approach to package names. Truthfully, it varies from project to project--either because I find a better way or because one fits a certain project better than another.

That said, here's how I'd probably put EJB implementation classes in an "ejb" package, interfaces in an "interface" package, etc, etc. In the book we spread out the generated EJB code across several packages ("dao", "value", etc), but in the real world, I'd probably just dump everything in the "ejb" package.

Then again, that's suitable for a reasonably small-to-medium project. If I had hundreds of EJBs, I'd probably figure out a better way of packaging (I'd also question the choice of EJB in the first place, but that's another story).
patterd (2) [Avatar] Offline
#3
Re: Package names
I started getting more interested in this when I started using Ant. I used to have a pretty simple setup -- all of my source was under java/misc/[packagename] and there was a java/localclasses/com/[myname] directory with one per packagename below that. Everything worked fine for several years until I started using Ant. Then, I decided to go with a
java/src/com/[myname]/[packagename] for my source, and
a
java/build/classes/com/[myname]/[packagename] for my output classes.

When I then started reading EJB books, many of them had simple for book structures with a
chapternn/src/com/whatever/packagename
chapternn/build/classes/com/whatever/packagename

approach.

One obvious problem with this approach is that you cannot easily use classes from another package. (One of my packages is a utility package and those classes are used by many of my other programs.)

Then, when I got into EJB's, the ugliness of the *AR files and the subdirectories for META-INF kinds of things made the whole structure more complex.

I guess that is just part of the learning curve.

Patterd
xananagusmao (3) [Avatar] Offline
#4
Re: Package names
Why is there not tasks or subtasks that will generate the application.xml file for EARs ?