Monday, January 28, 2008

Xtext first steps

Yep, this weekend I started out a prototype for my domain model generation with XText (part of openArchitectureWare). Up to now I have the JPA Entities/ JavaBeans (Databinding) generated with HiberObjects but as my model grew bigger it came to some limitations in performance and usability. So I had some experiments with UML model, but I was not satisfied as its very annoying to attach all those stereotypes and tagged values needed for JPA generation. So I came across XText and started to build my own DSL for this matter. I had some trouble getting started, as the generator doesn't alwas work nice,had to delete everything and start from scratch many times. Once I had some understanding of the BNF notation Xtext uses I quickly had a simple prototype for declaring JPA entities. As Xtext generates an EMF model from the model script, it easy to build a code generator on that, at least if you have an idea of the Xpand language. So I will put some more work in the language and if everything works as nicely as up to now I will model my domain with the new language and drop Hiberobjects.

No comments:

Using Mapstruct with Protobuf3