Structs are lightweight types that make fewer demands on the operating system and on memory than conventional classes. PowerDesigner models Visual Basic 2005 structs as classes with a stereotype of <<Structure>>.
For information about creating and working with classes, see Classes (OOM).
A struct can implement interfaces but does not support inheritance; it can contain events, variables, constants, methods, constructors, and properties.
In the following example, the struct contains two attributes and a constructor operation:
... Public Class Point Protected Y As Integer Protected X As Integer Public Sub New() End Sub End Class ... |
Visual Basic 2005 struct property sheets contain all the standard struct tabs along with the following properties, located on the VB tab:
Property |
Description |
---|---|
Explicit |
Specifies the Explicit option directive for the struct declaration. |
Shadows |
Specifies that the struct redefines a struct defined in a parent struct. |
Strict |
Specifies the Strict option directive for the struct declaration. |
Compare |
Specifies the Compare option directive for the struct declaration. |