UML wouldn't be worth all the sophisticated work if all it came down to was pretty vector graphics. When analyzing and designing a software system, your final goal will be to generate well-implemented code.
Poseidon for UML provides a very powerful and flexible code generation framework, based on a template mechanism. It is currently used to generate a variety of code including Java and HTML, but it is flexible enough to generate any kind of programming language, or other output, such as C++ or XML.
Java code generation is usually based on the classes of a model and other information displayed in the respective Class Diagrams. Additionally, Poseidon can generate setter and getter methods for the fields of each class.
By default, associations between classes in UML are bi-directional; that is, associations allow navigation between classes in both directions. For the common object-oriented programming languages, these need to be transformed into separate uni-directional associations. If one of these is set, the other should be set accordingly. The code for managing bidirectional as well as unidirectional associations is also generated automatically.
Code and documentation generation are both invoked from the Generation menu.
Select the type of generation you would like from the Generation menu and a dialog will appear. Here you can select or deselect model elements from the tree, specify an output and a template folder, and indicate if the destination folder should be cleared. Poseidon can remember your selection of model elements if you enable the checkbox titled, 'Remember current node selection'.
Note that the output and template folders are saved by project and language. This means that output of Java generation can be placed in one folder, and Perl generation from the same project can be placed in another folder. These folder preferences will be saved to the current project, but another project will not recognize these preferences and must have its own preferences set. This is to avoid accidentally overwriting the output from a previous project.
For generating the corresponding HTML documentation for your model you need the UMLdoc feature, which is available in every edition except the Community Edition. Users of any edition, including the Community Edition, can utilitze the UMLdoc Online Service. The look and feel of the generated documentation is very similar to Javadoc. Poseidon for UML allows you to specify Javadoc information directly in your model (in the Documentation tab). This information, such as comments to your classes or methods, is included in the code. But unlike UMLdoc, Javadoc provides a view of the code only, not of the model. For example, you do not see your diagrams. With the UMLdoc feature you get the same information as with Javadoc, in addition to all diagrams from your model. This includes Class diagrams, Use Case diagrams, sequence diagrams etc. This is valuable information that you would want in your documentation.
After the generation is finished, you will get a corresponding message in the Generator/Compiler output. Now you can open the HTML documentation in your favorite browser. UMLdoc generates an HTML page for the model overview, each package and each classifier (actors, use cases, classes, interfaces). They are connected by hyperlinks, so that you can easily navigate through the whole document.
You'll find the generated java files in the specified output folder, sorted by packages.