Hi ste,
"steve" <a@b.com> schrieb:
so what you're saying herf, is that vb doesn't define scope and interface
access correctly...since most other oop languages do give access to
traversing underlying classes...i.e. "::" ?
In VB.NET, C#, and Java access is resticted to the direct base class to
prevent inconsistencies in an object's state. Consider this sample:
\\\
Public Class A
Private m_Sum As Integer
Public Overridable Sub Add(ByVal Number As Integer)
m_Sum += Number
End Sub
End Class
Public Class B
Inherits A
Private m_Checksum As Integer
Public Overrides Sub Add(ByVal Number As Integer)
MyBase.Add(Number)
m_Checksum = ...
End Sub
End Class
Public Class C
Inherits B
' Objects of type 'C' are objects of type 'B' too. 'B' guarantees
' that the checksum will be set properly. If there was a way to
' call 'A''s 'Add' method directly, the checksum set in 'B' would
' not be updated and thus the class' state would be inconsistent.
End Class
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>