Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are 'by ref' arguments in WCF bad or good?

I've recently seen a WCF service declaring operation contracts with by ref arguments.

I don't know why this design decision was taken (operations are void), but furthermore, I'm not able - from my WCF knowledge - to say if this is a good practice or not. Or if this is not relevant.

What do you think?

like image 257
MatteoSp Avatar asked Dec 24 '09 00:12

MatteoSp


Video Answer


1 Answers

However, According to this Microsoft Article a WCF Call behaves exactly like a Remote Procedure Call and ByRef arguments can be used to return data:-

http://msdn.microsoft.com/en-us/library/ms733070.aspx

Refer to the section: Out and Ref Parameters

In most cases, you can use in parameters (ByVal in Visual Basic) and out and ref parameters (ByRef in Visual Basic). Because both out and ref parameters indicate that data is returned from an operation, an operation signature such as the following specifies that a request/reply operation is required even though the operation signature returns void.

like image 121
HainesyP Avatar answered Sep 18 '22 11:09

HainesyP