Visual Basic 2005 Structs

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
...