Author: ElCapitan | Posted on: 6/8/2008 10:15:00 PM | Views : 275

 Hi all,
I am developing a project using 3-layer design and have a question about writing the code for the properties that represent the fields of a business object.
I have seen documentation where the property definition and 'Set' code is defined as types such as...
Public Property myProperty() As Date
Get
    Return FieldOfMyProperty
End Get
Set (value As Date)
    FieldOfMyProperty = value
End Set
End Property

I have also seen this done without the 'As Type' declaration. I would like to know which way is generally 'the best way of doing this'. With the property type defined, I believe i would have to do type conversions of a value before it gets Set such as myObj.myProperty = CDate("2008/12/12"). Without the type defined on the property, I assume it is an object and will need its type converted within the Set block. Such as...
Set (value)
...

Go to the complete details ...