jdoe7890 (1) [Avatar] Offline
We use IntelliJ Idea as the editor of chhoice for all our java projects. After reading your excellent book, I embarked on using XDoclet in my J2EE project.

Since the local and remote interfaces are created at build time , how do i refer to the ejb interfaces in my code in the editor. None of my java files get compiled.
habuma (279) [Avatar] Offline
Re: XDoclet and java editors
I can't speak about this using IDEA, as I'm an Eclipse junkie. But here's how I do it:

To start, I have two source directories in my project...one for the source code I write and one for the source code that XDoclet writes. (Then there's a third for my unit-tests, but that isn't relevant to this topic.)

When I write my code, I write it in "faith" that the XDoclet-generated code will be there. Sure, Eclipse gives me a lot of red X's, but I just ignore them for now. Then, as soon as I possibly can, I have XDoclet generate my stuff, I refresh my project, and then all of the X's go away. I don't know about IDEA, but in Eclipse, this is fairly painless.

To make things even less painful, I typically start out by writing as much of my EJB's implementation class as possible as soon as possible and then run XDoclet as soon as possible so that I at least have some baseline code to work with and the red X's go away sooner.

But, this isn't a problem reserved for XDoclet. If you're doing test-driven development, you'll write your test first, referring to classes and methods that don't exist yet. In those cases, your IDE will show errors until the classes and methods do exist. Working with generated code is really no different in this regard.