Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on .NET remoting
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00703774
Message ID:
00703970
Views:
13
>I'm 'guessing' (wildly guessing would be a better term) that by default, when we send up a dataset to a Web Service (and get one back), that's using MarshalByValue as the default. How would 'MarshalByRefObject' be more efficient?
>

Yes, look at the inheritance hierarchy of the DataSet Class.

DataSet parent = MarshalByValueComponent = makes a copy of the object on the client machine.

MarshalByRefObject uses a proxy/stub pair to invoke methods on an object running on a remote machine.

There are many issues to consider when remoting your objects. Take the scenario to its extreme. Imagine that you have a DataSet with a million rows. When you marshal by value you get all those rows copied to the client. If you want to update just one row, you would have to copy the whole dataset, make changes on the client, and then send the updated dataset back to the Web service. Of course you would never do this with a million rows. You would use small datasets and maybe only send changes back to the web service.

Instead, if you have a MarshalByRefObject with a method called UpdateColumn, for example, the client calls that method (invokes it remotely through the proxy) and just passes the new value to the remote object. The method gets executed on the remote machine which finds the row to change in the dataset and updates it. Obviously more efficient than sending a million rows.

Think of your WebService as one big remote object.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform