Hi Kevin, On 14 Jul 2011, at 11:23, Kevin Meyer - KMZ wrote: > > Look at dishevelled: > http://www.dishevelled.org/codegen/ > > Looks closest to Emfatic, with generated code having no dependency > on any other classes. Might need some tweaking, though, to prevent > generation of unwanted methods, like "addAll". > > This *does* raise an interesting question, though: Does anyone see > any advantage to writing 100% compatible Velocity templates for use > with codegen, to generate Isis apps? Iain, maybe you could add this to > your thesis? ;) > > I'm seeing the a merge of the Velocity templates with the Isis Eclipse > templates... > > Is there any advantage to this?
Done some experimenting and I'm quite impressed! I've done some tinkering with one of the Mutable templates and I've managed to remove constructors from generated classes (I prefer using repositories, and it likes to throw Collections in as parameters) and have Collections be eagerly initialised, preventing the possibility of null pointers. I do have a couple of concerns (can't see a way to declare a class as abstract, no support for adding your own methods without them getting overwritten upon re-generation) but I'm liking this so far and will definitely bring it up with my supervisor when we meet early next week. As for advantages, I think adding in referential integrity to associates (using the mutual registration pattern) and implementing a way to add validate methods to operations could be useful for generating classes for Isis, and I believe both should be doable. Thank you so much for introducing me to this! - Iain
