About Microsoft Visual C# code to UML mapping

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

Namespace

A C# Namespace is reverse engineered as a UML package, and includes:

  • Name

  • Members

Classes

C# classes are reverse engineered as UML classes 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

Interfaces

C# interfaces are reverse engineered as UML interface shapes and include:

  • Name

  • Visibility (public, protected, or private)

  • IsLeaf

  • Base interfaces

  • Member operations

Enumerated type

A C# enumerated type is reverse engineered as a UML data type with <<enum>> stereotype and includes:

  • Name

  • Visibility (public, protected, or private)

  • IsLeaf

  • Members

Note: In C#, the information provided by base type is not supported in Microsoft Office Visio UML.

Struct

A struct in C# is reverse engineered as a UML class with <<struct>> stereotype, and includes:

  • Name

  • Visibility (public, protected, or private)

  • IsAbstract

  • IsLeaf

  • Base classes and implemented interfaces

  • Members

Properties

Properties in C# are reverse engineered as UML operations and include:

  • Name

  • Visibility (public, protected, or private)

  • Type

  • Get and Set methods (added as code generation options)

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

  • New

  • Internal

  • Override

Delegates

  • 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)

Member operations

C# member operations are reverse engineered as UML operations 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

Constants

Constants in C# are reverse engineered as UML attributes 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.

Member variables

C# member variables are reverse engineered as UML attributes and include:

  • Name

  • Type

  • Visibility (public, protected, or private)

  • Scope (static or shared)

  • Changeable (frozen or changeable)

  • Initial value

Method parameters

C# method parameters are reverse engineered as UML parameters and include:

  • Name

  • Type

  • Direction (in, inout, out, or return)

  • Default value

C# 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

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×