Package mapping for Visual Basic (Visual Basic code)
For each Package, ACS generates a subfolder, namespace and/or Visual Basic unit file:
• If the Package mapping is Namespace and the «VB Unit» stereotype is not applied, ACS generates a namespace declaration in the appropriate Visual Basic unit file. No subfolder is created.
• If the Package mapping is Namespace and the «VB Unit» stereotype is applied, ACS generates a Visual Basic unit file for the Package that contains the namespace declaration. No subfolder is created.
• If the Package mapping is Folder and the «VB Unit» stereotype is not applied, ACS generates a subfolder for the Package.
• If the Package mapping is Folder and the «VB Unit» stereotype is applied, ACS generates a subfolder for the Package that contains a Visual Basic unit file for the Package.
ACS generates the child items, properties and tagged values of a Package as follows.
Child items:
• If the Package owns
Classes, ACS generates a code file for each Class that is set up as a VB Unit. If an owned Class is not set up as a VB Unit, ACS does not generate a code file for that Class and the class or module is defined in the appropriate unit file. For more information, see
Class mapping for Visual Basic (Visual Basic code).
• If the Package owns
Data Type, ACS generates a code file for each Data Type that is set up as a VB Unit. If an owned Data Type is not set up as a VB Unit, ACS does not generate a code file for that Data Type and the structure or module is defined in the appropriate unit file. For more information, see
Data type mapping for Visual Basic (Visual Basic code).
• If the Package owns
Interface, ACS generates a code file for each Interface that is set up as a VB Unit. If an owned Interface is not set up as a VB Unit, ACS does not generate a code file for that Interface and the interface or module is defined in the appropriate unit file. For more information, see
Interface mapping for Visual Basic (Visual Basic code).
• If the Package owns Packages, ACS generates a subfolder, namespace and/or Visual Basic unit file for each Package.
All other Package scoped items are ignored.
Properties:
• Description property - when specified and a unit file is generated for the Package, ACS generates the text of a Package's Description property at the beginning of the unit file. For information about how comments are generated, see
Generation of code comments (Visual Basic code).
• Mapping property - when set to Namespace, ACS generates the Package as a namespace. If the Mapping property of a Package is set to Folder, ACS generates the Package as a subfolder.
• Name property - ACS generates this property as the name of the subfolder, namespace and/or Visual Basic unit file as appropriate.
| • ACS may modify the package name that is added to the code (and used for subfolder or unit file when applicable) to make it valid for Visual Basic. You can specify the exact package name to use for the subfolder, code file or namespace through the CODE_GENERATION_NAME property of a Package. For more information, see Modification of item names when inserted into Visual Basic (Visual Basic code). • If a value is set for the VB UnitLocation tag definition, ACS does not use the Name of the Package to name a generated Visual Basic unit file. |
• Visibility property - this property is ignored.
Tag Definitions:
When the «VB Unit» stereotype is applied to a Package, ACS generates the package in its own file. The «VB Unit» stereotype applies the following Tag Definitions to a Package:
• 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 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.