Discussions

EJB design: Business Delegate Generator

  1. Business Delegate Generator (1 messages)

    Hello,

    I am using a Business Delegate pattern to connect to the EJBs that are deployed in an Orion 1.5.2 application server. I have made the delegate but while coding the delegate, I realised that a large portion of the delegate could be generated programmatically with the help of some configuration parameters.

    For instance if we have a method

    public String sayHello(String strName);

    as a remote method,

    I end up having the a method in my delegate which would call this method. As for the portions to lookup for home and create remote objects, they also appear to be standard code.

    The question - has anyone written a tool to generate BusinessDelegate (for EJB/RMI) or has any idea where we could get that from.

    Thanx a lot in anticipation
    Jeetendra
  2. Business Delegate Generator[ Go to top ]


    Early on in the Open For Business project we used a code generator to create CMP entity beans, deployment descriptors, delegates and so forth, even JSPs and events or actions to update the data.

    The tool was knows as EntityGen because it generated the code based on definitions of entities which corresponded to relational tables.

    That is still available if you want to use it (get the 2001.07.20 release), but it has been deprecated. In the most recent release of OFBiz we have evolved the entity code generator into a dynamic entity engine. This uses the data transfer hashmap pattern and enforces rules about the data from entity definitions in an XML file. In addition these entity definitions are sufficient to do things like automatically creating tables or columns in the database and handling all of the persistence of these generic, dynamic entities.

    If you are doing a lot of persistence work one of these might be useful. If the work is very procedural, entity definitions probably won't help you. Just use your favorite J2EE IDE (Forte from Sun, for instance) to automatically create stubs from interface definitions.

    Best of luck,

    David E. Jones
    The Open For Business Project
    http://www.ofbiz.org
    jonesde at ofbiz dot org