J
JD
Obviously, JD1 is more encapsulated! Look at the code below. I can do this
change within the class and the logic in Main does not change at all! If I
need to do this with JD2, then I have to change the code in the class *and*
the code in Main. This is a perfect example of encapsulation in a class.
<CODE>
Private myvalue1a As String
Private myvalue1b As String
Friend Property JD1() As String
Get
Return myvalue1a + myvalue1b
End Get
Set(ByVal Value As String)
Dim SA() as String = Value.Split(":")
myvalue1a = SA(0)
myvalue1b = SA(1)
End Set
End Property
</CODE>
change within the class and the logic in Main does not change at all! If I
need to do this with JD2, then I have to change the code in the class *and*
the code in Main. This is a perfect example of encapsulation in a class.
<CODE>
Private myvalue1a As String
Private myvalue1b As String
Friend Property JD1() As String
Get
Return myvalue1a + myvalue1b
End Get
Set(ByVal Value As String)
Dim SA() as String = Value.Split(":")
myvalue1a = SA(0)
myvalue1b = SA(1)
End Set
End Property
</CODE>