Attribute oriented programming using XDoclet
XDoclet is a open source code generation engine for java/j2ee. Why do you need a source code engine? Think about this, in the project that you are working, how much percentage of code that you have written is not related to the problem domain but related to the technology that you have selected? Take EJB as an example. If you want to write an EJB you need to have a remote interface and a home interface and you need to have the ejb.xml and the JNDI properly configured. What if I had a way to generate the necessary XML artifacts before I compile and package the application?
Welcome XDoclet. XDoclet adds on top of your javadoc, certain meta data (attributes) which is processed by XDoclet engine and replaced/added and/or modified with whatever is needed. So if you put in the include the XDoclet tag in your javadoc comment, you just need to focus on coding the domain objects or code that is required to meet a requirement and leave the rest to XDoclet to generate technology specific code/XML artifiacts before compilation/packaging. Ant plays an excellent catalyst here to enable this process smooth. But XDoclet does not support all the technologies and all feature/function set in a technology. You can find list of technologies that is supported in the XDoclet site. Ant is an open source tool to automate the build and deployment process for java/j2ee applications. We will look at more of build and deployment automation in the coming days. Also look at XDoclet2 from CodeHaus for additional plugins and extensions.









