Discussions

News: Code Generation Using XML Based Document Transformation

  1. With recent interest in XML standards and availability of tools supporting these standards, it has become possible to generate multiple types of documents by applying XML document transformation technology. A new whitepaper on the subject has been posted on TheServerSide.com.

    The excellent whitepaper is presented in PDF format due to it's length:

    http://www.theserverside.com/resources/article.jsp?l=XMLCodeGen.
  2. Hi

    Does anyone know if the EJB generator they developed is available anywhere?

    Cheers

    Thomas
  3. Check out the EJBX Code Generator.

    EJBX is a Java based EJB 2.0 CMP Entity Bean Code Generator. The EJBX can provide a fast development toolkit for developer to generate Enterprise JavaBean 2.0 object based on the existing database, just by a couple simple commands. This is to reduce unnecessary typo error and human mistake to generate EJB code to run on any EJB 2.0 CMP compliant servers. Following is what EJBX generates:

    1. EJB 2.0 CMP entity beans (Remote and Local interface, Remote and Local home interface, and the Entity Bean)

    2. ejb-jar.xml Deployment Descriptor for any J2EE application servers that support EJB 2.0 CMP Entity Bean

    3. Deployment Descriptors for WebLogic 6.1 (weblogic-cmp-rdbms-jar.xml and weblogic-ejb-jar.xml)

    4. Primary key classes for entity bean with multiple primary key fields

    5. Value objects, Session facades, and Business delegates classes for all entity beans

    8. Struts Action, Form, jsp classes for all entity beans

    9. In addtion, ejbx also generates ApplicationResource.properties and struts-config.xml files and much more

    To see an example of the code generated by EJBX please go to http://www.myhtg.com/examples.zip.



  4. XDoclet is another option for you - generates remote/local/home/local-home interfaces and deployment descriptors based on @comments in your code.

    http://sourceforge.net/projects/xdoclet

    hth
    dim
  5. I find some of the ideas presented quite interesting -- I'll have to look into this.

    You can try our tool EJBCreator -- it is also based on a XML format (http://opensource.itplus.dk/EJBCreator/).

    EJBCreator is licensed under GPL.
  6. Thomas,

    We have an evolving generator technology built around a J2EE framework. Other frameworks will evolve too. Our technology generates server-side and client-side documents (ie end-to-end). You describe the data, business rules, and presentation in XML and it generates EJB Entity/Session and client-side XML/XSLT or JSP solutions. Security, session mgmt, menu processing, and content processing ... all automated. JSP Model 2 style presentation design.

    The generation is template-based and change/test cycles are quick due to XML/template dependency maps and the build process (Ant with custom tasks). Change any source XML, template, or manually authored Java results in automatic re-compile and deployment to your test BEA environment (ie NO manual shuffling of files, not even EJB deployment stuff).

    Our technology supports pure XSLT generation, but since that's limiting our product also offers and promotes a Java template technology.

    Any further inquiries welcome.

    jameshr@forelogic.com
  7. Can somebody explain to me why all this xml + xsl-code with their hairy syntax should be more comfortable and more productive than doing this strait in java?
    Ok, i see, if you have a lot of simular things like these enum examples, you'd better do with a code generator instead of copy-pasting from one source to another. But for the more interesting stuff, i doubt that you are faster with this xsl hacking.
  8. Well my two cents....
    We're using the struts Framework for our webapp. The central apsect of using this framework, are the so called FormBeans. Each HTML-form is mapped to a JavaBean which has to have a getXXX-setXXX Method for every HTML-Field. Currently we have multi page forms consisting of up to 50 fields!
    Developing a bean with 100 Methods is quite cumbersome....
    So we wrote a little app, which creates a Java Class for the Bean otu of a XML-Document.
    All we have to describe in XML Document is some base stuff for the class (Classname, SuperClass, etc), and all the reuired properties and their type (String, Integer, etc.). The programm creates a get and set Method for each property, and creates "real" toString, equals, and hashcode Methods.
    It took us about two hours wo write the app, and now it takes us five minutes flat, to create a bean with 50 properties!
    One more thing, before I quit. We wanted to use an existing Bean Generator. But none of them met our needs. They all either created EJB Code, or GUI Beans, with way to much overhead (passivate Methods, changeEventProperties, etc).
    Is there any other solution out there, that makes "simple beans?"

    with best regards

    Stefan
  9. Check EJBGen as well:
    (Main target Weblogic Server)

    http://beust.com/ejbgen/

    I wrote an article that introduces EJBGen:

    http://www.jyperion.org/j2ee/ejbgen/article.htm

    Thierry Janaudy
  10. Stefan,

    What you just describled is what EJBX does and more. Not only EJBX can generates the Form with validation for you, it also generates action classes, struts-config.xml, applicationResources.properties, jsp pages, and whole EJB related back-end stuff (see comment above).

    Unlike other code generators, which based on reflection, EJBX uses jdbc API to read the database information to create the EJBX input template for you so you don't have to type as much.

  11. Invalid article PDF link[ Go to top ]

    Hi!

    Looks like TSS itself could use code generation techniques to avoid publishing invalid links.

    The correct link to the PDF is
    http://www.theserverside.com/resources/articles/XMLCodeGen/xmltransform.pdf

    Best Regards,
    Dag Blakstad