Monday, 19 August 2013

Using a Public Property AND a Public Field

Using a Public Property AND a Public Field

Where I work, using Properties are discouraged. We have code generation
tools to "speed things up". All object data ends up being Public fields.
If you request properties anyway, you get something like this:
Public sFoo as String
Public Property Foo as String
Get
Return sFoo
End Get
Set(ByVal value as String)
sFoo = value
End Set
End Property
I can't think of a reasonable argument to do this. Are there any good
reasons to use both a Public Property with a Public Field?

No comments:

Post a Comment