CSLA .NET 3.0 Beta 1 available

CSLA .NET 3.0 Beta 1 available

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


RockfordLhotka posted on Monday, May 21, 2007

I have made CSLA .NET 3.0 Beta 1 available for download from the CSLA download page.

The changes in CSLA .NET version 3.0 are primarily focused on adding support for .NET 3.0 features: specifically WCF and WPF. No extra work was required to allow business objects to invoke WF workflows or to be used from activities in a WF workflow. There are also some very important bug fixes and feature enhancements that most people will want even when not using .NET 3.0.

There are no major or intentional breaking changes from version 2.1.4 to version 3.0.

CSLA 3.0 will work on .NET 2.0. You do not need .NET 3.0 to use this version. Obviously the WCF/WPF/WF features are only available to you if you have .NET 3.0.

The WCF support comes in two forms: a data portal channel, and comprehensive support for the DataContract/DataMember attributes. The data portal support comes in the form of a new data portal proxy, which is functionally equivalent to the CSLA 2.0 channels. In other words, upgrading to WCF is entirely transparent. The DataContract support is an optional configuration switch you can set in app.config/web.config to tell CSLA to use the WCF serializer rather than the BinaryFormatter. This affects n-level undo and cloning. If you want to use DataContract instead of Serializable on your business classes you must use this config switch.

The WPF support comes as a set of controls. These controls provide support for validation (like the Windows Forms ErrorProvider), authorization and a couple other key features. There is also a CSLA data provider control, allowing the creation of codeless XAML forms in some cases (for read-only data).

In addition to the .NET 3.0 support, there are some other functional enhancements to various areas. Here are some highlights:

  1. Validation RuleArgs are now more sophisticated, allowing for more expressive human-readable rule descriptions, and providing a better model for code generators when specifying arguments to be passed into a rule method.
  2. A number of bugs in BusinessListBase related to data binding scenarios have been fixed. Event handling for other list classes has been standardized as well. You will likely find that data binding to grids is much more reliable in 3.0 than in 2.1.4.
  3. SmartDate has some minor enhancements and bug fixes.
  4. N-level undo now detects when edit levels are out of sync and throws an exception. This helps locate and debug problems where nested begin/cancel/apply calls are out of order. While this feature will most likely cause some short-term pain as you find these issues, the result is that your code will behave properly.

For the complete list of changes, see the change log.

My plan is to leave this beta online for 2-3 weeks, followed by a second beta in mid-June and a release at the end of June. If you plan to move to CSLA .NET 3.0 within the next few months, please consider downloading and testing this beta. Let me know about any issues you find so I can resolve them for Beta 2.

Brian Criswell replied on Tuesday, May 22, 2007

Thanks, Rocky. I have been using the last alpha version for a couple of weeks now and will give this a go.  Did you see my PM about resetting DataContext and object.Equals overrides?

Jimbo replied on Tuesday, May 22, 2007

Many of us will be in .net 2 for a long while yet.
The change log for csla 3 identifies some important areas that I would think can be included in ongoing  csla 2 revisions. The most important seem to be are the very shaky nLevel undo and windows binding issues. Next comes the handling of nullables. ( is there going to be some fixes for Object Adapter ?) etc.
or is 2.1.4 the end ?

Jimbo
 



RockfordLhotka replied on Tuesday, May 22, 2007

CSLA 2.1.4 is the end of CSLA 2.x.

 

But please note that CSLA 3.0 does work on .NET 2.0.

 

You do not need .NET 3.0 to use CSLA 3.0.

 

I can’t afford to maintain two versions of the same code just to keep a version number in sync with .NET, but I can do what Microsoft did and make the .NET 3.0 changes purely additive.

 

I thought I made this clear in the original post – but if not, hopefully it is clear now J

 

Rocky

 

From: Jimbo [mailto:cslanet@lhotka.net]
Sent: Tuesday, May 22, 2007 7:09 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA .NET 3.0 Beta 1 available

 

Many of us will be in .net 2 for a long while yet.
The change log for csla 3 identifies some important areas that I would think can be included in ongoing  csla 2 revisions. The most important seem to be are the very shaky nLevel undo and windows binding issues. Next comes the handling of nullables. ( is there going to be some fixes for Object Adapter ?) etc.
or is 2.1.4 the end ?

Jimbo


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 5/21/2007 2:01 PM

RockfordLhotka replied on Tuesday, May 22, 2007

Jimbo:

Next comes the handling of nullables.

What do you think CSLA can do to help with nullable types?

I realize ObjectAdapter needs some help (in general actually), but building business objects that have Nullable<T> properties and/or fields works today as far as I know. If there are specific things that can help support Nullable<T> I'm open to considering them.

It is important to realize however, that version 3.0 is now locked. I'm only doing bug fixes for 3.0, and anything beyond that (including reworking ObjectAdapter) will be in a later version.

DansDreams replied on Thursday, May 24, 2007

RockfordLhotka:

I realize ObjectAdapter needs some help (in general actually), but building business objects that have Nullable<T> properties and/or fields works today as far as I know. If there are specific things that can help support Nullable<T> I'm open to considering them.

Yes, I have a few DateTime? properties and a few strings where I preserve database nulls, and they do indeed work fine. 

I did need to tweak my CustomDataReader to add a couple of methods GetStringNullable() and GetDateTimeNullable(), since part of the purpose of the original SafeDataReader was to shield the business objects from null database values. 

Rocky, I guess you couuld throw those into the SafeDataReader at some point if you wanted to round it out for handling nulls.  (Even in this case, the SafeDataReader (or my customization of it) does provide a useful thing in allowing the use of column names instead of ordinal positions.)

RockfordLhotka replied on Thursday, May 24, 2007

DansDreams:

I did need to tweak my CustomDataReader to add a couple of methods GetStringNullable() and GetDateTimeNullable(), since part of the purpose of the original SafeDataReader was to shield the business objects from null database values. 

Rocky, I guess you couuld throw those into the SafeDataReader at some point if you wanted to round it out for handling nulls.  (Even in this case, the SafeDataReader (or my customization of it) does provide a useful thing in allowing the use of column names instead of ordinal positions.)

I don't think I'll do that. The purpose of SafeDataReader is to de-null things. It really shouldn't be used if you actually want null values.

What I could see doing is creating a second datareader wrapper that only added the column name translation. Then SafeDataReader could inherit from that or something.

Blarm replied on Thursday, May 24, 2007

Rocky,

Have you had any chance to look at the DataMapper/FormView/Nullable problem as per item 23 of your Feature Wish List and http://forums.lhotka.net/forums/thread/11921.aspx 

Thanks,

Bill

RockfordLhotka replied on Thursday, May 24, 2007

No, unfortunately not yet…  That’ll have to wait for a future release.

 

From: Blarm [mailto:cslanet@lhotka.net]
Sent: Thursday, May 24, 2007 11:21 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA .NET 3.0 Beta 1 available

 

Rocky,

Have you had any chance to look at the DataMappewr/FormView/Nullable problem as per item 23 of your Feature Wish List and http://forums.lhotka.net/forums/thread/11921.aspx 

Thanks,

Bill



dg78 replied on Thursday, May 24, 2007

Hi Rocky,

 

I tried to use CSLA 3.0 but without WCF and WPF (I don’t install  .net 3.0).

 

It easy to remove (or exclude of the Csla Project) all codes due to WCF because the name of the files include WCF  or Wpf : (WcfProxy.vb, WcfPortal.vb, IWcfPortal.vb) or it is a directory : \DataPortal\Hosts\WcfChannel or \Wpf.

 

But there is one file : \Serialization\NetDataContractSerializerWrapper which is used with Wcf  (it use NetDataContractSerializer which is part of .net 3.0).

Perhaps it will be good if there is Wcf inside the file name.

 

I need also to put a ‘ before Return New NetDataContractSerializerWrapper()

In \Serialization\SerializationFormatterFactory.vb

 

Cheers

 

Dominique

RockfordLhotka replied on Thursday, May 24, 2007

Yes, that’s a good point – while you can build the full thing and still run it under 2.0, you can’t actually build without the 3.0 runtime installed…

 

I can address that with compiler directives. I hate to do that, as the code starts to get messy, but it may be the only realistic solution…

 

Rocky

 

From: dg78 [mailto:cslanet@lhotka.net]
Sent: Thursday, May 24, 2007 4:32 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: CSLA .NET 3.0 Beta 1 available

 

Hi Rocky,

 

I tried to use CSLA 3.0 but without WCF and WPF (I don’t install  .net 3.0).

 

It easy to remove (or exclude of the Csla Project) all codes due to WCF because the name of the files include WCF  or Wpf : (WcfProxy.vb, WcfPortal.vb, IWcfPortal.vb) or it is a directory : \DataPortal\Hosts\WcfChannel or \Wpf.

 

But there is one file : \Serialization\NetDataContractSerializerWrapper which is used with Wcf  (it use NetDataContractSerializer which is part of .net 3.0).

Perhaps it will be good if there is Wcf inside the file name.

 

I need also to put a ‘ before Return New NetDataContractSerializerWrapper()

In \Serialization\SerializationFormatterFactory.vb

 

Cheers

 

Dominique



JoeFallon1 replied on Thursday, May 24, 2007

Rocky,

Please do NOT add compiler directives!

It is not unreasonable that a Developer has .Net 3.0 installed so they can compile CSLA 3.0. They cna then run it on a .Net 2.0 platform if they wish.

Joe

 

RockfordLhotka replied on Thursday, May 24, 2007

If I _do_ decide to do directives, 3.0 would be the default. In other words, only people without 3.0 on their dev boxes would need to do any work.

 

But I’m really not keen on the directive idea. It is a rat’s nest, because 3.5 is just months away, and it could get way too messy…

 

Rocky

 

From: JoeFallon1 [mailto:cslanet@lhotka.net]
Sent: Thursday, May 24, 2007 4:55 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: RE: CSLA .NET 3.0 Beta 1 available

 

Rocky,

Please do NOT add compiler directives!

It is not unreasonable that a Developer has .Net 3.0 installed so they can compile CSLA 3.0. They cna then run it on a .Net 2.0 platform if they wish.

Joe

 



ianinspain replied on Friday, May 25, 2007

Hi Rocky,

do you plan on releasing a how to update from 2.1 to 3.xx as pdf or something?

Just interested

Thanks


RockfordLhotka replied on Friday, May 25, 2007

I’m still  trying to decide whether it makes the most sense to write Expert VB/C# 200x Business Objects to cover 3.0 and 3.5 together, or to do a CSLA .NET Version 3.0 Handbook and a CSLA .NET Version 3.5 Handbook in pdf form.

 

The latter would come out quicker each, but the former would be more comprehensive (probably).

 

However, the issue with the Expert Business Objects book approach is that CSLA has gotten too big to fit into the existing book structure. So a 200x book would almost certainly have to drop Windows Forms, ASP.NET and Web services in favor of WPF, WF and WCF – and maybe AJAX and maybe Silverlight. It is a real challenge to scope this thing…

 

I think I’ll probably put up a poll here on the forum to see what people think J

 

Rocky

 

 

From: ianinspain [mailto:cslanet@lhotka.net]
Sent: Friday, May 25, 2007 11:46 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: RE: RE: CSLA .NET 3.0 Beta 1 available

 

Hi Rocky,

do you plan on releasing a how to update from 2.1 to 3.xx as pdf or something?

Just interested

Thanks




MBonner replied on Friday, May 25, 2007

You might consider multiple .pdf's with specific scopes i.e. one pdf covering winform, asp.net, web services, another covering the WxF's, and a supplemental pdfs for AJAX and Silverlight?  Or possibly change the focus i.e. one pdf covering dataportal topics with both web services/remoting/WCF, another covering web front-end topics ASP.NET/AJAX/Silverlight, and a supplement for the workflow and any other topics that don't easily fit with the other two.

I'd certainly be willing to buy and get work to buy more than one .pdf version, and then you could kind of mix and match what you needed. 

-- Mike :-)

lefty replied on Friday, May 25, 2007


There are those of us that work for companies where the standardized desktop is still Windows 2000.  I don't have a system that I can install .NET 3.0 on in order to compile CLSA 3.0.   I would prefer compiler directives to nothing.


david.wendelken replied on Friday, May 25, 2007

RockfordLhotka:

Yes, that’s a good point – while you can build the full thing and still run it under 2.0, you can’t actually build without the 3.0 runtime installed…

I can address that with compiler directives. I hate to do that, as the code starts to get messy, but it may be the only realistic solution…

Some developers work in secured environments where new versions of the operating system, .net framework, etc., have to go thru a security test before they can be deployed.  This can delay adoption of new stuff by a year or more, not counting the usual FUD factor (Fear, Uncertainty and Doubt) that management may apply. :(

Csla, being code that we "write" and compile, isn't a problem. :)

For some folks, using the new release of Csla 3.x won't be an option if it cannot compile against .net 2.x

Personally, I don't mind having to remove a set of files from the deliverable.  Or even commenting out specific lines of code in the files, as long as they are clearly identified.

Obviously, compiler directives would be simpler for folks in a secured environment.  But being able to do it without .net 3.0 installed on the developer machine can be a deal breaker.

 

 

RockfordLhotka replied on Tuesday, June 12, 2007

I have decided (for better or worse) to go with a NET20 compiler symbol. If this is defined, then all the .NET 3.0 stuff is automatically removed from the build, allowing the project to be built on a machine where the .NET 3.0 runtime is not installed.

The default is to include the .NET 3.0 features.

This change is in svn, and will be in Beta 2 - which I expect to post later this week.

RockfordLhotka replied on Tuesday, May 22, 2007

No, I didn’t – can you repeat them on this thread?

 

Thanks - Rocky

 

From: Brian Criswell [mailto:cslanet@lhotka.net]
Sent: Tuesday, May 22, 2007 7:08 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA .NET 3.0 Beta 1 available

 

Thanks, Rocky. I have been using the last alpha version for a couple of weeks now and will give this a go.  Did you see my PM about resetting DataContext and object.Equals overrides?


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 5/21/2007 2:01 PM

Brian Criswell replied on Tuesday, May 22, 2007

I saw a blog post regarding how DataContext uses object.Equals to determine if you are setting it to a different object and it should update.  So this.DataContext = obj.Save() might have problems if you have GetIdValue return the real id of the object.
http://kentb.blogspot.com/2007/03/beware-datacontext-and-equals.html
If you were aware of this, do you have any strategies to work around it?

RockfordLhotka replied on Tuesday, May 22, 2007

Well, hmm. You are correct, in that ProjectTracker is busted.

 

The most obvious strategy is to do exactly as recommended and set DataContext to null/Nothing before resetting it to the object.

 

Rocky

 

 

From: Brian Criswell [mailto:cslanet@lhotka.net]
Sent: Tuesday, May 22, 2007 3:51 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: CSLA .NET 3.0 Beta 1 available

 

I saw a blog post regarding how DataContext uses object.Equals to determine if you are setting it to a different object and it should update.  So this.DataContext = obj.Save() might have problems if you have GetIdValue return the real id of the object.
http://kentb.blogspot.com/2007/03/beware-datacontext-and-equals.html
If you were aware of this, do you have any strategies to work around it?


Brian Criswell replied on Wednesday, May 23, 2007

One thing I was thinking about is having all objects return a unique Guid for GetIdValue().  This would work for this situation, but object.Equals would have a little less meaning (in that objects of the same type with the same id would not be equal, which is what I have done previously).
Anyway, it is by no means a deal breaker, and CSLA allows you to target either strategy.  It just means that you have to know the pros and cons of each and make a choice.  Thanks for making a flexible framework, Rocky.

RockfordLhotka replied on Tuesday, May 22, 2007

Brian Criswell:
Thanks, Rocky. I have been using the last alpha version for a couple of weeks now and will give this a go.  Did you see my PM about resetting DataContext and object.Equals overrides?

I did see the PM.

I never even noticed the issue, because in Windows Forms you have to set the BindingSource.DataSource to Nothing/null to reset it as well. So when I wrote my WPF code I just did the same thing - by habit I suppose...

Brian Criswell replied on Friday, May 25, 2007

Hi Rocky,

In the release announcement in your blog, I noticed you mentioned "back button issues."  What were those issues?

RockfordLhotka replied on Friday, May 25, 2007

There are two basic ways to build a WPF app: page model or windows model.

 

In the page model your forms (pages) are loaded in a browser – called a navigation window. There are a couple navigation windows: one that hosts in IE and one that hosts natively in Windows. There’s also the Frame control that can act as a navigation window.

 

In all those cases, the nav window provides a history journal, along with back/forward buttons. Also, navigation works differently depending on whether you use link-style navigation, or create-a-page-object-and-navigate-to-it style navigation.

 

In general, however, you can’t count on page instances sticking around. In link-land they are discarded when the user leaves. In instance-land they stick around.

 

In no case (that I can find) can you navigate to a SPECIFIC page in history. You can only (through the API) go back one or forward one.

 

So in my case, you load the ProjectEdit page, and it stays in memory (instance-model). The user can always go back there, and use that instance. But since I can’t get back there programmatically, then next time you want to edit that same project, you get a NEW ProjectEdit page instance. Now there’s a sync issue between them. Total PITA.

 

I’ve thought up a couple solutions to the problem, but they seem way too complex to solve what SHOULD be such a simple problem…

 

Specifically, I can keep my own “object journal”, so when you try to edit the same project a second time, the new ProjectEdit page instance can edit the _original_ project object. That seems pretty workable, but there’s no way that I can find to know when it is safe to eliminate items from this object journal. Yet it can’t grow forever.

 

I keep assuming that I’m missing something about the journal history API. And I probably am. But I’ve done enough work with it to know that it is a PITA, and at this point I don’t have more time to waste on figuring it out, so I’m exploring a windows model. That’s more like Windows Forms, but it still isn’t at all obvious how to do some things that seem quite trivial.

 

In short, the learning curve on WPF is no less than moving from VB6 to Windows Forms. Everything you know is kind of, sort of, there, but not really.

 

Rocky

 

From: Brian Criswell [mailto:cslanet@lhotka.net]
Sent: Friday, May 25, 2007 5:50 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] CSLA .NET 3.0 Beta 1 available

 

Hi Rocky,

In the release announcement in your blog, I noticed you mentioned "back button issues."  What were those issues?


Copyright (c) Marimer LLC