I'm trying to learn more about Object Orientated Programming.
I'm trying to create a class that represents a Conical object like in this image.
A : Connection diameter B : Diameter C : Height
But for me there are some differences when choosing a cone
1) Is the cone connection going to be larger than the diameter you have a expanding cone else a reduction cone. For this I created a read-only property based on an Enum that is set in the constructor. This is set while Creating the cone object and is fixed.
2) How do you want to dimension it. The image has 3 dimensions, but there is a forth one that is a angle. If the height is the leading dimension, the angle should be calculated, If the angle is a leading dimension the height should be calculated. Also for this I created a read-only property based on an Enum that is set in the constructor.
But how should I mark my properties? In one case the Height should be read-only and in the other the angle. How do you handle a situation such as this?
Public Class Cone Public ReadOnly Property ConeType As ConeTypeEnum Public Enum ConeTypeEnum kExpansion = 1 kReduction = 2 End Enum Public ReadOnly Property DimensionType As DimensionTypeEnum Public Enum DimensionTypeEnum kAngle = 1 kHeight = 2 End Enum Public Property Height As Double Public Property Diameter As Double Public Property ConnectionDiameter As Double Public Property Angle As Double Public Sub New(ByVal oConeType As ConeTypeEnum, ByVal oDimensionType As DimensionTypeEnum) ConeType = oConeType DimensionType = oDimensionType End Sub End Class