|
Posted by Laurie on May 17, 2007, 11:43 am
Please log in for more thread options
Hello,
This is probably more of a design question rather than a specific question
about vb6.
I’m creating a class module with a number of property let and property get
variables. The property let variables are used in a fairly complex spring
formula and the output will be property get variables.
e.g.
Public Property Let TubeODInMM(TubeODInMM As Single)
vTubeODInMM = TubeODInMM
End Property
Public Property Let CurtainSectionThkInMM(CurtainSectionThkInMM As Single)
vCurtainSectionThkInMM = CurtainSectionThkInMM
End Property
Public Property Let CurtainWidthInMM(CurtainWidthInMM As Single)
vCurtainWidthInMM = CurtainWidthInMM
End Property
Public Property Get TorqueClosed()
TorqueClosed = vTorqueClosed
End Property
Public Property Get TorqueOpened()
TorqueOpened = vTorqueOpen
End Property
Public Property Get RadiusClosed()
RadiusClosed = vRadiusClosed
End Property
Public Property Get RadiusOpened()
RadiusOpened = vRadiusOpened
End Property
From a design point of view, is it better to let the user of the object set
the input properties; execute a GetSpring() method and then read the output
properties .e.g.
Dim objSpring as New clsSpring
ObjSpring.TubeODInMM=127
ObjSpring.CurtainWidthInMM =2400
Etc.
ObjSpring.GetSpring()
VRadiusClosed= ObjSpring.RadiusClosed
VRadiusOpened= ObjSpring.RadiusOpened
Etc.
or set the input properties and automatically run internally in the object
the GetSpring() procedure when the user selects a output property e.g.
Dim objSpring as New clsSpring
ObjSpring.TubeODInMM=127
ObjSpring.CurtainWidthInMM =2400
Etc.
VRadiusClosed= ObjSpring.RadiusClosed
VRadiusOpened= ObjSpring.RadiusOpened
Etc.
Inside the class
Public Property Get TorqueClosed()
Call GetSpring()
TorqueClosed = vTorqueClosed
End Property
Thanks
|