About Microsoft Visual C# code to UML mapping

During reverse engineering, the following code constructs in Visual C# correspond to UML elements.

ShowNamespace

ShowClasses

C# classes are reverse engineered as UML classes (class: In a static structure diagram, a set of objects with similar structure, behavior, and relationships. Classes are declared in class (static structure) diagrams and represent concepts in the systems being modeled.) and include:

Name Inherited classes and implemented interfaces Visibility (public, protected, or private) IsAbstract IsLeaf Base classes and implemented interfaces Member operations/functions Member variables

 Note   In C#, the following class constructs are not supported in Microsoft Office Visio UML:

New Internal

ShowInterfaces

C# interfaces are reverse engineered as UML interface (interface: Specifies the externally visible operations of a class, component, package, or other element without specifying internal structure. An interface has only operations but no attributes, states, or associations.) shapes and include:

Name Visibility (public, protected, or private) IsLeaf Base interfaces Member operations

ShowEnumerated type

ShowStruct

A struct in C# is reverse engineered as a UML class with <<struct>> stereotype (stereotypes: A representation of a usage distinction. A stereotype is a subclass of an existing element with the same attributes and relationships as that element but with a different intent and possibly additional constraints.), and includes:

Name Visibility (public, protected, or private) IsAbstract IsLeaf Base classes and implemented interfaces Members

ShowProperties

Properties in C# are reverse engineered as UML operations (operation: A service that an instance of a class may be requested to perform. The behavior of a class is represented by a set of operations. Each operation has a name and a list of arguments.) and include:

Name Visibility (public, protected, or private) Type Get and Set methods (added as code generation options)

New Internal Override

ShowDelegates

Delegates in C# are reverse engineered as UML classes with the <<delegate>> stereotype and include: Name Visibility (public, protected, or private) Signature (added to the class as an operation)

ShowMember operations

C# member operations are reverse engineered as UML operations (operation: A service that an instance of a class may be requested to perform. The behavior of a class is represented by a set of operations. Each operation has a name and a list of arguments.) and include:

Name Visibility (public, protected, or private) Scope (static or shared) IsPolymorphic IsAbstract Operation kind

Operations have tags according to their type, such as constructor, destructor, property, event, indexer, or procedure. You can view these tagged values in the UML model using the Code Generation Options page of the UML Operation Properties dialog box.

Return type Parameters

 Note   The following C# member operations are not supported in Microsoft Office Visio UML:

New Internal Extern Override

ShowConstants

Constants in C# are reverse engineered as UML attributes (attribute: A data definition held by a class. The structure of a class is described by its attributes. The default syntax for an attribute is: visibility name : type-expression=initial value {property string}) and include:

Visibility (public or private) Type Initial value

Constants are added to the model as attributes with the changeable field set to frozen.

 Note   Read-only elements in code are reverse engineered as constants.

ShowMember variables

C# member variables are reverse engineered as UML attributes (attribute: A data definition held by a class. The structure of a class is described by its attributes. The default syntax for an attribute is: visibility name : type-expression=initial value {property string}) and include:

Name Type Visibility (public, protected, or private) Scope (static or shared) Changeable (frozen or changeable) Initial value

ShowMethod parameters

ShowC# code constructs not supported in UML

The following C# code constructs won't be mapped to UML elements when reverse engineering from Visual Studio .NET to Microsoft Office Visio.

Classes: new, internal, static constructors Data members: new, internal Enumerated type: base type Events: new, internal Exceptions Parameter: paramArray Properties: new, internal, override, sealed

 
 
Applies to:
Visio 2003