Visual Studio 2010, .NET 4.0 and CSLA .NET 4.0

Visual Studio 2010, .NET 4.0 and CSLA .NET 4.0

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


RockfordLhotka posted on Monday, October 19, 2009

Microsoft has made Visual Studio 2010 and .NET 4.0 Beta 2 available for download to MSDN subscribers, with general availability soon. VS10 includes a lot of really nice features over VS2008, and I’m personally very excited to see the Beta 2 release.

I’ve made a pre-alpha CSLA .NET “4.0” available for download as well. This is really just the version 3.8.0 code (somewhere between beta 1 and beta 2) that I’ve updated to build under Visual Studio 2010 with .NET 4.0.

Over the next few months I’ll continue to release updates to version 4.0 that take advantage of the .NET 4.0 features, but I wanted to make sure there was a version online that builds with VS10 as soon as possible, so this is it – enjoy!

Jack replied on Monday, October 19, 2009

I don't know if you posted something already but what are some of the exciting things we can look forward to?

PLINQ?

Thanks

jack

rfcdejong replied on Tuesday, October 20, 2009

The parallel class and PLINQ using it is indeed one of the best improvements in .NET 4.0
But that is just the language. I like the new features in VS2010 for architects, thru i wonder in how far it's possible to visualize code accessed by reflection etc.

Anyway nice to see csla is being prepared for VS2010, as we'll go over after awhile. And we'll go over to TFS2010 as well for gated checkins etc :)

WCF is also improved, perhaps some improvements for the wcf dataportal?

And:
- Optional and named parameters;
- Co- and contravariance in Generic Typing;
- Dynamic typing. (java $h.t)

RockfordLhotka replied on Tuesday, October 20, 2009

I think it will take some time using and working with .NET 4.0 to determine what impact it will have on CSLA .NET itself.

There are many interesting changes to languages, both C# and VB. Most of which have little or no impact on CSLA that I'm aware of. For example, the dynamic features (on the surface) seem like they should help me simplify MethodCaller, but in talking to the C# compiler guys it sounds like these features aren't string-driven and so can't actually do what I'm doing.

Other language concepts, like the enhancements around generics, don't appear to impact the CSLA functionality at all. They might simplify my code, or your code, but they don't appear to directly impact the design of any public API.

The WCF enhancements may be meaningful, but I really don't think so. The data portal uses very few WCF features - it is a very high-level service interface in most regards. And that's intentional, since it means that the data portal is very configurable and automatically takes advantage of WCF features without needing to be altered. Remember that the data portal just exposes four (or five?) simple methods with clearly defined data contracts - there's really nothing to it.

To put it anther way, I'll be surprised if I need to alter the data portal to enable the new WCF features. I expect that the new features will just work, and will be available immediately through configuration changes on the client and server.

The TPL may be a bigger deal. I'm hoping Aaron has time to look at the impact of PLINQ, but there's the broader TPL feature set, including things like parallel.foreach() and so forth. Hopefully most of this "just works", because making business objects threadsafe is a virtual impossibility, at least not without major rework and/or perf impact due to locking.

In any case, I look forward to discovering what there is to discover, and hearing from you about any issues you encounter and .NET 4.0 concepts you think I can exploit.

fsl replied on Wednesday, November 25, 2009

What about using some of the new dynamic features that are being introduced, to implement 'Dynamic properties' as mentioned in http://forums.lhotka.net/forums/thread/34158.aspx ?

Which combined with WPF 4's ability to bind to dynamic properties, would be a powerfull feature..

(Just a thought.. I will be looking into this myself though, since I have a few scenarioes that could benefit from Dynamic properties)

RockfordLhotka replied on Wednesday, November 25, 2009

I'll explore that as well, given time. The big question is whether all the
different data binding infrastructures will work with those classes, since
most of them reflect against target objects to get PropertyDescriptor or
PropertyInfo objects. In the case of PropertyDescriptor it is possible to
implement yet another interface to provide dynamic descriptions of
properties, but in the case of PropertyInfo you can't fake it out.

To me the value of a dynamically shaped object is primarily to deal with
user-defined queries - when you want a read-only list but won't know until
runtime which properties the user wants to see. And that means the primary
benefit is lost if you can't then bind the object to the UI.

This comes back to why I'm still in research mode - this is a cool feature,
but will it work in practice? And what are the perf implications? Dynamic
objects have overhead not present with normal objects.

Dane replied on Thursday, October 22, 2009

I get two errors when trying to compile that build under VS2010 and .net 4.0 Beta 2.

The type or namespace name 'Interactivity' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) .\cslacs-4.0.0-091019a\cslacs\Csla\Wpf\Execute.cs

The non-generic type 'System.Windows.TriggerAction' cannot be used with type arguments .\cslacs-4.0.0-091019a\cslacs\Csla\Wpf\Execute.cs

RockfordLhotka replied on Thursday, October 22, 2009

That’ll be true of 3.8 Beta 1 also. This is because I’ve taken a dependency on a DLL from the Blend 3 SDK.

 

In 3.8 Beta 2, and in the next 4.0 release, I’m putting the assembly into a Dependencies folder, so the framework will build even if you don’t have Blend 3 installed. The drawback is that we lose localization and some intellisense – for those you need the SDK regardless.

Copyright (c) Marimer LLC