Mobile Object

Mobile Object

Old forum URL: forums.lhotka.net/forums/t/9034.aspx


Harmanjeet posted on Friday, June 04, 2010

Hi! Rocky

What's the any real practical scenario, where we need to pass mobile objects as a reference type as a parameter to other methods.

 

regards

Harmanjeet

 

RockfordLhotka replied on Friday, June 04, 2010

When you pass any object (string, Guid, Customer, etc) to a method it is always pass by reference. Object instances are always passed by reference in .NET, end of story. Given that, there are countless practical scenarios where you "pass an object" as a parameter to a method Big Smile

But I suspect that's not the intent of your question. Unfortunately I can't figure out what you are asking, can you please clarify?

Harmanjeet replied on Sunday, June 06, 2010

Hi! Rocky

I asked the above Question in the context of Mobile Object. Were, do we need them to pass as reference instead of Value, in real pratical scenario.

not the generic concept of Pass by Value/Reference.

 

regards

Harmanjeet

 

RockfordLhotka replied on Monday, June 07, 2010

There is no way to pass an object over the network by reference. Objects are copied or cloned across the network, so you always end up with a different instance of the object on the other machine. Read chapter 1 of the Expert Business Objects book for information on this.

Some technologies, like .NET Remoting, simulate passing objects over the network by reference. That is really not "by reference" - they are simulating the concept. CSLA has never used or supported that concept, which is good because that idea doesn't work in web services or (without some effort) WCF.

Harmanjeet replied on Monday, June 07, 2010

Hi!

thanks for reply.

i am satisfied with answer.

 

regards

Harmanjeet

 

Copyright (c) Marimer LLC