Feb 22 2009
Posted by coen under C-Sharp,Java,Programming,School
Modeling and code generation
At my graduation internship at Sogyo I am currently working on an interesting item: researching the currently available modeling and code generation tools, and see if there’s a way to provide integration between those. There probably are a lot of tools that can generate code, but I’m focusing on the Eclipse Modeling Framework, Visual Studio 2008 and Enterprise Architect. The reason I am doing this ‘research’ is because I believe that modeling should have nothing to do with the programming language the software will be written in.
As it turns out so far, Visual Studio provides a Class Designer tool, but that’s not as extensive as I’d hoped. On the other hand there are the DSL Tools which enables me to create a Domain Specific Language that provides the necessary functionality. In fact, one could create a DSL that generates Java code – or whatever language, but that’s an obvious property of any DSL.
The Eclipse Modeling Framework has way more functionality, but can – as far as I know right now – only generate Java code.
The third tool, the Enterprise Architect, is an UML modeling tool that also provides very basic code generation. Unfortunately I must say that I’m not satisfied at all with the generated code by the Enterprise Architect, and even less satisfied with the plug-ins they provide for Eclipse and Visual Studio. In the generated Java code, enums and interfaces are apparently ignored; in C# code, the namespaces are not created and class methods are generated but getters and setters are neither recognized nor generated (this also goes for Java).
So I have decided that I’m going to write at least an Eclipse plug-in that reads the model from Enterprise Architect and creates decent hand-written-quality code for the domain classes. And given time, I’ll also create a Visual Studio plug-in that does the same. After that, the next step would be to extend these plug-ins with functionality to generate persistence and GUI code. Another thing is that it should be possible to alter the code after it’s been generated and send the changes back to the model. I’ll incorporate that as well in the first version of the plug-ins.
That leaves me with a lot of work todo, so I won’t get bored the next couple of months