Export JavaScript from UML (StarUML)
StarUML is a great and free, Windows-based UML tool used for creating UML diagrams. It is possible to export Javascript / .js files from the UML model you have created in StarUML. To do so you need to have an UML to JavaScript template added to your StarUML. These UML to JavaScript template is not in the default installation, but have to be added.
These UML to JavaScript is based on the Actionscript 3 template, which is again based on the work of other good people.
If you are using javadoc for documetation of your JavaScript , you might also be interested in Ortelius, which is a tool to create html documentation of your JavaScript files.
>> Read more about Ortelius - javascript documentation tool
How to use the uml to JavaScript template
The download for these uml to JavaScript templates, is two files. A template file written in javascript/jscript syntax and a settings file. If you don't want my name to appear as the default author, you can change this by open the settings file in notepad.
To install the UML to JavaScript template drag the contents of the downloaded zip file to the StarUML directory, which i my case have the location C:\Program Files\StarUML\modules\staruml-generator\templates\.
Restart StarUML, do your uml work and go to the Tools menu and select “StarUML Generator …”. Select JavaScript - static and click next, choose a destination for your automaticly created JavaScript files and click generate.
The JavaScript that is created is an encapsulated object, with properties an method that can be accesed like at static method or property.
Uml & StarUML downloads
Download the JS Static template
Use it for 'classes' that are object and dont have to be instantiated.
Unzip the file and add it to the '......\StarUML\modules\staruml-generator\templates' folder.
Download the JS Non Static template
Use it for 'classes' that have to be instantiated.
Unzip the file and add it to the '......\StarUML\modules\staruml-generator\templates' folder.
Download StarUML
The application where you create the uml model, and export your JavaScript code.