[Bouml] generate code

Source: Internet
Author: User

Here is a brief introduction to using the free UML tool bouml to generate C ++ code.

Each view and component in bouml has the following structure:

Project

-> View

-> Diagrams

-> Components

 
Each component, such as a class, has a language attribute in its Setting dialog box. The Code Generation Tool generates code according to the settings.

Generating code in bouml mainly requires the definition of Class and artifact. One artifact represents a set of header files and source code files, which can contain one or more class definitions. Therefore, pay attention to the following points when using bouml to generate code:

1. Language declaration in class. -> Related to class definition

2. Artifact language declaration. -> Related to header files and source code files

3. Various default declarations and output directory settings in project generation settings.

Before starting, you should first confirm:

1. Have you selected the correct language?

Check the ages menu. We recommend that you select "verbose code generation" to obtain more information during the code generation process.

2. Is the output directory set?

Check the project-> edit generation settings.

Generally, you need to select a language when creating a project. If you only select a language at this time, you just need to check whether there is a declaration definition for the relevant language in the definition of each class, if not, click "Default Declaration.

In the designed UML project, add the deployment view and a deployment
Digoal, and then add an artifact (small object) under the deployment view, similar to the following structure:

* Name artifact animals and select stereotype as source. After all, we need to generate the source code.

Edit animals artifact and add the two defined classes to "associated classes". The two classes will be generated into a group of source code files. As follows:

If there are standard encoding specifications, such as adding some declarations to the file header, you can use project-> edit generation settings to modify the missing settings:

Because the previous settings have been saved in artfiact, such changes will not be automatically applied to the existing artifact. Therefore, you need to manually edit the dialog box in artifact and click "default" again.
Definition "to load new default settings.

In the C ++ source statement, $ {name} does not work. This is a bug in bouml.

 

* Bouml is a rare tool that supports UML.
2. x is a free tool with excellent functions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.