Skip to content

Commit

Permalink
Readme file update for C# reverse engineering.
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjoon1251 committed Nov 24, 2014
1 parent 4e950ae commit 5060414
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,90 @@ Belows are the rules to convert from UML model elements to Java source codes.

* converted to _C# Implements_ (`:`).
* Allowed only for _UMLClass_ to _UMLInterface_.



C# Reverse Engineering
------------------------

1. Click the menu (`Tools > C# > Reverse Code...`)
2. Select a folder containing C# source files to be converted to UML model elements.
3. `CsharpReverse` model will be created in the Project.

Belows are the rules to convert from C# source code to UML model elements.

### C# Namespace

* converted to _UMLPackage_.

### C# Class

* converted to _UMLClass_.
* Class name to `name` property.
* Type parameters to _UMLTemplateParameter_.
* Access modifier `public`, `protected` and `private` to `visibility` property.
* `abstract` modifier to `isAbstract` property.
* `sealed` modifier to `isLeaf` property.
* Constructors to _UMLOperation_ with stereotype `<<constructor>>`.
* All contained types (_UMLClass_, _UMLInterface_, _UMLEnumeration_) are generated as inner type definition.


### C# Field (to UMLAttribute)

* converted to _UMLAttribute_ if __"Use Association"__ is __off__ in Preferences.
* Field type to `type` property.

* Primitive Types : `type` property has the primitive type name as string.
* `T[]`(array) or its decendants: `type` property refers to `T` with multiplicity `*`.
* `T` (User-Defined Types) : `type` property refers to the `T` type.
* Otherwise : `type` property has the type name as string.

* Access modifier `public`, `protected` and `private` to `visibility` property.
* `static` modifier to `isStatic` property.
* `sealed` modifier to `isLeaf` and `isReadOnly` property.
* Initial value to `defaultValue` property.

### C# Field (to UMLAssociation)

* converted to (Directed) _UMLAssociation_ if __"Use Association"__ is __on__ in Preferences and there is a UML type element (_UMLClass_, _UMLInterface_, or _UMLEnumeration_) correspond to the field type.
* Field type to `end2.reference` property.

* `T[]`(array) or its decendants: `reference` property refers to `T` with multiplicity `*`.
* `T` (User-Defined Types) : `reference` property refers to the `T` type.
* Otherwise : converted to _UMLAttribute_, not _UMLAssociation_.

* Access modifier `public`, `protected` and `private` to `visibility` property.

### C# Method

* converted to _UMLOperation_.
* Type parameters to _UMLTemplateParameter_.
* Access modifier `public`, `protected` and `private` to `visibility` property.
* `static` modifier to `isStatic` property.
* `abstract` modifier to `isAbstract` property.
* `sealed` modifier to `isLeaf` property.

### C# Interface

* converted to _UMLInterface_.
* Class name to `name` property.
* Type parameters to _UMLTemplateParameter_.
* Access modifier `public`, `protected` and `private` to `visibility` property.

### C# Enum

* converted to _UMLEnumeration_.
* Enum name to `name` property.
* Type parameters to _UMLTemplateParameter_.
* Access modifier `public`, `protected` and `private` to `visibility` property.
* Enum constants are converted to _UMLEnumerationLiteral_.

### C# AnnotationType

* converted to _UMLClass_ with stereotype `<<annotationType>>`.
* Annotation type elements to _UMLOperation_. (Default value to a Tag with `name="default"`).


---

Licensed under the MIT license (see LICENSE file).

0 comments on commit 5060414

Please sign in to comment.