Xcore allows you to define and maintain models in a textual form. To quote the Xcore wiki page: ‘It eliminates the dividing line between modeling and programming, combining the advantages of each.’ Xcore really adds value and makes working with models easier and much more fun. So no wonder that it has been on my todo-list for a while now to see how I could integrate it nicely with Texo.
As often I got the extra needed push from questions on the newsgroup to finally get this done. The past year I have taken a closer look at Xcore and the way it handles models. I was pleasantly surprised to see that you can load Xcore-defined models through an EMF Resource and can easily get to the underlying EMF/ecore model.
This made it quite easy to make all the Texo functionality work for Xcore models:
- generate JPA entities directly from Xcore
- define annotation models to control code generation in detail
- overriding/extending code generation with own custom templates
- auto-generate while changing models
- full automatic-zero-coding CRUD JSON and XML webservice support
Most of the functionality is directly available with a simple right-click on a xcore file:
Note the last menu option: I also added a nice feature that allows you to generate the ecore model from an xcore file (not needed for Texo, but sometime nice to have in any case).
Thanks for reading and I hope this blog post helps to give Texo a try. Visit the Texo wiki for more information. Let me know if you have any questions or remarks on the EMFT newsgroup or forum!
gr. Martin
