UML2C Export

The UML2c Plug-in generates C source code and Google C++ Mocking Framework (Google Mock) from Astah’s UML Class models.

Details

Compatible with
Astah Professional and UML, Community 7.0 or later
Latest Version
0.9.0 (Updated: Mar 31, 2016)
Developer
Astah

divider

How to Install

  1. Download the UML2C Plug-in file and unzip it.
  2. Copy “uml2c-x.x.x.jar” and the “uml2c” folder to userhome/.astah/professional(community)/plugins.

Launch Astah. If you find [UML2C plugin] menu under the [Tools], that means the installation has completed successfully!

 

Template Files

    1. All the .vm-extension files are the template files that are necessary to generate code and need to be placed as below.

 

Windows %USERPROFILE%\.astah\professional(community)\plugins\uml2c\header.vm
Mac and Linux $HOME/.astah/professional(community)/plugins/uml2c/header.vm

 

    1. Encoding of template files needs to be in UTF-8.

 

How to Use

    1. Open a class diagram and select a class you want to generate code for. (Click here for sample output.)

 

    1. Go to [Tools] – [UML2C plugin] – [Generate C skeleton code] or [Generate GoogleMock code].

    1. Specify the output directory.

    1. If you get this dialog, the source code is generated successfully!

divider

Sample Code

This is a sample diagram in “uml2c-plugin-sample.asta” included in the .zip file.

Single Instance Module

Classes with <> stereotype will be exported as single instance module.

Foo.c

Foo.h

Multi Instance Modules

Multi Instance Modules Standard classes will be exported as multi instance modules.

Bar.c

Bar.h

BarPrivate.h

Per-type dynamic interface (Super Class)

Abstract Classes will be exported as per-type dynamic interface.

Abstract.c

Abstract.h

AbstractPrivate.h

divider

Back to Plugin List

 

What are you looking for?