0

I'm new to UML and I have written a Sequence diagram for a Voucher User Interface, it is a small pet project I'm doing to learn UML. I have written a decent Sequence Diagram in StarUML and now I would like to generate the C++ code, the step is very simple I just go to Tools/C++/Generate Code... But there I face a problem, which you can understand from the screen captures below. I tried various places but I could not find any help, anyone experienced in StarUML who could help me go further?

Step 1 Why is it Empty?

HaggarTheHorrible
  • 7,083
  • 20
  • 70
  • 81
  • With most UML tools, "code generation" means class and method stubs, and the process takes no account of any behavioral models such as sequence diagrams. Some tools do include some behaviour generation, but none of them will write good code. And not to discourage you from learning UML, but IMO code generation from UML is a fool's errand in any case. UML is great for documenting design, but it isn't a programming language. – Uffe Oct 12 '11 at 12:57

2 Answers2

0

I just tried to generate the code from start uml. With Version 5.0.3.1570. It works well. I got the diagram instantly.

One issue, it actually did not generate the composition / aggregation stuff but, then, I did that manually.

Since its propitiatory for my organization, I cannot revel but, sequence is exactly the same as of yours.

I choose Design model & then gave file path in dialog box.

AnotherDeveloper
  • 2,161
  • 2
  • 23
  • 27
0

Haven't used starUML for a while so things may have changed. But:

Last time I looked, it didn't provide templates for behavioural code generation. The only codegen templates were for static structure (classes, attributes, packages). If that's still the case then I suspect the empty panel arises from it not finding any suitable model elements to generate code for. i.e. your Sequence Diagram package doesn't have any classes in it.

You might be able to work it out by looking at the codegen templates; they should be in

<STARUML_INSTALL_PATH>\modules\staruml-generator\templates

hth.

sfinnie
  • 9,854
  • 1
  • 38
  • 44