Difference between properties and get/set method in .net
Difference between properties and get/set method in .net
Properties
Properties represent data.
Properties can easily ? for using the XML serializer
Properties should behave as if they are fields
Retrieving a field’s value does not produce any side effects.
Method
Methods perform actions
Method can’t easily ? use the XML Serialise using get / set methis
The method performs a time-consuming operation. The method is perceivably slower than the time it takes to set or get a field’s value.
The method performs a conversion. Accessing a field does not return a converted version of the data it stores.
The “Get” method has an observable side effect
Calling the method twice in succession creates different results.
The method is static but returns an object that can be changed by the caller. Retrieving a field’s value does not allow the caller to change the data stored by the field.
The method returns an array.

