Class mapping for Visual Basic (Visual Basic code)
For each Class, ACS generates a class in the code. If the «VB Class» and «VB Unit» stereotypes are applied to the Class and the value of the VB UnitType tag definition is set to Module, ACS generates a module.
If the «VB Unit» stereotype is not applied to the Class, ACS generates the class or module in its owner's namespace. If the «VB Unit» stereotype is applied to the Class, ACS generates the class or module in its own file.
If the «VB DontGenerate» stereotype is applied to a Class, ACS ignores that Class.
The class declaration and body is derived from the items it owns, properties of the Class, and the tagged values set for Tag Definitions applied by the «VB Class» and «VB Unit» stereotypes.
ACS generates the child items, properties and tagged values of a Class as follows.
Child items:
If the Class owns any
Attributes, ACS generates each Attribute as a field or property. For more information about Attribute mapping, see Attribute mapping for Visual Basic (Visual Basic code).
If the Class owns any Classes, ACS generates the Classes as nested classes.
If the Class owns any Data Types, ACS generates the Data Types as nested structures.
If the Class owns any Interfaces, ACS generates the Interfaces as nested interfaces.
If the Class owns any Operations, ACS generates each Operation as a function, event handler, event or operator. For more information about Operation mapping, see Operation mapping for Visual Basic (Visual Basic code).
If the Class owns any Roles, ACS generates the each Role as a field or property. For more information about Role mapping, see Association and role mapping for Visual Basic (Visual Basic code).
If the Class owns any Type Definitions whose Construction is Enumeration, ACS generates each Type Definition as an enum. For more information about Type Definition mapping, see Type Definition mapping for Visual Basic (Visual Basic code).
Properties:
Abstract property - when set to true (Abstract check box selected on Property Pages), ACS generates the class with the MustInherit modifier.
Description property - if a value is set, ACS generates that value on the line before the class or module declaration. For information about how comments are generated, see Generation of code comments (Visual Basic code).
Name property - ACS generates the property as the identifier of the class or module.
* 
ACS may modify the class or module identifier that is added to the code to make it valid for Visual Basic. You can specify the exact identifier to use through the CODE_GENERATION_NAME property of a Class. See Modification of item names when inserted into Visual Basic (Visual Basic code).
Template property - when set to True (Template check box selected on Property Pages), ACS generates the Modeler Class as a Visual Basic generic type. ACS generates the Formal Template Parameters as the type parameters after the class or module identifier.
Visibility property - this property can be set to Public, Private, Protected or Package: ACS generates the value as the access of the class or module (Package is generated as Public). ACS generates private and protected access only for nested Classes.
Tag Definitions:
You can apply the «VB Class» and «VB Unit» stereotypes to a Class.
The «VB Class» stereotype applies the following Tag Definitions to a Class:
VB Attributes tag definition - if a value is set, ACS generates that value as .NET attributes of the property, that is, before the access of the class or module. The .NET attributes should take the form of <AtrClass(OptInitList)>.
VB Declare tag definition - if a value is set, ACS generates that value as the declare clauses for the class or module.
If reverse engineering is enabled in ACS, you can change the declare clauses in the code file and ACS will update the VB Declare property in the model.
For information about maintaining reversible properties through ACS, see the related links below.
VB Implements tag definition - if a value is set, ACS generates a colon after the name of the class or module (or after the VB Inherits value if specified), and then generates the value after the colon. For example, you can set the value to 'Implements Mylft'.
VB Inherits tag definition - if a value is set, ACS generates a colon after the name of the class or module, and then generates the value after the colon. For example, you can set the value to 'Inherits MyClass'.
VB Partial tag definition - when set to True, ACS generates the Partial keyword before the access of the class or module.
VB UnitType tag definition - When the «VB Unit» stereotype is applied to the Class and the VB UnitType tag definition is set to Module, ACS generates a module rather than a class.
When the «VB Unit»stereotype is applied to a Class, ACS generates the class or module in its own file. The «VB Unit» stereotype applies the following Tag Definitions to a Class:
VB UnitLocation tag definition - if a value is set, ACS uses the value to determine the name of the generated Visual Basic unit file and the folder in which that unit file is generated. For example:
A value of MyFile results in ACS generating a file named MyFile.vb in the ACS target folder.
A value of MySubfolder\MyFile results in ACS generating a file named MyFile.vb in a folder named MySubfolder, which ACS creates as a subfolder of the ACS target folder.
VB Imports tag definition - if a value is set, ACS generates that value as import clauses in the Visual Basic unit file.
If reverse engineering is enabled in ACS, you can change the import clauses in the code file and ACS will update the VB Imports property in the model.
For information about maintaining reversible properties through ACS, see the related links below.
Was this helpful?