Exposing operations instead of objects
If all you are doing is exposing an object instance that is relevant to the state of the current object you should use a property.
A method should be used when you have some logic that is doing more than accessing an in memory object and returning that value or when you are performing an action that has a broad affect on the state of the current object.
Does it make any sense in use?
-2
Please sign in to leave a comment.
Comments
0 comments