From 506041499fc15d0c4cab72d5afbf682ccf6be31f Mon Sep 17 00:00:00 2001 From: ddongjoon Date: Mon, 24 Nov 2014 12:23:32 +0900 Subject: [PATCH] Readme file update for C# reverse engineering. --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/README.md b/README.md index 5ce2a7e..90c2c0f 100644 --- a/README.md +++ b/README.md @@ -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 `<>`. +* 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 `<>`. +* Annotation type elements to _UMLOperation_. (Default value to a Tag with `name="default"`). + + +--- + +Licensed under the MIT license (see LICENSE file).