.NET 4.0 and CSLA 4.0 - Potential to use Lazy<T> and the more powerful Lazy<T,TMetadata>

.NET 4.0 and CSLA 4.0 - Potential to use Lazy<T> and the more powerful Lazy<T,TMetadata>

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


Jaans posted on Thursday, January 07, 2010

Hi Rocky / all

Disclaimer: You may be aware of this, but I thought it might be valuable to mention it any way.

Since you're looking into vNext for CSLA with respect to .NET 4.0, I though it might be of value to mention the potential value of using the threadsafe Lazy {T> construct.

Then there is the Lazy{T,TMetadata> construct that basically allows you to check against some metadata to again decide whether you want to instantiate an expensive resource or not.

It may be of particular use for lazy loading of child business object / lists.

Perhaps there is scope for it in the next version of CSLA?

For more info have a look at: http://www.davidhayden.me/2010/01/lazyt-tmetadata-class-in-systemcomponentmodelcomposition.html

Hope that helps
Jaans

Ps: How do I get the post editor to output a less than symbol?

RockfordLhotka replied on Thursday, January 07, 2010

Thank you Jaans, that is absolutely on my list of things to look at for 4.0 - there are some very cool things in the new System.Threading space - not just Lazy, but also some automatically threadsafe lists and dictionaries that may help simplify a bunch of internal CSLA code.

 

If you run IE in IE7 compat mode you'll get the rich text editor that allows you to use < and >.

Copyright (c) Marimer LLC