CSLA Silverlight?

CSLA Silverlight?

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


JonM posted on Monday, March 17, 2008

Has anyone tried any CSLA with the new silverlight 2.0 beta 1?  I realize that silverlight is a small subset of .NET (like the Compact Framework).   I think it would be great to get CSLA objects in silverlight that talk to a wcf dataportal.  Then the wcf dataportal on server end could talk to the real database and perhaps rerun the validation rules.  Also, it would be great if the CSLA could support both dataportals inside of its framework.  One dataportal over wcf from the client to the server.  Then another dataportal that optionally revalidates business rules and talks to the real datastore (probably MSSQL).

RockfordLhotka replied on Monday, March 17, 2008

I've done quite a bit of research in this area, and the roadmap includes creation of CSLA Light for use on Silverlight.

Actually implementing CSLA Light requires a hole in my (currently) ridiculously overbooked schedule, but it will happen Smile [:)]

There are numerous issues. Obvious ones like the lack of BinaryFormatter/NetDataContractSerializer will cause some big limitations/changes. Non-obvious ones like the lack of System.Collection.Generic.Stack are inconveniences, but take time to overcome.

Certainly it takes quite a few hours of work to trim out and/or replace enough code to even get something to compile. And I have yet to get something that really works in practice - but that was all pre-Beta 1.

Silverlight Beta 1 includes more functionality that I expected, but still is missing quite a lot of stuff from full .NET, so it is a non-trivial exercise.

My goal, as I've stated in my blog, is to keep the business class structure/code as close to full CSLA as possible - even if some functionality isn't quite the same behind the scenes. For example, the data portal will almost certainly be different, but I plan to keep the same coding structure for interacting with the data portal to make it as easy as possible to move business code to/from .NET and Silverlight.

JoeFallon1 replied on Tuesday, March 18, 2008

Rocky,

I am very interested in how you envision CSLA will be used in Silverlight. Could you provide a high level overview of how you perceive the interactions at the various levels?

e.g. The Web Server has normal CSLA BOs which contact the DB through the DataPortal. Then a request comes in and a "Silverlight page" is sent to the user. What happens then? Is the CSLA light BO created with the page and sent along to provide client side validation? What if there are validation rules which hit the DB? What else are you thinking about?

Thanks for any insight.

Joe

 

JonM replied on Tuesday, March 18, 2008

Rocky,

Your plan sounds great.  A light version would probably do the trick.  I didn't realize generics were missing.  That is a real hassle.

Thanks,

Jon

RockfordLhotka replied on Tuesday, March 18, 2008

Generics aren’t missing – just some (many) generic types. And many other types. I just threw out Stack<T> as an example to illustrate that this is a subset of .NET. There are over a dozen .NET types I need to recreate (or work around their absence) to port CSLA.

 

That’s OK – to be expected – but the point being that there’s some effort involved, and it really will be a different version of CSLA.

 

Rocky

 

 

From: JonM [mailto:cslanet@lhotka.net]
Sent: Tuesday, March 18, 2008 9:04 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA Silverlight?

 

Rocky,

Your plan sounds great.  A light version would probably do the trick.  I didn't realize generics were missing.  That is a real hassle.

Thanks,

Jon



Copyright (c) Marimer LLC