Discussions

XML & Web services: XML TO EJB

  1. XML TO EJB (3 messages)

    Is there somebody in the block that have worked in direct translation of high level bean specification using tags (like XML or HTML tags) to Enterprise Java Beans?

    I have worked a little in the codification of EJBs. I found that most of the task is repetitive and boring, so I think that work can be expedited by using programmable tags inside a kind of XML or HTML file, and then that file is submmited to and processed by a server that returns EJB Java code.

    I can imagine the following example:

    <EJB:CONTAINER name="vineta">
     <EJB:SESSION_STATEFULL name="VinetaService" jndiHome="modcat.VinetaService">
       <EJB:INTERFACE>
         <EJB:CREATE>
    <PARAM name="sesion" type="Sesion"/>
         </EJB:CREATE>
         <print>
          <PARAM name="vinetaKey" type="VinetaKey"/>
         </print>
         <print>
          <PARAM name="vinetaKey" type="VinetaKey"/>
          <PARAM name="idRuta" type="String"/>
         </print>
         <printPermission>
          <PARAM name="vinetaKey" type="VinetaKey"/>
         <printPermission>
       </EJB:INTERFACE>
       <EJB:IMPLEMENTATION>
        <ATTRIBUTE name="sesion", type="Sesion"/>
        <EJB:CREATE>
         <EJB:JAVA_CODE>
           this.sesion = sesion;
         </EJB:JAVA_CODE>
         </EJB:CREATE>
       </EJB:IMPLEMENTATION>
      </EJB:SESSION_STATELESS>
    </BEAN_CONTAINER">

    Threaded Messages (3)

  2. XML TO EJB[ Go to top ]

    Have you looked at the DTD for the deployment descriptors? Why not simply use this as a model.

    Also note that the ":" is a reserved character in XML due to XML name spaces.

    Dave Wolf
    Internet Applications Division
    Sybase
  3. XML TO EJB[ Go to top ]

    You may want to take a look at EJBGEN (BEA specific) and EjbDoclet, which goes the opposite way - they generate deployment descriptors, home interfaces and remote interfaces from special JavaDoc tags in the bean implementation.

    You can find a discussion of them by searching here.

    Or see
    http://www.beust.com/cedric/ejbgen/
    and
    http://sourceforge.net/projects/ejbdoclet/

    Granted, you still have to write get- and set-methods, but at least you don't have to write them more than once.
  4. XML TO EJB[ Go to top ]

    Refer http://www.alphaworks.ibm.com/tech/ejbmaker for IBM WebSphere's EJBMaker tool.

    "The EJBMaker is a tool for EJB developers writing applications for the WebSphere application server environment. The tool automatically generates source for CMP entity beans from a bean descriptor file written in XML, plus scripts used to create the required bean persistence tables in DB2.

    Some of the features include the ability to specify relationships between beans, and being able to quickly initialize a bean or extracts data from a bean using XML. Source files are not overwritten unless changed, making the tool ideally suited for execution within a build environment."

    -Srini...