Data Access, Properties, and Methods
- slide 26 : 29
Use of ref and out parameters in OOP
How useful are reference and output parameters in object-oriented programming?
Public methods with two or more pieces of output
Use a number of
out
parameters
Mutate objects passed by value parameters
Aggregate the pieces of output in an object and return it
Assign the output to instance variables which subsequently can be accessed by the caller
ref
and
out
parameters are relatively rare in the C# standard libraries