UML may be overkill
Time ago I used UML in this way:
- Create my model using a UML tool.
- Export to XMI.
- Import from VisualAge using a XMI to EJB converter.
Yes, this was impresive at first glance. But this approach did not convince to me.
In the other hand, TogetherJ approach liked me a lot. You can use Java or UML, it the same, UML only is a viewpoint of your code. Not code generation and UML is always in sync.
About development cycle, yours is like OpenXava:
1. Define businees component, using XML
2. Insert domain logic, customizing predefined calculators or creating new ones.
4. Choose your controllers, customizing predefined actions, or creating new ones.
5. Build & run
I looking for a way for removing (or reducing) the generate step. I like touch and see, touch and see, touch and see.
the most useful tactic IMO for generation is to generate a base implementation, and an empty subclass which is the one actually instantiated and used. The base classes can be put into their own package. Modifications by hand can be made to the subclass, and the generator never overwrites any existing subclass.
Seems a good technique. The important thing in an active code generator is that user never touch the generated code.
But, OpenXava uses other (maybe not better, simply different) approach. OpenXava uses strategy pattern to insert custom functionality using code generation.
For example, if you need a custom method in you generated class you can write something as this:
In this case the code for Carrier class will have a method translate which implementation is the TranslateCarrierNameCalculator.
We use this technique with success for years, and we have noted that is possible to create calculators that can be reused several times.
Kit, thanks for your comments