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
Support
No technical support is provided.

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.
    UML2c directory

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

opening UML2c Plugin menu

 

Template Files

    • 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

 

    • 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.)
    2. Go to [Tools] – [UML2C plugin] – [Generate C skeleton code] or [Generate GoogleMock code].
      opening UML2c Plugin menu
    3. Specify the output directory.
      Specifying the directory to export
    4. If you get this dialog, the source code is generated successfully!
      Complete generation

Sample Code

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

Single Instance Module

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

Foo.c
Foo.C Code

Foo.h
Foo.C Code

Multi Instance Modules

Multi Instance Modules Standard classes will be exported as multi instance modules.
Sample UML Class Diagram

Bar.c

Exported Foo.h source code

Bar.h

Exported Bar.h source code

BarPrivate.h

Exported BarPrivate.h Source code

Per-type dynamic interface (Super Class)

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

Sample UML Class Diagram

Abstract.c

Exported Bar.C Source code

Abstract.h

Exported Abstract H Source Code

AbstractPrivate.h

Exported AbstractPrivate.h source code

Back to Plugin List

 

What are you looking for?