Compact Framework 2.0 and CSLA

Compact Framework 2.0 and CSLA

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


joriente posted on Tuesday, June 13, 2006

Hi All,

Has anyone tried to see if there are any limitations to using CSLA on a device, given the the compact framework now supports xml serialization.

Thanks,

John

RockfordLhotka replied on Tuesday, June 13, 2006

As it stands, CSLA .NET can't run on .NET CF because it uses advanced reflection (which might be in the latest CF, but I don't know for sure), and it uses the BinaryFormatter - which is conceptually totally different from the XmlSerializer.

If you drop the data portal you'd end up with something that would probably run on CF, since that's where the real issues are to be found. That prevents the use of the mobile object concept - but honestly that's not a good idea from a mobile device anyway (isn't that funny? mobile objects are bad on mobile devices? Wink [;)])

The reason they aren't good though, is because a mobile app should be written to be occassionally connected, and that's not what mobile objects are trying to solve. Instead, you should build the app to use a local data store of some sort and then sync that with a server when available. In that case, the subset of CSLA (dropping the data portal) should be quite practical.

dclavey replied on Wednesday, January 03, 2007

With the advent of WiFi and GPRS, there are now a lot of Mobile applications written to be occassionally dis-connected, rather than ocassionally connected. I could imagine that some non-mobile client machines could also work in an occassionally dis-connected environment.

Do you know of any links to sites working on Business Objects for a Compact Framework? I am very interested because there is a need to seperate the Presentation / UI from the Business Logic because we have to support different GUI front ends (e.g. Phone with no touch screen, Pocket PC with different screen sizes, and other bespoke machines)

Baring that I will try creating a CF version with dropped data portal. I always use a local data store anyway. (UltraLite from iAnywhere).

David - A mobile developer!

cmellon replied on Thursday, January 04, 2007

Hi All,

It is possible to use CSLA on CF, but as rocky and others have mentioned u need to drop the Dataportal.

Apart from that and few minor changes I had to make I got a cut down version of CSLA running fine on the PDA and its fantastic being able to develop this way on the PDA.  With new version of SQL Mobile and .Net 2.0 Mobile developments getting much better.

It only took me a day or 2 to strip the framework down so I would highly recommend other people to do it as its well worth the effort.

Unfortunately I can't share the code as it has a lot of modifications for our company and specific to our mobile framework and it would take me too long to work through and take our stuff out, however as I mentioned above its not a big task and well worth doing.

We have been running the framework on mobile 5 devices for the last 6 months or so and it works great.

Regards

Craig

dclavey replied on Tuesday, January 09, 2007

Couple of Questions:

With your stipped down version for CF, have you been able to share the object on both CF .NET and standard .NET (PC)?

When you say it took a day or two, did the compiler VS2005 point out all the problems. Or were there runtime issues as well.

David

cmellon replied on Tuesday, January 09, 2007

Hi All,

Please find attached my cut down version of CSLA for the mobile framework.

I did get a few errors during runtine which I just worked through and fixed. 

Regarding wether the objects work on the PC and Mobile, its not something I have tried, but I haven't implemented any serialization in this framework, so how you would get the object over to the PC i'm not sure. 

When I started todo this it was purley so that I could use CSLA's Validation, IsDirty/IsNew, Collections and databinding functionality on the Mobile Devices. And in my eyes I have succeded as I can now develop business libraries in a similar way to the PC but in the mobile development environmnet.

I have a couple of project running with this framework and they work great and as expected.  Theres no n-level undo or anything but I never used that anyway.

Feel free to use this code, this is the original verison of the framework I did, without our company specific stuff in.  I'm not sure which version of CSLA its based on unfortunately, but I know it was before 2.1 so none of the new stuff is included.  I'm more the willing to let people use this code and think it would be a great idea if we could share this code so people could maybe contribute/improve in the future and theres a central place for people to get it.

Hope this is useful.

http://craigmellon.co.uk/files/folders/general_files/entry11168.aspx

Craig

RRorije replied on Wednesday, January 10, 2007

Hi Craig,

thank you VERY much.

I will look into it, when I have the time. It sounds very promosing, untill now I used a framework I created myself. But this was very limited.

This most certainly will be much better.

dclavey replied on Thursday, January 11, 2007

Craig

Big Smile [:D] Nice work - excellent.

Thanks for the download Wink [;)]

David

brembot replied on Thursday, January 11, 2007

Craig, Excellent Job. Cool [H]

Cheers,
Marlon

Kahn replied on Monday, October 23, 2006

See here: http://forums.lhotka.net/forums/post/1738.aspx

Copyright (c) Marimer LLC