Abstract Classes and ReadOnly Properties
- by serhio
Let's have three classes;
Line
PoliLine
SuperPoliLine
for all that three classes a Distance is defined.
But only for the Line a Distance can be Set.
Is there a possibility to build a common abstract (MustInherit) class Segment, having a Distance as (abstract +? ReadOnly) member?
Question for VB.NET, but C# answers welcomed too.
Business Background
Imagine a Bus. It has a lot of Stations, MainStations, and 2 TerminalStations. So Line is between 2 Stations, PoliLine is between 2 MainStations, and SuperPoliLine is between 2 TerminalStations. All "lines" are "Segments", but only the distance A-B between 2 stations - Line can be defined.