Sunday, August 10, 2008

LINQ and Entity Framework Posts for 8/8/2008+

Note: This post is updated daily or more frequently, depending on the availability of new articles.

Shawn Wildermuth Attacks the Reality of Data-Last Design in the Enterprise

Shawn’s Rigidity in Data Design post of August 9, 2008 is a thought-provoking essay about the validity of the ALT.NET members and Domain-Driven Development adherents contention that “that data is a top-down or at worse, bottom up design problem” and the assumption that greenfield persistence (database) schema are de riguer for most data-intensive development projects.

Shawn takes the position, with which I agree, that most data-driven development projects start with an existing database schema and a substantial amount of historical data. I estimate that nine out of ten projects that I’ve completed in the past 20 years worked extensively with existing business data on mainframes, minicomputers, and mid-range UNIX servers.

Shawn concludes:

No *rule* applies in all situations. I laud the ALT.NET guys for trying to inject better skills and tools into the process, I just rail against the ferocity of zealotry that comes in some of the message. When enterprise developers hear this, they just tune it out instead of taking what helps them and leaving the rest.

Added: August 10, 2008

Steve Naughton Adds Custom Row Rollover and Row Click Behavior to ASP.NET Dynamic Data Grid Views

His Customising GridView for Row Rollover and Click in Dynamic Data post of August 9, 2008 adds:

  • Background color change with mouse rollover
  • Row click navigation (e.g., to details view)
  • Row double-click navigation (e.g., to edit view)

to GridView controls in ASP.NET Dynamic Data projects. Steve’s prodigious output of code for customizing ASP.NET Dynamic Data projects goes far beyond what the Microsoft team has provided in documentation and blog posts so far.

Bart De Smet Offers LINQ Resources from Three of his Four Tech*Ed South Africa 2008 Sessions

Bart’s TechEd 2008 South Africa Demo Resources post of August 9, 2008 provide downloadable files and other resources from his two LINQ-related presentation and an additional Tech*Ed South Africa 2008 session:

  • DEV 305 – C# 3.0 and LINQ Inside Out
  • DEV 303 – Parallel Extensions to the .NET Framework
  • DEV 304 – Writing Custom LINQ Providers
  • MGT 301 – Next-Generation Manageability – Windows PowerShell and MMC 3.0

VS 2008 SP1 RTM Scheduled for Monday, August 11, 2008

Visual Studio 2008 Service Pack 1 will be available for download from the MSDN Subscriptions page "after August 11, 2008.”

If you have VS 2008 installed, don’t run SQL Server 2008 setup until after you install VS 2008 SP1 RTM bits.

For more information, see my VS 2008 SP1 RTM Scheduled for Monday, August 11, 2008 post of August 8, 2008.

Bill McCarthy Casts a List(Of DerivedClass) to List(Of BaseClass) with Generic Variance via an Extension Method

Bill starts his Generic variance and List(Of T) post of August 8, 2008 with:

Have you ever wanted to cast a List(Of Customer) to a List(Of BusinessBase), where Customer Inherits BusinessBase, only to find that you can't... well you can ;)

But his extension method uses reflection do it. (His post is an extension to his Inside Arrays article for in Visual Basic Magazine’s July 2008 issue.

For more information about Generic Variance see Variance in Generic Types (C# Programming Guide) article, Paul Vick’s A little update on VB10 thinking... post that says Generic Variance is on VB vNext’s radar, and Eric Lippert’s 11-part Covariance and Contravariance in C# blog series.

Don Kiely Describes Why Web Sites Running in Medium Trust Can’t Use Entity Framework v1

Don’s “Dynamic Data with the Entity Framework in Medium Trust” article for the ASP.NET Newsletter August 8, 2008 issue’s “Secure ASP.NET” column publicizes an ASP.NET Dynamic Data forum thread: Should Dynamic Data (Entity Framework model) work in medium trust?

The upshot of the thread is that the EntityDesignerBuildProvider throws exceptions the when run in medium trust on hosted Web sites. According to the Entity Framework team’s Diego Vega:

    1. The problem only affects Web Sites. Web Applications are not affected.
    2. Web Sites precompiled in full-trust and deployed to partial-trust apparently work.

Don and Diego suggest the same workarounds.

Thanks to Julie Lerman for the heads-up.

Ardenkantur Recounts Issues Using Entity Framework with Jaroslaw Kowalski’s Oracle Data Provider

His My Adventures with Entity Framework and Oracle post of August 8, 2008 describes issues with mixed-case versus upper-case table and column names, inability to specify column names in the EDMX file’s SSDL (storage) section instead of the mapping layer (MSL),  and use of ROWNUM clauses in Skip and Take operations.

The post is based on Jaroslaw’s EFOracleProvider described in his Sample Entity Framework Provider for Oracle post and available for download from under the Microsoft Public License (MS-PL), which isn’t intended for production use. However, users of commercial EF-enabled Oracle Managed Data Providers should watch out for the the problems Ardenkantur encountered in his pre-RTM test.

Pete Montgomery Demonstrates Caching the Result of LINQ Queries

In Caching the results of LINQ queries of August 8, 2008, Pete describes how to cache the result of LINQ queries that will will:

    • work for any LINQ query (over objects, XML, SQL, Entities…)
    • work for anonymous type projections, as well as business entities
    • be statically type safe (no casting required)
    • deal transparently with cache key creation
    • look syntactically like a custom query operator

He generates the unique cache key from the query expression.

Although Pete’s technique targets ASP.NET’s System.Web.Caching.Cache class, he says the approach “can be used by any .NET application or library.”

Note: Ayende Rahien (Oren Eini) has just completed a series of blog posts on distributed hash tables (DHT). His Patterns for using Distributed Hash Tables: Conclusion post of August 9, 2008 has links to the preceding eight episodes. If you’re interested in object caching in .NET, this series is a must-read.

Billy McCafferty Releases S#arp Architecture v0.7.3 Supporting ASP.NET MVC Preview 4 and NHibernate 2.0 CR 1

Billy’s S#arp Architecture: a new home, upgrades and a logo! post of August 8, 2008 announces the release of the latest version of S#arp Architecture: ASP.NET MVC with NHibernate (0.7.3), which supports ASP.NET MVC Preview 4 and NHibernate 2.0 CR1, and the formation of a S#arp Architecture Discussion Group on Google Groups.

He describes his new framework, which carries a GNU General Public License v3 license, as follows:

Pronounced "Sharp Architecture," this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET MVC framework with NHibernate. The primary advantage to be sought in using any architectural framework is to decrease the code one has to write while increasing the quality of the end product. A framework should enable developers to spend little time on infrastructure details while allowing them to focus their attentions on the domain and user experience. Accordingly, S#arp Architecture adheres to the following key principles:

  • Focused on Domain Driven Design
  • Loosely Coupled
  • Preconfigured Infrastructure
  • Open Ended Presentation

The overall goal of this is to allow developers to worry less about application "plumbing" and to spend most of their time on adding value for the client by focusing on the business logic and developing a rich user experience.

Billy is the author of NHibernate Best Practices with ASP.NET, 1.2nd Ed., which is required reading for anyone developing data-driven ASP.NET projects, regardless of whether you’re using or plan to use NHibernate, Entity Framework, LLBLGen Pro, or any other .NET Object/Relational Management O/RM tool.

Kingsley Idehen: OpenLink Software Publishes White Paper about LINQ to RDF

Kingsley describes Carl Blakeley’s LINQ To RDF: Exploiting the RDF based Linked Data Web using .NET via LINQ white paper of July 31, 2008 in his .NET, LINQ, and RDF based Linked Data (Update 2) post of August 8, 2008:

The paper offers an overview of LINQ to RDF, plus enhancements we've contributed to the project (available in LinqToRdf v0.8.). The paper includes real-world examples that tap into a MusicBrainz powered Linked Data Space, the Music Ontology, the Virtuoso RDF Quad Store, Virtuoso Sponger Middleware, and our RDfization Cartridges for Musicbrainz.

OpenLink Software is the publisher of Virtuoso, “an innovative Universal Server platform that delivers an enterprise level Data Integration and Management solution for SQL, RDF, XML, Web Services, and Business Processes.”

Amirthalingam Prasanna Offers a Introductory Guide to ADO.NET Data Services

His “Creating Service-Orientated Data-Access Layers” article of Redgate Software’s Simple-Talk newsletter of July 30, 2008 is yet another tour of ADO.NET Data Services but, unlike many other Astoria articles and blogs, it includes the basic details of query interceptors and change inteceptors for implementing role-based security.