I’m working on something that I’ll call “A Code Generator framework” written in C# (but not only meant for .NET).
As every good code generator it doesn’t try to generate your great implementations. It will try to convert your UML class diagram into skeleton code (which is IMHO a boring and automatable task). A good thing about this UML to skeleton code generator is that it forces the developer to design first, code later (reverse engineering to a UML class diagram is cool for refactoring, but this code generator isn’t meant for refactory tasks).
I’ve added support for Dia as input and C# and VB.NET as output. Continue reading if that triggers your interest. If not, I’m also planning to support Rational Rose (sooner or later) as input and XSLT als output (which would make it even more easy to add other languages).
In fact it’s already somewhat finished (so for me it ain’t vaporware any more). I released this as LGPL. You can find the sources in a Subversion repository here. You can contact me if you’d like to make changes and/or if you’d like commit access.
It heavily uses the Strategy Design Pattern. The framework abstracts the source and target. The Strategy Design Pattern’s delegate is a concrete IGenerator implementation. A concrete ISourceParser implementation is an object that can parse a specific source into a list of interfaces, classes and packages. The interfaces and classes itself have, of course, properties and methods. At this moment I’m not yet supporting aggregation nor composition. This is on my to do list.
You can find a UML class diagram here.
I’ve added support for Dia, C# and VB.NET. Dia input support is implemented in DiaSupport.Parser.CSharpSupport.CSharpCodeGenerator implements support for the C# language and VBNETSupport.VBNETCodeGenerator implements support for the VB.NET language.
I also created implementations for both C# and VB.NET that will write files in directories (one directory per package). It will not yet generate Visual Studio .NET solution and project nor nANT build files. This is on my to do list. I’d first like to create a generator that will transform XSLT files.
I’ve added a sample console tool that demonstrates how to use the framework. You can also use the framework as a library. For example if you’d like to integrate with an Integrated Development Environment.
Quite good idea. And support Rational Rose will make it even better.
You will like this one Claudio:
<a href="svn.cronos.be/svn/codegen…
svn.cronos.be/svn/codegen…
I’m working on it ;-). And what’s worse, it’s almost finished.
You’re (or anybody) is invited to finish it. I will most likely not work on this until tomorrow evening (I’m on GMT). Feel free to be ahead of me ;-)!
XMI (Rational Rose) support is added.
I’ve made some significant changes to the generator, specifically the combination of Dia and C#, my work extended into Dia itself if you’re interested let me know…
Hello,
i interested in CodeGen Open Source but i don’t know username and pass for url SubVersion. Can i give me it?
thanks.