MobileObject infrastructure just for silverlight??

MobileObject infrastructure just for silverlight??

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


vdhant posted on Thursday, October 30, 2008

Hey guys
Just wanted to check if the MobileObject infrastructure was put in place just for silverlight or is it used by CSLA even in no n silverslight scenarios?
Cheers
Anthony

RockfordLhotka replied on Thursday, October 30, 2008

The IMobileObject interface exists to support the MobileFormatter, and that is currently used only by Silverlight.

MobileObject, MobileList and other base classes implement IMobileObject to simplify how CSLA .NET implements the interface. And you can use those base classes yourself to create serializable objects for use with the Silverlight data portal (though that's obviously an advanced scenario).

In CSLA .NET for Windows, none of the code in the MobileObject/etc classes should matter, because nothing would invoke IMobileObject methods.

In the future you can imagine other interesting ideas though. For instance, a version of CSLA .NET for .NET Compact Framework that uses MobileFormatter. A version of CSLA .NET for Windows Azure that uses the MobileFormatter. A version of CSLA .NET for Partial Trust Web Servers that uses the MobileFormatter.

I don't know that I'll do all (or any) of those. But the MobileFormatter addresses the single biggest roadblock to making CSLA work in most partial trust environments, and I rather suspect that my use of the BinaryFormatter or NetDataContractSerializer may slowly fade away in the future.

If that happens, then MobileObject and the related types become rather important in other environments :)

vdhant replied on Thursday, October 30, 2008

Thanks for the great info, that makes total sense...

Just a thought, have you done any performance tests of MobileFormatter vs BinaryFormatter or NetDataContractSerializer.

Cheers
Anthony

RockfordLhotka replied on Friday, October 31, 2008

No I haven’t. it isn’t entirely relevant, since neither of the .NET formatters are available in SL.

 

The one thing we DO know is that MobileFormatter can create very large XML streams. Behind the scenes it uses the WCF DataContractSerializer, which creates pretty verbose XML. The Silverlight data portal has hooks where you can plug in compression, and there’s a sample app showing how to do that (the idea came from a thread on this forum a few weeks ago).

 

Rocky

Copyright (c) Marimer LLC