Plug In Guides

The Professional Edition of Poseidon comes with four options of code generation and one for documentation generation (UMLDoc). Java code generation is the default setting, but you can also choose to generate CORBA IDL, Visual Basic .NET or C# code. To do this, you have to activate the plugin that supports the desired language. (Via Plugins -> Plugins Panel). When you do this, a set of stereotypes becomes available that can be used to control the result of the code generation. The next sections describe what stereotypes and tagged values you can use to control the output of code generation.

Poseidon C# Code Generation Plugin Guide

General Rules

Tagged Values

These tagged value keys are supported when the value is set to 'true' within appropriate context:

  • internal

  • protected internal

  • volatile

  • override

  • sealed

  • extern

Additional Stereotypes

  • event

  • readonly

  • delegate

Modelling Element Rules

Classes

  • Uses the standard UML ‘Class’

  • Supports single inheritance only

Class Signature

  • Additional visibilities for class signatures are set when the tagged values below are 'true':

    1. internal

    2. sealed

Class Attributes

  • Additional visibilities for class attributes are set when the tagged values below are 'true':

    1. internal

    2. protected internal

    3. volatile

Class Operations

  • Additional visibilities for class operations are set when the tagged values below are 'true':

    1. internal

    2. protected internal

    3. override

    4. sealed

    5. extern

Everything else will use the checked visibility radio buttons

Interface

  • Uses the standard UML ‘Interface’

  • Supports single inheritance only

Interface Signature

  • Additional visibilities for interface signatures are set when the tagged value below is 'true':

    1. internal

Interface Members

  • All interface members implicitly have public access. It is a compile-time error for interface member declarations to include any modifiers. In particular, interface members cannot be declared with the modifiers abstract, public, protected, internal, private, virtual, override, or static.

Everything else will use the checked visibility radio buttons.

Structure

  • Uses the standard UML 'Class' with the <<struct>> stereotype

  • Supports single inheritance only

Structure Signature

Additional visibilities for structure signatures are set when the tagged value below is 'true':

  • internal

Structure Members

Function members in a struct cannot be abstract or virtual, and the override modifier is allowed only to override methods inherited from the type System.ValueType. A struct may be passed by reference to a function member using a 'ref' or 'out' parameter.

Everything else will use the checked visibility radio buttons.

Enumeration

  • Uses the standard UML 'Class' with an <<enum>> stereotype

  • By default, it generates an enum as type 'int'.

  • Enum does not participate in generalizations or specifications

  • Enum cannot have navigable opposite association ends, operations, or inner classifiers

  • Anything else will default to 'int'.

Enumeration Signature

Additional visibilities for enumeration signatures are set when the tagged value below is 'true':

  • internal

Everything else will use the checked visibility radio buttons.

Delegate

  • Uses the standard UML 'Class' with a <<delegate>> stereotype

  • Delegate does not participate in generalizations or specifications

Delegate Signature

Additional visibilities for the delegate signatures are set when the tagged value below is 'true':

  • internal

Everything else will use the checked visibility radio buttons.

C# Event

C# events are supported with an operation that has the stereotype <<event>>.

Operations

There are some translations on the return type of C# operations:

  • in/out parameter direction will be translated to ref

  • in parameter direction will be translated to blank (“”)

  • out will be translated to out

Poseidon CORBA IDL Code Generation Plugin Guide

General Rules

  • Everything is modeled using the standard UML ‘Class’ with an appropriate stereotype as defined by UML Profile for CORBA

  • For details about modeling CORBA IDL, refer to the UML Profile for CORBA v1.0

CORBA Interface

  • Uses the standard UML ‘Class’ with the <<CORBAInterface>> stereotype

  • Interface member has to be ‘public’

CORBA Value

  • Uses the standard UML ‘Class’ with the <<CORBAValue>> stereotype

  • Can only specialize one other concrete CORBA Value

  • CORBA Value can only have ‘public’ or ‘private’ attributes and navigable opposite association ends

  • CORBA Value's ‘Factory’ method is modeled using the <<CORBAValueFactory>> stereotype with an Operation

  • CORBA Value can have only 0 or 1 <<CORBAValueFactory >>-stereotyped Operation

  • CORBA Value can only have ‘public’ operations

CORBA Struct

  • Uses the standard UML ‘Class’ with the <<CORBAStruct>> stereotype

  • CORBA Struct cannot participate in generalizations or specifications

  • CORBA Struct can have only ‘public’ attribute and navigable opposite association end of single multiplicity

  • CORBA Struct cannot have operations

CORBA Enum

  • Uses the standard UML ‘Class’ with the <<CORBAEnum>> stereotype

  • CORBA Enum cannot participate in generalizations or specifications

  • CORBA Enum can have only ‘public’ attributes

  • CORBA Enum cannot have navigable opposite association ends

  • CORBA Enum cannot have operations

CORBA Exception

  • Uses the standard UML ‘Class’ with the <<CORBAException>> stereotype

  • Due to current Poseidon limitations, CORBA Exception names must end in the string ‘Exception’

  • CORBA Exception cannot participate in generalizations or specifications

  • CORBA Exception can have only ‘public’ attributes with single multiplicity

  • CORBA Exception cannot be an end of a navigable association end

  • CORBA Exception cannot have operations

CORBA Union

  • Uses the standard UML ‘Class’ with the <<CORBAUnion>> stereotype

  • CORBA Union cannot participate in generalizations or specifications

  • CORBA Union can not have operations

  • There are two ways to model CORBA Union as specified in UML Profile for CORBA:

    • Using a composition relationship that points to a ‘switcher’ and has the <<switchEnd>> stereotype. Every attribute must have a tagged value with ‘Case’ as the key and the switch condition as the value.

    • Using an attribute with the <<switch>> stereotype attribute acting as the ‘switcher’ in conjunction with a composition relationship. The navigable opposite association ends must have tagged values with ‘Case’ as the key and the switch condition as the value.

Please see UML Profile for CORBA v1.0 §3.5.15 for more details.

Poseidon VB.Net Code Generation Plugin Guide

General Rules

  • ‘package’ visibility will be translated into ‘Friend’

  • ‘abstract’ will be translated into ‘MustInherit’ or ‘MustOverride’

  • ‘final’ will be translated into ‘NotInheritable’ or ‘NotOverridable’

  • ‘static’ will be translated into ‘Shared’

The following keys for tagged value pairs are supported when the value has been set to ‘true’ within the appropriate context:

  • ‘Shadows’

  • ‘Overridable’

  • ‘Protected Friend’

Classes

  • Uses the standard UML ‘Class’

  • Supports single inheritance only

  • ‘Protected Friend’ visibility is determined by setting the tagged value ‘Protected Friend’ to ‘true’. Everything else will use the checked visibility radio button.

  • Classes with abstract operations must also be declared ‘abstract’

Interfaces

  • Uses the standard UML ‘Interface’

  • Interface identifiers must start with the ‘I’ character

  • Interface operations must be ‘Public’ and cannot be ‘Shared’

  • Interfaces cannot have attributes or navigable opposite association ends

Modules

  • Uses the standard UML ‘Class’ with the <<Module>> stereotype

  • Modules cannot be ‘abstract’ or ‘final’

  • Modules cannot participate in generalization or specification

  • Modules cannot be an inner classifier or have an inner classifier

  • Modules cannot have a ‘Protected’ or ‘Protected Friend’ member

Structures

  • Uses the standard UML ‘Class’ with the <<Structure>> stereotype

  • Structures must have at least one member that is non-static (shared) and is either an attribute, a navigable opposite association end, or an operation with the stereotype <<Event>>.

  • Structures cannot have a ‘Protected’ or ‘Protected Friend’ member

  • Structures cannot have an attribute or navigable opposite association end with an initialized value

Enums

  • Uses the standard UML ‘Class’ with the <<Enum>> stereotype

  • By default, it generates an Enum as type ‘Integer’

  • Enums do not participate in generalizations or specifications

  • Enums cannot have navigable opposite association ends, operations, or inner classifiers

  • Other Enum types are supported by using the tagged value key ‘type’ with one of the following values:

    • ‘Short’

    • ‘Byte’

    • ‘Integer’

    • ‘Long’

  • Anything else will default to ‘Integer’

Operations

  • Operations support the following tagged values:

    • ‘Protected Friend’

    • ‘Shadows’

    • ‘Overridable’

  • Operations with no return parameter (returning ‘void’) are generated as ‘Sub’

  • Operations with a return parameter are generated as ‘Function‘

Operation's Parameters

  • Parameter type ‘in’ is translated as ‘ByVal’, everything else is ‘ByRef’

  • The type ‘ParamArray’ is supported by using the stereotype <<ParamArray>> with a parameter

  • A ‘ParamArray’ parameter must be the last parameter

  • A ‘ParamArray’ parameter must be of type ‘in’ or ‘ByVal’

Visual Basic Properties

  • Properties are supported with <<Property>> stereotyped operations

  • There are 3 type of stereotypes available:

    • ‘Property’ will generate ‘Get’ and ‘Set’ inside the Property block

    • ‘ReadOnly Property’ will generate only ‘Get’ inside the Property block

    • ‘WriteOnly Property’ will generate only ‘Set’ inside the Property block

  • If no attribute is set in ‘accessed attribute’, it will by default generate an attribute with same type as the Property return type with the name set to ‘m_operation_name’.

Visual Basic Events

  • VB Events are supported by using <<Event>> stereotypes with operations

Attribute & Association Ends

  • Supports the tagged value ‘Protected Friend’