Git Product home page Git Product logo

csharp's Introduction

C# Extension for StarUML 2

This extension for StarUML(http://staruml.io) support to generate C# code from UML model and to reverse Java code to UML model. Install this extension from Extension Manager of StarUML. It is based on C# 2.0 specification.

C# Code Generation

  1. Click the menu (Tools > C# > Generate Code...)
  2. Select a base model (or package) that will be generated to C#.
  3. Select a folder where generated C# source files will be placed.

Belows are the rules to convert from UML model elements to Java source codes.

UMLPackage

  • converted to C# namespace (as a folder).

UMLClass

  • converted to C# Class. (as a separate .cs file)
  • visibility to one of modifiers public, protected, private and none.
  • isAbstract property to abstract modifier.
  • isFinalSpecification and isLeaf property to sealed modifier.
  • Default constructor is generated.
  • All contained types (UMLClass, UMLInterface, UMLEnumeration) are generated as inner type definition.
  • Documentation property to C#Doc comment.
  • Annotation Type is converted to C# attribute class which extends System.Attribute and postfix of class is Attribute. (cf. class testAttribute:System.Attribute)

UMLAttribute

  • converted to C# Field.
  • visibility property to one of modifiers public, protected, private and none.
  • name property to field identifier.
  • type property to field type.
  • multiplicity property to array type.
  • isStatic property to static modifier.
  • isLeaf property to sealed modifier.
  • defaultValue property to initial value.
  • Documentation property to C#Doc comment.

UMLOperation

  • converted to C# Methods.
  • visibility property to one of modifiers public, protected, private and none.
  • name property to method identifier.
  • isAbstract property to abstract modifier.
  • isStatic property to static modifier.
  • UMLParameter to C# Method Parameters.
  • UMLParameter's name property to parameter identifier.
  • UMLParameter's type property to type of parameter.
  • UMLParameter with direction = return to return type of method. When no return parameter, void is used.
  • UMLParameter with isReadOnly = true to sealed modifier of parameter.
  • Documentation property to C#Doc comment.

UMLInterface

  • converted to C# Interface. (as a separate .cs file)
  • visibility property to one of modifiers public, protected, private and none.
  • Documentation property to C#Doc comment.

UMLEnumeration

  • converted to C# enum. (as a separate .cs file)
  • visibility property to one of modifiers public, protected, private and none.
  • UMLEnumerationLiteral to literals of enum.

UMLAssociationEnd

  • converted to C# Field.
  • visibility property to one of modifiers public, protected, private and none.
  • name property to field identifier.
  • type property to field type.
  • If multiplicity is one of 0..*, 1..*, *, then collection type (List<> when isOrdered = true or HashSet<>) is used.
  • defaultValue property to initial value.
  • Documentation property to JavaDoc comment.

UMLGeneralization

  • converted to C# Extends (:).
  • Allowed only for UMLClass to UMLClass, and UMLInterface to UMLInterface.

UMLInterfaceRealization

  • converted to C# Implements (:).
  • Allowed only for UMLClass to UMLInterface.

csharp's People

Contributors

dongjoon1251 avatar niklauslee avatar

Watchers

Max avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.