Plug-In Guides

The Professional Edition of Poseidon comes with several options for code generation and one for documentation generation (UMLDoc). Java code generation is the default setting, but you can also choose to generate other types of code. To do this, you have to activate the plug-in that supports the desired language. (Via Plug-Ins -> Plug-Ins 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 Plug-In Guide

General Rules

Tagged Values

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

  • internal

  • protected internal

  • volatile

  • override

  • sealed

  • extern

  • internal

  • virtual

Additional Stereotypes

  • <<event>>

  • <<readonly>>

  • <<delegate>>

Modeling 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

    6. virtual

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

Struct tapes are never abstract and are always implicitly sealed. The 'abstract' and 'sealed' modifiers are therefore not permitted in a struct declaration. Since inheritance isn't supported for structs, the declared accessibility of a struct member cannot be 'protected' or 'protected 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'

  • 'root' will be translated to 'new'

Poseidon CORBA IDL Code Generation Plug-In 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 Plug-In 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'

Poseidon PHP4 Code Generation Plug-In Guide

This guide is based on the PHP4 Manual, available at http://www.php.net/docs.php.

General Rules

  • The only classifier in PHP4 is 'Class'.

  • PHP4 Class can not participate in an Association.

  • There is no Exception in PHP4

  • There are two files generated for each Class generation process:

    1. '.inc' file that contains the class declaration

    2. '.php' file that includes related the '.inc' on its first line

Tagged Values

The following tagged value keys are supported for PHP4 Class:

  • '<<<' for Heredoc string

  • 'initval' for an initial value of an operation parameter

  • '&' for operation parameter passed by reference

  • '&' for a function that returns a reference

PHP4 Class Modeling Rules

  • Uses standard UML 'Class'

  • Supports single inheritance only

Class Signature

  • There are no visibilities for Class Signature

Class Attributes

  • There are no visibilities for Class Attributes

  • Tagged values supported:

    1. Heredoc

      Tagged value = '<<<', with value = 'true'

      Will return anything typed in the initial value with Heredoc string type.

      For example:

      $str = <<<EOD Example of
                          string spanning multiple lines using heredoc syntax. EOD;

Class Operations

  • There are no visibilities for Class Operations

  • Tagged values supported:

    1. Parameter initial value

      Tagged value= 'initval', with value = (specified parameter initial value).

      For example:

      class ConstructorCart extends Cart {
                          function ConstructorCart($item = "10", $num = 1) {
                          $this->add_item ($item, $num); } }
    2. Parameter passed by reference

      Tagged value='&' with value='true' in the parameter signature.

      For example:

      <?php function foo (&$var) {
                          $var++; } $a=5; foo ($a); // $a is 6 here ?>
    3. Function returns a reference

      Tagged value='&' with value='true' in the operation signature.

      For example:

      <?php function &returnsReference()
                          { return $someref; } $newref =& returnsReference();
                          ?>

Poseidon Delphi Code Generation Plug-In Guide

Classfiers

  • Class

  • Interface

  • Enumeration

  • Record

  • Set

  • Sub Range

  • Array

  • Exception

Tagged Values

All strings input in the Tag column are case-sensitive.

  • Classifier

    • Tag = 'uses' with Value = string that represents unit(s) name to be included in specified unit declaration, separated by comma.

      Description: Handles strings that represent the names of units to be included in specified unit declarations. A 'uses' tag with a blank value will be defaulted to 'SysUtils'.

      Example: UnitA, UnitB, UnitC

    • Tag = 'setvalue' with Value = string that represents the value of 'Set', separated by comma.

      Description: Handles the way to input the value of the 'Set' type.

      Example: 1,9

    • Tag = 'subrangevalue' with Value = string that represents the value of 'Sub Range' separated by comma.

      Description: Handles the way to input the value of the 'Sub Range' type.

      Example: 1,9

    • Tag = 'arrayvalue' with Value = string that represents the value of 'Array', separated by comma.

      Description: Handles the way to input the value of the 'Array' type.

      Example: 1,9

    • Tag = 'arraytype' with value = string that represents the type of 'Array'.

      Description: Handles the way to input the type of the 'Array' type.

  • Attribute

    • Tag = 'published' with Value = 'true'.

      Description: Handles the published visibility of the classifier 'attribute'.

  • Operation

    • Tag = 'published' with Value = 'true'.

      Description: Handles the published visibility of the classifier 'operation'.

    • Tag = 'virtual' with Value = 'true'

      Description: Handles the way to set the specified operation into a 'virtual' type operation.

    • Tag ='dynamic' with Value = 'true'

      Description: Handles the way to set the specified operation into a 'dynamic' type operation.

    • Tag = 'override' with Value = 'true'

      Description: Handles the way to set the specified operation into an 'override' type operation.

    • Tag = 'overload' with Value = 'true'

      Description: Handles the way to set the specified operation into a 'overload'type operation.

  • Exception

    • Tag = 'published' with Value = 'true'.

      Description: Handles the published visibility of 'Exception'.

Stereotypes

  • Attribute

    • Stereotype = 'Const'

      Description: Handles the way to specify a 'const' type Attribute.

    • Stereotype = 'property'

      Description: This will handle the way to specify a 'property' type Attribute.

  • Operation

    • Stereotype = 'function'

      Description: Handles the way to specify a 'function' type Operation.

    • Stereotype = 'procedure'

      Description: Handles the way to specify a 'procedure' type Operation.

  • Classifier

    • Stereotype = 'Enum'

      Description: Handles the way to specify an 'Enumeration' type Classifier.

    • Stereotype = 'Record'

      Description: Handles the way to specify a 'Record' type Classifier.

    • Stereotype = 'Set'

      Description: Handles the way to specify a 'Set' type Classifier.

    • Stereotype = 'SubRange'

      Description: Handles the way to specify a 'Sub Range' type Classifier.

    • Stereotype = 'Array'

      Description: Handles the way to specify an 'Array' type Classifier.

    • Stereotype = 'Exception'

      Description: Handles the way to specify an 'Exception' type Classifier.

Modeling Element Rules

  • Class

    • Uses the standard UML Class

    • Participates in generalizations, associations and specifications

    • Only supports single inheritance

  • Interface

    • Uses the standard UML Interface

    • Participates in generalizations

    • Does not participate in associations or specifications

    • Only supports single inheritance

  • Enumeration

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

    • Does not participate in generalizations or specifications

    • Cannot have navigable opposite association ends or operations

  • Record

    • Uses the standard UML Class with << Record >> stereotype

    • Does not participate in generalizations or specifications

    • Can have navigable opposite association ends

    • Cannot have any operations

  • Set

    • Uses the standard UML Class with << Set >> stereotype

    • Does not participate in generalizations or specifications

    • Cannot have navigable opposite association ends or operations

  • Sub Range

    • Uses the standard UML Class with << SubRange >> stereotype

    • Does not participate in generalizations or specifications

    • Cannot have navigable opposite association ends or operations

  • Array

    • Uses the standard UML Class with << Array >> stereotype

    • Does not participate in generalizations or specifications

    • Cannot have navigable opposite association ends or operations

  • Exception

    • Uses the standard UML Class with << Exception >> stereotype

    • The same as Class

Specific Rules

  • An attribute with 'non-1' multiplicity will generate an Array that is defaulted to type 'int' with Lower Bound and Upper Bound values based on the specified multiplicity.

    Example: Attribute with multiplicity: 1..2 will generate : Array[1..2] of int;

  • A blank value with the 'uses' Tag, will be defaulted to 'SysUtils'.

  • A blank value with the 'setvalue' Tag will be defaulted to 'a'..'z'

  • A blank value with the 'subrangevalue' Tag will be defaulted to 'a'..'z'

  • A blank value with the 'arrayvalue' Tag will be defaulted to 1..10

  • A blank value with the 'arraytype' Tag will be defaulted to int

  • A blank value with the 'procedure' and 'function' Tag will be defaulted to procedure

Poseidon Perl Code Generation Guide

General Rules

  • The result of the code generation is saved as a Module file ( ClassName.pm )

  • Interfaces and their associations are not translated into Perl code

  • Abstracts and their associations are not translated into Perl code

  • Element's documentation are translated into Perl comment syntax (# comment )

  • Attribute / Parameter types are ignored because there is no need to define data types for Perl variables

Classes

  • Uses the standard UML 'Class'

  • Classes are translated into Perl Class (package className )

  • A constructor is generated for each class (sub new)

Class Attributes

  • Attributes are translated into variables

  • Attributes with single multiplicity are translated into scalar type variables (my $AttributeName )

  • Attributes with multi-multiplicity are translated into array type variables (my @AttributeName )

  • An attribute with a tagged value 'local' that is set to 'true' is translated into 'local $AttributeName' instead of 'my $attribute'

  • An attribute that has non-1 multiplicity with a tagged value 'Map' set to 'true' is translated into '%AttributeName' instead of '@AttributeName'

  • When the visibility of an attribute is public, 'use vars qw ( $AttributeName )' is added to the code generation.

Class Operations

  • Operations are translated into Sub-routines ( Sub OperationName )

  • Parameters are translated into Sub-routine variables

  • Return value are not translated into Perl code

  • When an operation is static and has the stereotype << create >>, a 'BEGIN { } ' block is added to code generation.

  • When an operation is static and has the stereotype << destroy >>, a 'END { } ' block is added to code generation.

Associations

  • 1 to 1 associations are translated into scalar type variables (my $className )

  • 1 to N associations are translated into array type variables (my @className )

Aggregation

  • 1 to 1 aggregations are translated into scalar type variables (my $className )

Inheritance

  • Single inheritence is implemented using @ISA = qw(class)

  • Multiple inheritence is implemented using @ISA = qw(class1 class2 ...)

Poseidon SQL DDL Code Generation Plug-In Guide

Modeling Element Rules

Classes

  • Uses the standard UML 'Class'

  • Each class is considered as a table.

Attributes

  • Describes the columns in table. Each attribute can have stereotypes that will be treated as column constraints.

Association Ends

  • Describes the relationships between tables. Foreign keys will be automatically generated in tables that have references to other tables.

Tagged Values

These tagged value keys are supported when the value is set with digit number within appropriate context: The values will specifically describe the column data type. Considered in the following order: length, precision, scale

Additional Stereotypes

Stereotypes apply in attributes. The stereotype for allowing NULL values is not included since it is the default behaviour of columns.

  • Primary Key

  • Not Null

  • Unique