Code generation based on UML class diagrams

I would like to share my experience in using a tool to generate java source code from my UML diagram.

I am using a tool call AndroMDA which is a free opensource tool to assist me in generating different source files including java source code, struts configuration file, ejb deployment descriptors and etc.

I am using the Poseidon UML as my case tool to design the class diagrams for different layers of my portal. I am designing the business application layer using EJB (CMP for entity bean), the user services layer using J2EE patterns and the web application layer using struts.

Based on all my class diagrams, the AndroMDA will generate:
- bean class, interface classes and the deployment descriptor for all my EJB. For CMP entitybean, I don't need to do any coding in the java files, just need to add the EBQL to the descriptor for some of my entitybean. For the session bean, I will only need to code the bean class.

- J2EE pattern classes such as Business Delegate, Session Facade from my user services layer class diagrams.

- struts action classes, struts forms, value object, struts configuration for my web application layer.

Besides providing default code generation templates, the AndroMDA also allowed creation of new code generation template to suit to the user's need, where the template will organize as cartridge and add to the AndroMDA template directory. I actually designed the template that the AndroMDA used to generate the J2EE patterns for the Business Delegate and Session Facade.

I am now in the progress of developing my portal, based on the codes framework and skeleton generate from AndroMDA.

For more details, please visit the AndroMDA site, http://www.andromda.org/
I am using the Poseidon UML Community Edition which is free, download from http://www.gentleware.com/

 

转自:http://www.cjsdn.net/post/view?age=0&bid=16&ppg=1&sty=3&id=47479&tpg=1

你可能感兴趣的:(bean,struts,ejb,UML,OpenSource)