I recently noticed that using UML-diagrams is a great way to structure as3-code before writing the actual code. Being no expert in planing, structuring and modeling code in this way I decided to give it a try, searching the web for various UML-tools.

First of all I found the open source project StarUML with a lot of features and (with a little bit of tweaking) even code export to AS3. How? Well, StarUML supports code export and even reverse engineering for C++, C# and Java by default. To get AS3-support a special export-template is required as accurately described in this great tutorial at senocular.com. I like this feature very much because the code export is working really well and saves (together with a little bit of conceptual work)  a lot of time.

AS3 code generation with StarUML

After beeing impressed by these unknown possibilities (no, I never worked this structured before and still don’t know much about technical concepts and this kind of stuff…) I thought about the problems of this approach. The first problem I saw is that there is no way back, once the code is generated. This makes it difficult to document changes inside the code and keep the diagrams up-to-date. Secondly the last avaiable version of StartUML has been released in 2005 – this is quite old for such a software project.

After asking google again I learned that a thing called “reverse engineering” between code and UML is what I needed – a feature no affordable tool seems to support. As far as I know only Enterprise Architect from Sparx Systems is capable of AS3 reverse engineering. But it is a expert software much too powerful and too expensive for personal or non-commercial use.

Then I discovered UML4AS, a very young project which provides “developer friendly” UML support as Eclipse IDE plugin. A main feature is the so called CodeSync technology that allows you to make changes in your code and the UML diagram and to sychronize these changes automatically. So you don’t have to worry about keeping either your code or your diagram sychronized and up-to-date.

UML4AS diagram

Currently UML4AS is avaiable as an early alpha release (as far as I know the first public version ever) and you have to register to download and test it. I tried this version and found it (of course) not bug-free but with a bunch of really promising features and approaches and really fast responses to bugreports in the forum. So it seems to be clever to keep an eye on this project.