A talk I gave at the Columbia MD Java Users Group on 7/30/2013.
Source code: javadude.com/articles/xtext
Tired of writing that same boilerplate code again and again? Having to modify multiple classes whenever your model changes? Scared stiff about all the classes you need to change if you decide to change the way you persist lists?
Ever thought about code generation?
In this session, we'll talk about using code generation to reduce what you have to write and easily keep your code consistent. We'll focus on generating code from an instance of a Domain-Specific Language (DSL), though you can do similar things by annotating Java code.
We'll use xText to generate a DSL parser, a model that holds a DSL instance and a syntax-highlighting editor in Eclipse. Then we'll use xTend to generate code from that model.