Is the below code a good way to store data in classes?
I have propetie get set classes, and a constructor to quickly set them all.
The only concern I have is that the byval in the constructor class and the byval in the set() properties, might be inefficient because the parameter is copied twice? Should I use ByRef? Or is that too dangerous?
Code:'Config data for an Environment. Public Class Environment Private msEnvName As String Private msRegionCode As String Private msDBName As String Private msDBAddress As String Private msDBRegion As String Public Sub New(ByVal lsEnvName As String, ByVal lsRegionCode As String, ByVal lsDBName As String, ByVal lsDBAddress As String, ByVal lsDBRegion As String) Me.EnvName = lsEnvName Me.RegionCode = lsRegionCode Me.DBName = lsDBName Me.DBAddress = lsDBAddress Me.DBRegion = lsDBRegion End Sub Public Property EnvName() As String Get Return msEnvName End Get Set(ByVal value As String) msEnvName = value End Set End Property Public Property RegionCode() As String Get Return msRegionCode End Get Set(ByVal value As String) msRegionCode = value End Set End Property Public Property DBName() As String Get Return msDBName End Get Set(ByVal value As String) msDBName = value End Set End Property Public Property DBAddress() As String Get Return msDBAddress End Get Set(ByVal value As String) msDBAddress = value End Set End Property Public Property DBRegion() As String Get Return msDBRegion End Get Set(ByVal value As String) msDBRegion = value End Set End Property End Class




Reply With Quote