IMobile Object and CSLA .net CE

IMobile Object and CSLA .net CE

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


cmellon posted on Sunday, July 06, 2008

Hi All,

Nice to see someone put the CSLA CE project on the main website.  I've not had a look at it yet, but interested to see how it was implemented.  I don't know if anyone has seen my version but I created a windows mobile version of CSLA some time ago. http://craigmellon.co.uk/blogs/a-better-set-of-controls/archive/2007/01/09/Mobile-Framework-_2800_CSLA_2900_.aspx

My version didn't have any Undo, but had Business Rules, Validation, etc.

The reason for my post is that with the new IMobileObject interfaces rocky is implementing for Silverlight we should be able to make use of them for the CE version which would enable undo and serialization of the business objects.

Has anyone had a look into this yet?

Regards

Craig

 

RockfordLhotka replied on Monday, July 07, 2008

There's some hope (on my part anyway) that CSLA Light will (with minimal effort) just work in .NET CF. Since the CSLA Light implementation uses only public reflection and doesn't require the BinaryFormatter, the primary roadblocks for CF are already eliminated.

The question is how similar the CF and SL are to each other in terms of all the other little features of .NET. Specifically, how many are in SL and not CF, because those would be the challenging ones.

Certainly I expect some of the UI support in CSLA Light (which is obviously targeted at XAML) to be pretty useless in a CF setting - most notably around ObservableCollection<T>, which I assume is not in CF.

And I don't know if there's a comparable subset of WCF in CF (as compared to SL)? The CSLA Light data portal supports Local and WcfProxy modes - but does use an adapter pattern, so a CF-compliant plug-in could be created.

However, CSLA Light does make heavy use of the WCF DataContractSerializer, and it would be difficult to port the MobileFormatter without at least the DCS existing. Maybe, just maybe, the XmlSerializer could be made to work instead in necessary.

Of course the whole point could become moot if Silverlight spreads onto mobile devices. There's already movement in that area for phones and PDAs. Perhaps the best possible outcome in some ways, would be if CF was slowly replaced by Silverlight as the dominant target runtime for mobile device apps :)

Teebs replied on Wednesday, August 27, 2008

I've been using CSLA on a number of projects over the last two years. One of them was Using a Symbian Client to talk to the WebServiceHost. This got me thinking that if we were using Windows Mobile or CE it would be a lot more easy. So I got my self a WM5 Smartphone and started to try. It was not as easy as I thought.

After a lot of strugle and headache I now have a CslaWm which works on WM5. It has validation, Authentication and Undo. I have writtten the ProjectEdit screen and it seems to work.

I based my code in CSLA 3.0 and CSLA CE

The approach I took was to write my own BinarySerializer based on the AltSerializer which you can find on the Web. Because of differences in the order items are reflected I serialize into the stream the field names.

The responce is quite reasonable.

The logik for Applying the Authentication is currently in a base class which ProjectEdit inherits from using the Hook method you described for an earlier problem with re displaying the Binding Control. I have also used this method for the re display of the binding control. I have not yet worked out how to do extender components in NETCF but I have read an article on MSDN about converting a DeadlyControl (see WEB) but could not get it to work for me. If any one has done this I would love to see an example.

If any one wants to discus this further or has any questions please respond

 

Copyright (c) Marimer LLC