peculiarities of generation of data types, properties, data types and editing, example of the generated code
Type
, stereotype introducing the new type. When generating code in the target language you declare the type. Types can’t contact any Association, but can be inherited.
Example:
Note: If the classes are in different packages, you will generate 2 separate assemblies to be referenced to each other. Code is successfully generated, but will not compile.
type Description
Generated | Generate SQL DDL Generation .Net language | |
---|---|---|
Any part of any UML class (attribute, method parameter, etc.) declared by this class | or As is specified in the transformation map types for the generator As is. Attribute, method parameter, etc. are declared by this type | |
UML class | .Net class | |
Attribute UML class | Public virtual property with the same name and the appropriate modifier (# - protected , - public , - - private ), and private member of the class for this property. The type of the property and a private member - type attribute. |
|
Method UML class | Public virtual method with the appropriate parameters. The method body empty with a bracket of the programmer to make the code in the method. |
Additional editable properties and how that is generated
The properties of the data type as follows:
1.Tab edit the properties of a UML class:
Property | Description | Generation .Net language |
---|---|---|
Stored |
||
Name |
the name of the UML class, it is the name of the type | Name .Net-class |
Description |
Nekotoroe detailed description, if necessary, for explanatory purposes As DocComment to the class in code .Net language |
|
PrimaryKeyStorage |
||
Storage |
||
AutoAltered |
||
LoadingOrder |
||
Trim |
||
Packet, NamespacePostfix |
Allow to set the Assembly and namespace in which to generate the type of | see the Location of assemblies after code generation |
PBCustomAttributes |
If the option is given, it is generated bracket programmer for “manual” introducing attributes to the class. | |
PBMembers |
Allows you to specify whether brace programmer inside a class for the “manual” introduction of the members of the class | If the option is given, it is generated bracket programmer for “manual” introduction of the members of the class |
PBClass |
||
PublishToEBSD |
If the option is specified before the class is generated by specifying the attribute PublishToEBSDAttribute , which indicates the availability of this class to use the chart editor scripts |
2.Tab edit the properties of the attributes of a UML class:
Property | Description | Generation .Net language |
---|---|---|
AccessModifier |
access modifier to the appropriate property .Net class |
Modifiers: - public - private # - protected |
Stored |
||
Name |
the same name of the attribute that the chart | name of the property in .Net class, and some derived the name of the private member (depending on format private member that is specified in the settings of the generator). |
Description |
description for explanatory purposes As DocComment to the property |
|
Type |
data type properties | type properties and type of the private member |
DefaultValue |
default | initializer As a private member |
NotNull |
||
DataServiceExpression |
||
Storage |
||
Hint |
||
Order |
||
PBCustomAttributes |
If the option is specified before the definition of properties is generated bracket programmer for manual application .Net attributes. | |
PBGetStart |
If the option is given, it is generated bracket programmer in the property getter directly after the start code of the accessor. | |
PBGetEnd |
If the option is given, it is generated bracket programmer in the property getter directly before the end of the code of the accessor. | |
PBSetStart |
If the option is given, it is generated bracket programmer in the property setter directly after the start code of the accessor. | |
PBSetEnd |
If the option is given, it is generated bracket programmer in the property setter immediately before the end of the code of the accessor. | |
Autoincrement |
3.Tab of the edit properties methods UML class:
In the upper part, the methods in the bottom - options are selected in the upper part of the method.
Methods:
Property | Description | Generation .Net language |
---|---|---|
AccessModifier |
access modifier to a corresponding method .Net class | Modifiers: - public - private # - protected |
Name |
same method name that the chart | Name of the method in .Net class |
Description |
description for explanatory purposes As DocComment to the method. If IsEvent specified, the description is generated before the event and before the method wzwodem event. |
|
Type |
data type method As the method type. If not filled - void . |
|
IsEvent |
indicates that this is not a method, and event | IsEvent If specified, the method must have exactly one parameter type that is declared as a UML class with the stereotype EventArg. Description EventArg, - is generated by a suitable delegate. Within the class-type - event. Within the class-type - method swadeshi event (like OnXXXXXXX) |
PBCustomAttributes |
If the option is given, it is generated bracket programmer immediately before the method to “manual” application .Net attributes.] IsEvent If specified, brace programmer is generated before the method of cocking the events OnXXXXXXX |
For parameters of methods:
Property | Description | Generation .Net language |
---|---|---|
Name |
the same parameter name that the chart | Name of the method parameter in .Net class |
Description |
description for explanatory purposes As the description of the parameter in DocComment to a method whose parameter. |
|
Type |
the data type parameter | data Type of the parameter |
Modifier |
Modifier transfer of parameters: byref - byval ref; - ничего; out - out; in - in. |
Example of the generated code on the C# at the example
/// <summary>
/// Representation of time intervals
/// </summary>
// *** Start programmer edit section *** (Minsec CustomAttributes)
// *** End programmer edit section *** (Minsec CustomAttributes)
public class МинСек
{
private int fМин;
private int fСек;
public virtual int Мин
{
get
{
return this.fМин;
}
set
{
this.fМин = value;
}
}
public virtual int Сек
{
get
{
return this.fСек;
}
set
{
this.fСек = value;
}
}
}