astah* C# Reverse Program User Guide

19 October, 2009
Change Vision, Inc.


[Overview]

This C# Reverse Program is created as one of sample programs by using astah* API. With this program, you can generate astah* models from C# Source Code. This guide briefly describes how to use this program. To use this program, you need to have free software called Doxygen. Because this program requires XML file that is generated by Doxygen.

[astah* API Sample Program License Agreement]

[Steps for importing C# Source Code]

[Before you start, set up the environment]

To run this program, you need to have the environment to be able to run both J2SE and the Digester.
Also as it is mentioned above, you need to have the Doxygen installed on your PC. Because you need to have XML file that is generated from C# Source code (.cs) by using Doxygen before you create astah* models with this program. Please refer to Doxygen's license and documents they provide for how to use Doxygen.

[Step1. Download Doxygen]

[Step2. Install Doxygen]

[Step3. Launch Doxygen]

[Step4. Set up Doxygen]

[Step5. Importing Source code by Doxygen]

[Step6. Generate astah* models from the XML]

[Configure the astah* C# Reverse program - Config.properties]

You are able to customize C# reverse program by modifying following file.
astah* Install folder\api\sample\sample_doxygen_c_sharp\doxygen_csharp\Config.properties
jude_csharp_types_for_attribute
You can specify how you want to reverse the Property, as either Class's Attribute or Association.
Properties are reversed as Associations by default. However if you define the type in the Config.properties file, and by setting the defined type to certain properties, you can reverse them as Class's Attributes.
(i.e.) BrickOut::Form1,BrickOut::Form2 (Put the Types with Namespace with commas between)

[Compile application]

If the source code of this program has been modified, you need to compile before rerunning. To compile the program, double click the following file.
astah* professional(astah* UML) Install folder\api\sample\sample_doxygen_c_sharp\compile.bat

[About support]

This program is provided as a sample of astah* API, so that it will not be a support subject. Your bug reports or questions regarding the environment may not be responded.

[System environments]

This program has been tested on Windows only.

Environment Download
astah* professional(astah* UML) 6.0 or later
astah* professional(astah* UML) Install Folder\lib\commons-digester.jar(version 1.5)
-
Java Running Environment (Applicable Java version for astah* professional(astah* UML) is required) astah* System Requirements
Doxygen (doxygen-1.5.8-setup.exe) Doxygen Main Page
Doxygen Download Page

[Applicable C# items]

All Classes, Attributes, Operations and their definitions are supported. Language Attributes of C# are also supported as far as astah* professional(astah* UML) supports.
Please be aware that both Doxygen and this program do not support to reverse C# completely.

Item Description
Default Model astah* professional(astah* UML) Install folder\template\project\C_Sharp.asta is imported as a default model.
If there is no C_Sharp.asta file at the above directory, default model won't be imported.
C_Sharp.asta is automatically created in the astah* professional(astah* UML) folder when you install astah* professional(astah* UML), and it contains main classes under System.
Primitive Type Reversed as Primitive Type
const [Attribute] const of Language Tab
delegate [Class] delegate of Language Tab
~destructor() Operation that its name starts with ~ and has "" in its return type
enum [Class] <<enum>> of Language Tab
[Attribute] <<enum constant>> of Language Tab
event [Operation] event of Language Tab
(i.e.) public class EventList { public event NameListEventHandler nameListEvent; }
  • Name: "nameListEvent"
  • Type: "NameListEventHandler"
  • <<event>>: "true"'s Operation
  • event:add events that have add will be generated as Properties in XMI via Doxygen
    (EX) public class EventList { public event void operation2 { add { operation2 += value; } } }
  • Name: "operation2"
  • Type: "void"
  • <<property>>:"true"
  • <<property>>get:"true"
  • <<property>>set:"true"'s Operation
  • event:remove events that have remove are generated as Properties in XMIL via Doxygen
    (EX) public class EventList { public event void operation2 { remove { operation2 -= value; } } }
  • Name: "operation2"
  • Type: "void"
  • <<property>>:"true"
  • <<property>>get:"true"
  • <<property>>set: "true"'s Operation
  • generics [Class] Template Parameter Tab
    [Before Doxygen1.5.6]
    "class Class0<T>" works fine.
    Although "class Class0<T> where T:Class1" does not work as it will be skipped at the doxygen.
    [Doxygen1.5.7 and later]
    "class Class0<T>" will be a Class.
    (Name: "Class0", Template Parameter: "T", "T"'s type: "<<Unspecified>>")
    "class Class0<T> where T:Class1" will be a Class.
    (Name: "Class0", Template Parameter: "T", "T"'s type: not "Class1", but "<<Unspecified>>")
    "T"'s type won't be "Class1" because of Doxygen's bug.
    indexer [Operation] <<indexer>> of Language Tab
    If there is more than one indexer that is the same type and same name in one class, the second and later are skipped via Doxygen.
    indexer:get [Operation] <<indexer>>:get of Language Tab
    indexer:set [Operation] <<indexer>>:set of Language Tab
    internal [Class] not supported
    [Attribute] internal of Language Tab
    [Operation] internal of Language Tab
    inout [Operation] Direction Kind of Parameter Tab
    override [Operation] override of Language Tab
    property [Attribute] <<property>> of Language Tab
    property:get [Attribute] <<property>>:get of Language Tab
    property:set [Attribute] <<property>>:set of Language Tab
    readonly [Attribute] readonly of Language Tab
    sealed [Class] sealed of Language Tab
    [Operation] sealed of Language Tab
    static [Class] static of Language Tab
    [Attribute] static of Base Tab
    [Operation] static of Base Tab
    struct [Class] <<struct>> of Language Tab
    unsafe [Operation] unsafe of Language Tab
    virtual [Operation] virtual of Language Tab
    volatile [Attribute] volatile of Language Tab
    Via Doxygen, "const volatile int variable;" makes it volatile and "volatile int variable;" won't.
    Generalization / Realization [Class] Generalization / Realization Tab
    In the Doxygen,
    "class Class0: ClassWithSrc{}(with the source, ClassWithSrc) makes a generalization from the ClassWithSrc to Class0.
    "class Class1: ClassWithoutSrc{}(without the source, ClassWithoutSrc) does not import the ClassWithoutSrc itself at all.
    extension_method [Operation] extension_method of Language Tab

    Following items are not currently supported.
  • abstract
  • attribute
  • extern
  • partial
  • Class's internal
  • Class, Attribute and Operation in other language except for English (i.e. Japanese characters) and also ones that have attributes in other language
    (Resolved in Doxygen 1.5.7 or later)
  • File that contains its path in other language except for English (i.e. Japanese characters)