Wednesday, April 11, 2007

LINQ and Entity Framework Resource Updates

Jim Wooley's LINQ articles on MSDN2 post this morning reminded me that I hadn't been updating my prior LINQ and Entity Framework resource posts as often as this rapidly-moving field justifies. Jim's post provides links to five Microsoft LINQ-related white papers that were updated in February and March 2007 to coincide with the Orcas March 2007 CTP's release. Jim's comment

I scanned over the documentation and there are a number of issues in the documentation, which is understandable considering the moving target. I do find it interesting that they leverage some language features not yet available in the current CTP, most notably VB's anonymous functions which will equate to the C# lambda expression.

surprised me because of the recent updates. Jim's reply of 4/11/2007 1:09 AM UCT in the Compiled Queries in LINQ to SQL - performance considerations and entity caching thread in the LINQ Project General forum explains some of the discrepancies in the LINQ to SQL: .NET Language-Integrated Query for Relational Data whitepaper.

I've updated the following posts this morning to add the updated white papers, as well as more recent LINQ and EF-related articles and blog items:

Update 4/12/2007: Beth Massi has posted links to sign up for the following VB-oriented "Live From Redmond: VB9" Webcasts, most of which are focused on LINQ or include LINQ-related content:

  • Orcas Overview, April 24, 2007, 9:00 AM PST. John Stallo will cover the breadth of features that you can expect to see in the upcoming release of Visual Basic. John will demo how all the features such as LINQ, n-tier, WCF support, and OCS work together to help you build your applications faster than ever before.
  • LINQ Overview, April 25, 2007, 9:00 AM PST. Kit George will explore the new LINQ features in Visual Basic. We will show how to take advantage of LINQ to build applications that query and aggregate data from multiple sources, including in-memory objects, databases, and XML.
  • LINQ to SQL & O/R Designer Deep Dive, May 2, 2007, 9:00 AM PST. Young Joo extends the SQL and LINQ web cast by showing you how to use the new OR designer to build applications that take advantage of LINQ to SQL.
  • Building N-Tier Applications, May 9, 2007, 9:00 AM PST. Young Joo will show you how you can separate business logic from data access logic using the new n-tier features in Visual Basic.
  • Offline Data Caching May 16, 2007, 9:00 AM PST. Milind Lele will demonstrate how to use SQL Server Compact Edition to build applications that can cache your data offline and have it automatically sync to your database when you are online.
  • Deep Dive into LINQ May 23, 2007, 9:00 AM PST. Amanda Silver will dive into details how the LINQ features work. In the process, we will discuss anonymous types, type inference, inline functions, extension methods, and how these features work together to give you the LINQ experience. In addition, we will demo how these features can be used independently to help you build your applications quicker and with less code.
  • Building Service-Oriented Applications May 30, 2007, 9:00 AM PST. John Stallo will show you how you can produce and consume WCF services using the new WCF support with Visual Basic and build applications that take advantage of the next-generation service architecture.
  • LINQ Best Practices June 13, 2007, 9:00 AM PST. Lisa Feigenbaum will explore best practices for writing easy to read, consumable queries, including naming, usage, and performance ideas.

All presenters are program managers on the VB Team.

Update 4/24/2007: Young Joo has posted zip files of slides from his two VS Connections 2007 presentations: VMS305: LINQ to SQL: Bringing SQL Code into Visual Studio and VMS309: Sneak Peak at Visual Studio "Orcas". VMS305 sounds to me like a preview of his LINQ to SQL & O/R Designer Deep Dive presentation.

Note: The June 6th Webcast is Using the Interop Toolkit to Migrate your VB6 Applications to .NET, which is outside the VB9 scope. For unknown reasons, the author of the presentation descriptions insists on substituting LinQ for LINQ.

There's an average of about 35 blog entries per day tagged with LINQ, so it's not easy to keep up with the new goings on. As an example, Channel9 reported on April 6, 2007:

C# team members Shon Katzenberger, Scott Wiltamuth, Todd Proebsting, Erik Meijer, Peter Hallam, Anders Hejlsberg, and Peter Sollich were recently awarded a Technical Recognition Award for Outstanding Technical Achievement for their work on the C# language. This award is particularly meaningful to the recipients as it is awarded by their technical peers. It's quite an honor.

A video segment featuring the recipients is here.

Thursday, April 05, 2007

Danny Simmons Featured on .NET Rocks

Carl Franklin's and Richard Campbell's .NET Rocks interview with Danny Simmons for Show #226, "Daniel Simmons on ADO.NET Entity Framework" appeared today. The show runs 1:08:00 and the interview with Danny starts at 0:08:20.

Update: 5/16/2007: The transcript for this segment is here. Danny's interview starts at the bottom of page 3.

Danny says at the start of his interview that he's been at the center of the Entity Framework's Object Services layer from its beginning.

Persistence Ignorance Missing in the Entity Framework

Here's an early excerpt that relates to Danny's participation in the "Persistence Ignorance" flare-up during the recent MVP Summit at Redmond:

11:45 Richard Campbell mentioned the "O/RM Smackdown" and that he sat at the back of the Entity Framework session at the recent MVP Summit in Redmond. He described "usual suspects," who were in the center of the room on the right, as the "NHibernate Mafia" (James Kovacs, Scott Bellware, Jeffrey Palermo, Jean-Paul Boodhoo, all NHIbernate believers) in a little cluster hammering Microsoft's ADO.NET folks. Danny was sitting at the left in the front, and popped up a couple of times to answer questions. When the session broke, it took him an hour to get out of the room.

14:30 Danny Simmons: Next day we scheduled a lunch [with the NHibernate Mafia] and just went at it. These folks have the impression that we just don't get their style of working. We don't get what they do within NHibernate and are trying to build "this other product." We gave Jeffrey Palermo our vision for a few releases out, this is what it could be like. Jeffrey said, "Yeah! Perfect! You've got it!" I said, "Now let me tell you why it's not coming out that way in this release."

Comment: I would have enjoyed hearing the "vision" and "why it's not coming out" in the Orcas release.

Jimmy Nilsson and the Disappearing Entity Framework Docs

15:50 Carl Franklin: Jimmy Nilsson blogged about the Entity Framework and all traces of the Microsoft documentation for it suddenly disappeared from the Internet. People kid Jimmy that he "killed the product."

Comment: Go to Jimmy's blog and search for the "Infrastructure and EDM" item of 5/12/2006 and its update to find the alleged culprit. (As far as I can determine, Jimmy's attributes the term "Persistence Ignorance" to Martin Fowler, but I haven't found any evidence of Fowler's use of the term or that Fowler has added it to his Catalog of Patterns of Enterprise Application Architecture or Development of Further Patterns of Enterprise Application Architecture page.)

For more details on the missing EF and EDM documents see my 3/15/2006 ADO.NET 3.0 Entity Framework Ephemera and, for their restoration, ADO.NET 3.0 Entity Framework Docs Redux of 6/19/2006.

Defining the Entity Framework and Distinguishing It from an O/RM Tool

The ADO.NET team avoids categorizing the Entity Framework as an Object/Relational Mapping tool, such as NHibernate and commercial O/RM products, although the Object Services layer maps entities to partial CLR classes and relationships. Danny defines the Entity Framework:

16:45 The idea of the Entity Framework is to create a new data model that's a higher abstraction than the relational model. The goal is to give the business model the same theoretical underpinnings--to give it the long-term legs--of the relational model. It's based on Peter Chen's Entity-Relationship model.

17:50 The Entity Framework makes a real runtime representation of the structure--the model of your data, and the constraints on that, in terms that are much closer to the way your application runs.

18:20 In general, it falls into the O/RM model. But there's a key distinction. We're trying to capture the structure and the relationships and constraints on the data as a separate thing before you get to the point of designing your business objects that have behaviors.

Comment: Don't miss Channel9's Dr. Peter Chen: Entity Relationship Model - Past, Present and Future segment video segment, in which Peter Chen and ADO.NET architect Jose Blakeley participate.

EDM Designer[s] and Their Delivery

The EDM Designer won't be in the Orcas RTM, but Danny says:

26:10 We will ship out of band on the Web more visual tools [for] designing the schemas, and maybe even getting to the point of visually specifying the mapping. Today you have to do that in a declarative format and long term I believe we're going to need a whole variety of [designers].

Comment: It's doubtful if many developers will adopt Orcas's Entity Framework for production apps until an "out of band" drop of the forthcoming EDM Designer proves it can handle modifications to XML schema files that cover 95% or more of developers' requirements.

LINQ to Entities vs. Entity SQL

It's still not clear to most developers when to use LINQ to SQL, the EDM with LINQ to Entities, or the EDM with Entity SQL (eSQL). Danny says the following about EDM with LINQ to Entities or eSQL:

29:30 It's a key concept in LINQ [to Entities] to define an interface to IQueryable and get a handle on that specification instead of the compiler actually compiling it. We do a runtime translation of that query specified into the same query trees and then it runs through all the rest of our stack the same as if you had specified the query any other way.

30:00 EntitySQL is very close to SQL, but it has extensions that understand inheritance and navigating relationships. It is a full-representation query language, so you can compose your queries, you can do joins, you can do very, very rich queries.

30:30 You can either buy into LINQ, which for some solutions makes very great sense, or use the text-based [eSQL] query option.

Comment: Danny didn't compare the Entity Framework and LINQ to SQL. LINQ to SQL connects SQL Server (only) databases directly to table-based objects with no intervening mapping layer. LINQ to SQL supports limited limited inheritance; the rows for base class and subclasses must be contained in a single database table. Unlike the Entity Framework, you can generate an SQL Server database from an entity model you create from scratch. Julie Lerman's LINQ to SQL vs. Entity Framework post provides more detailed distinctions, and check out Kevin Hoffman's early (August 2006) LINQ to Entities vs. LINQ to SQL - What should I use and when? post, which contains a feature-by-feature comparison.

Code Generation in Orcas and Future Versions

The present Entity Framework implementation, including the EDM Wizard, starts with the database schema and works up to the EDM and its Object Services.

43:10 The kind of generation we have now goes up from the database to the model. But a lot of people want to go from the object down and generate the database. If I add a property to an object, I want a script generated to add the field to the table and another script to remove it if I change my mind.

44:45 An interesting designer story is "I'm not trying to generate my code from my model, but I'm writing my code and putting hints in it, so we can generate the model out of the code."

45:25 In Orcas, we're getting some of this direction. Like many of the Visual Studio Designers, "Hey, there's this way you can design the model and then we'll do code generation of partial classes." But you also have the option of writing your classes from scratch, implementing a few interfaces that allow us to be aware of what's going on, and then writing the model by hand.

In a later release, we want to go to the next step, which is to write your classes and you tell us to build the model for you. Either one time or in an incremental fashion because "the truth is in the classes." But we have some customers who say "the truth is in the model," so we want to support them, too.

48:00 If you take the Entity Framework vision farther and farther forward, you eventually say, "Well, why do I need to specify the relational model at all? Why don't I hand my entity model directly to SQL [Server] and say 'Store this and do it fast!'"

Comment: The Orcas March 2007 CTP's EDM Wizard does a reasonable job of generating the XML mapping files and class code from the database up but, unlike LINQ to SQL, won't generate a database (or write CREATE DATABASE/TABLE or ALTER TABLE scripts) from the model.

Entity Framework in Orcas March 2007 CTP and Beta 1

50:40 From the standpoint of the Entity Framework, the March CTP and Beta 1 are almost identical. There's some last bit of features that we're busily working on now that will appear in Beta 2 and the Orcas Release. Search Technorati for "Entity Framework" and you'll find some interesting blog entries.

Comment: Be sure to use the double-quotes when you search for "Entity Framework" or you'll receive 4,000+ hits (90% off-topic) instead of 400+ that I found today.

Update 4/6/2007: Major restructuring and additions. 4/7/2007: Added links, made minor corrections, and fixed typos.

Wednesday, April 04, 2007

LINQ Featured in Redmond Developer News

"Looking to LINQ: Will Microsoft's Language Integrated Query transform programmatic data access?" is the cover story for the April 2007 issue of Redmond Developer News. The story by Jeffrey Schwartz and Michael Desmond leads with a quote from Julie Lerman, who gained her introduction to LINQ at the 2005 Microsoft Professional Developers Conference (PDC) in Los Angeles:

"I was jumping up and down," recalls Lerman, who describes herself as an old FoxPro hand. ... "It's very powerful and it's a really important addition to the languages and to .NET," Lerman says.

If you don't catch the significance of "an old FoxPro hand" in the preceding quotation, you might not be aware that FoxPro, dBASE, Clipper and all other early xBase dialects supported query reserved words such as USE, LIST [ALL], REPLACE [ALL], and FOR as elements of the programming language in commands like the following:

USE employees
REPLACE ALL salary WITH salary * 1.1 FOR supervises > 0
LIST ALL fname, lname, salary TO PRINT

SELECT, FROM, WHERE, ORDER, BY, IN, and JOIN later became reserved words in Visual FoxPro's more expansive xBase dialect.

Similarly, LINQ supports SQL-like From, In, Join, Select, Where, and Order By instructions as C# 3.0 and VB 9.0 reserved words. One of the reasons I'm partial to LINQ is that I started my database programming career with dBASE III+ and later moved to Clipper.

"The View Beyond Redmond" section quotes Curt Cotner, an IBM Fellow and CTO for database servers:

"I don't think there's anything along the same lines in the Java world," he says. "I think this is an area Microsoft has innovated and gone in a direction that is different than a lot of the other programming languages have gone."

That praise comes from someone who would know. Regarded as one of the early innovators of relational database technology, Cotner is the chief architect of IBM's mainframe-based DB2 and the architect of database connectivity for IBM's WebSphere application server line.

The article also includes a LINQ FAQ by—and quotes from an interview with—Anders Hejlsberg.

Update 4/5/2007: Julie Lerman added her own post about the article.

Tuesday, April 03, 2007

Microsoft Patent Application for the Entity Framework and EDM

The U.S. Patent and Trademark Office (PTO) published on March 8, 2007, U.S. Patent Application 20070055692, "Incremental Approach to an Object-Relational Solution." The inventors are the usual data programmability team suspects: Michael Pizzo, Pablo Castro, Jose Blakeley, Andrew Conrad, Alyssa Henry, et al. The application was filed on February 28, 2006, about four months before the first post on the Data blog and the once-missing ADO.NET 3.0 Entity Frameworks documentation reappeared.

The three principal claims are:

1. A system that facilitates object-relational mapping comprising the following computer-executable components: a storage-specific provider component that exposes a common schema over a store schema of a data store according to a common data model; a mapping provider component that exposes a rich schema over the storage-specific provider component in accordance with a rich data model; a services component that operates in terms of the rich data model; and an object mapping component that provides object services over the rich schema. ...

18. A computer implemented method for incrementally extending a data provider, comprising the following computer executable acts: exposing a common schema over a store schema of a data store in accordance with a common data model; mapping the common schema to a rich schema in accordance with a rich data model that operates at a value layer; providing entity services that function in terms of the rich data model; and providing object services that operate on top of the rich schema. ...

20. A computer executable system that provides object-relational mapping and incrementally extends a data provider, comprising: computer implemented means for extending a storage-specific data provider to support a common command representation; computer implemented means for mapping a storage-specific data model to a rich data model that is defined at the value layer; computer implemented means for providing entity services that conform to the rich data model; and computer implemented means for providing object services built over the rich data model.

(The term rich appears about 80 times in the application's text and several times in the drawings.)

You can learn quite a bit about what the developers had in mind by reading the Summary and Detailed Description sections. I'm not a patent attorney, but the descriptions use the same terminology and describe much of the EF and EDM technology that was discussed in the June 2006 documentation and implemented in the Orcas March 2007 CTP.

The Summary starts by describing an "incremental" approach to O/R mapping:

The subject matter disclosed and claimed herein, in one aspect thereof, comprises an architecture that can facilitate an incremental approach to an Object-Relational mapping solution. We refer to this solution as "incremental" in that it provides layers of abstraction that expose incrementally richer views of the data starting from the flat relational model (exposed by a store-specific provider interface), a nested relational model (exposed by a mapping provider interface), and a full object model (exposed by object services built on top of the mapping or store-specific providers).

It goes on to define the Entity Framework:

In accordance therewith, an Entity Framework can employ a mapping provider, which can expose a common data provider application programming interface (API) over extended storage-specific data providers. The Entity Framework can leverage services that work in terms of a common data model, including the mapping provider, to incrementally build functionality typically found in an Object-Relational layer on top of an existing API (e.g., a relational API or value layer API), rather than providing an entirely new set of components and APIs for working with objects. Services such as client side mapping to rich nested relational schemas, state management, update processing and the like can be added in terms of existing relational API classes. As well, object services can be built on top of these rich services, which can follow a common programming pattern. [Emphasis added].

And finally defines the Entity Data Model (EDM) as a "rich conceptual model" here:

Developers of new data-aware applications can work with a common set of familiar data provider classes such as a class provided by the store-specific data provider and/or the mapping provider. These classes can connect to, query, or retrieve results in terms of a rich conceptual data model. This rich conceptual data model (e.g., the EDM) can include concepts such as nesting, inheritance, complex types and relationships such as containment and association. The EDM can be mapped to various existing flat relational schemas, without requiring changes or additions to the store schema. The store schema, application schema, and even the type of store can all evolve independently, with the mapping to the store and store schema controlled through application configuration. The developer can have the choice of working entirely in terms of textual queries that return standard data records, entirely in terms of object queries that return strongly typed object results, or in any combination of the two.

A reference follows to "Entity Data Model (EDM)," apparently to explain the preceding abbreviation.

The Detailed Description section includes numerous code snippets, which are difficult to read in the full-text version because they aren't <pre> formatted.

Page Images and Drawings

The PTO uses a uncommon TIFF format (ITU T.6 or CCITT Group 4 (G4) compression) for page images and drawings, which require a specialized, proprietary viewer. So here are a few representative drawings from the application.

Figure 5 illustrates the mapping provider that can transform a data store output into a rich nested relational model.

Figure 7 illustrates a cache in conjunction with the extended data provider.

Figure 9 illustrates the mapping provider that can receive a query and stream the results to the query.

Figure 9 illustrates an exemplary flow chart of procedures that facilitates an object-relational mapping solution.

Monday, April 02, 2007

SQL Server Compact Edition and Synchronization Updates

Steve Lasker's Creating your SQL Server Compact Edition database and schema in code post proposes to create your local SSCE database on the fly from T-SQL commands that you store as an application resource. SSCE's DDL doesn't accept multiple (batched) commands but SQL Server Management Studio [Express] (SSMS[X]) SP2 hides this limitation from you by allowing GO to separate batched commands.

Steve suggests the neat trick of adding the batch file that you tested and saved in SSMS[X] to the project's resources, and then use String.Split in code like the following to obtain an array of commands:

Dim commands() As String
commands = My.Resources.DatabaseCreation.Split( _
   New String() {"GO"}, StringSplitOptions.RemoveEmptyEntries)

If you use Orcas's Sync Designer to generate the local database cache from the server database's metadata, you must add foreign key and other constraints, as well as indexes, to SSCE with code. So Steve's approach applies to the SSCE Sync Framework, too.

Click here for a table that describes the most important SQL Server 2005 [Express] features that are missing in SSCE. My "Lighten Up Your Local Databases" article from the March 2007 Visual Studio Magazine issue shows you how to take full advantage of SSCE as a local data cache.

SyncGuru Rafik Robeal's sixth Sync Framework demo, Decoupling of Change Tracking Metadata, separates tracking information (for example, CreationDate, LastEditDate, and ClientID fields) into a separate tracking table. Using a separate tracking table minimizes the effect of synchronizing client caches on a production database's schema. Rafik says:

The good news though is that the building a decoupled change tracking layer is not a big deal. In the decoupled model, the base table schema remains intact. As the demo shows, three triggers (insert, update, and delete) and separate tracking table are enough to build equivalent change tacking model. Although, the sync commands need to change since it needs to grab corresponding tracking information by joining the base table with the tracking table, the changes are simple and easy to understand.

Saturday, March 31, 2007

"Disconnected Operation" and the Entity Framework

Fabrice Marguerie alerted me this morning to a controversy about the handling of update concurrency conflicts in data-intensive, n-tier applications. Fabrice started his Change tracking, the ADO.NET Entity Framework and DataSets post with:

Andres Aguiar started an interesting discussion about disconnected operation and change tracking in the ADO.NET Entity Framework. [Emphasis added.]

Andres' ADO.NET Orcas Entity Framework and disconnected operation post says:

David [sic] Simmons explained how the 'disconnected mode' works today in Entity Framework (and as far as I know, that's the way it will work in the Orcas release).

Basically, there is no disconnected mode. You can create a context and attach objects that you kept somewhere, telling the context if it was added/deleted/modified.

This basically means that if you plan to build a multi-tier application with ADO.NET Orcas in the middle tier, you will need to hack your own change tracking mechanism in the client, send the whole changeset, and apply it in the middle tier. From this point of view, it's a huge step backwards, as that's something we already have with DataSets today. [Emphasis added.]

I had read Danny Simmons' Change Tracking Mechanisms post and added a link to it Thursday. I didn't recall any mention of disconnected operation or disconnected mode in his post.

I believe that Danny only addressed the Entity Framework's optimistic concurency implementation for data updates in an n-tier environment, not disconnected operation.

Note: Today is Danny's 10th Anniversary as a Microsoft employee.

Defining Disconnected Operations and Occasionally Connected Systems

I view disconnected operations as environment in which:

The client application has sporadic or unreliable access to a network to process typical CRUD data operations. Microsoft's preferred term is Occasionally Connected Systems (OCS). Typical users of OCS are sales people, construction managers, social-services caseworkers, foresters, fish and game officials, and physicians who work in the field, especially in non-urban locations.

Note: The Social Security Administration is testing a new healthcare approach that offers seriously ill patients the services of a primary care physician who make house calls.

Architectural characteristics of the OCS scenario, in my experience, are:

  • A smart-client (WinForms) UI
  • Task-based data-entry and update forms
  • Grids for data entry used only where a single view of multiple items is required
  • Locally cached lookup (catalog or historical) data, which can be very large and thus must merge changes rather than require full-table refreshes
  • Automatic or semi-automatic push of cached data to the server (two-tier) or data service (n-tier) when connected to the network
  • A process to enable the client to resolve data update and deletion concurrency conflicts; alternatively, to notify the client of the action taken by a business rule
  • A process to enable the client to resolve insert and other conflicts with multiple rows of child tables, such as order or medication line items *
  • Increased probability of concurrency conflicts than with usually connected systems because of increased update latency
  • Increased probability of foreign key conflicts due to lookup data latency (stale data)
  • A process to test cached inserts and updates for lookup data changes.

* Note: This process isn't addressed by any built-in concurrency handling implementation that I've found, and it also influences the method of handling concurrency conflicts for updates and deletions to child tables. Disconnected or not, you must test for post-retrieval changes by other users to all dependent objects in the graph before committing updates. In many cases, business rules can't resolve these conflicts. I described the approach for DataSets in Expert One-on-One Visual Basic 2005 Database Programming, and I plan to add a blog post and write an article about the technique as it applies to other local persistence implementations.

The preceding definition assumes that, when connected, the client can rely on the data server or access services to invoke methods reliably and quickly (i.e., synchronously). Usually connected systems (UCS) that must deal with unreliable (i.e., asynchronous) data-access services are even more complex because user intervention to resolve complicated concurrency conflicts no longer is real-time. Local data caching capability ordinarily is required even for UCS to support changes to multiple objects.

Local Data Caching for OCS with DataSets

Andres observes that "[W]e already have [change tracking management] with DataSets today." Not only do we already have an optimistic concurrency implementation with DataSets, but a local data cache to handle disconnected operations also. DataSets handle change managment by preserving row state as Added,Deleted,Detached Modified or Unchanged. Invoking the DataSet.GetChanges(Data.DataRowState) method returns a copy of a DataSet that contains rows having the specified DataRowState. The same approach applies to individual DataTables. Orcas's DataSet implementation now includes the ability to generate the DataSet code to another project in preparation for migration to n-tier SOA with the WCF Service template.

Note: See the "N-Tier Support in Typed Dataset" topic in The Visual Basic Team's New Data Tools Features in Visual Studio Orcas post and Steve Lasker's demo of the WCF Service template with split client and server synchronization components in this 12:52 Going N Tier with WCF, Synchronizing data using Sync Services for ADO.NET and SQL Server Compact Edition screencast.

DataSets handle the OCS scenario by persisting an Updategram to the local file system as an XML document (DataSet.WriteXml). When the client boots, it loads the Updategram into the DataSet (DataSet.ReadXml), and tests for network connectivity. If the network is alive, the client attempts to refresh lookup data, process all saved CRUD operations to the data server or service. If not, the client continues with additions to the DataSet, which the user saves manually and the app saves periodically or when closing the main form. I described the process with ADO.NET 1.0 DataSets and SQL Server 2000 in this early "Optimize Update-Concurrency Tests" article for Visual Studio magazine.

This is a scenario that's vastly different from editing an order or medical record in a brower-based form, clicking the Update button, and dealing with the occasional concurrency conflicts caused by other users' edits in the few seconds or minutes between data retrieval and sending updates.

Andres' second post, RE: Disconnected Problems and Solutions, responds to Udi Dahan's Entity Framework: Disconnected Problems & Solutions post. Udi says "I don’t use DataSets that much today anyway." Click here and here for some of Udi's opinions on DataSets.

Most .NET developers aren't partial to DataSets, typed or untyped -- LINQ for DataSet notwithstanding. For example, I've found that the new DataSet.UpdateAll(DataSet) shortcut method has quite poor performance compared to conventional DataSet.GetChanges(Data.DataRowState) code in the Orcas March 2007 CTP.

Update 4/1/2007: Matt Warren sets me straight in his comment on usage of the term disconnected in the LINQ to Entities context. Matt says:

Disconnected objects in LINQ to Entities are not meant to solve the disconnected application problem either. They are merely referred to as 'disconnected' as a means of distinguishing them from actively tracked objects.

Dinesh Kulkarni applies a different definition of disconnected in the LINQ to SQL context in his September 2005 Connected, Disconnected and DLinq post:

Since DLinq is a part of the next version of ADO.NET, it is natural to ask - is it connected or disconnected? After all, we have talked about connected vs disconnected components in ADO.NET quite a bit. DataReader is connected (you are using the underlying connection while consuming the data) while DataSet is disconnected. You need to use DataAdapter to bridge the two worlds. All nice and explicit.

Quite often you need to combine the two modes (as developers do with the DataAdapter + DataSet combo). Wouldn't it be nice if the data access library knew how to provide the benefits of disconnected mode while connecting as and when needed? You would not have the old ADO problems of scalability that ADO.NET solved and yet you would not have to wire all the components explicitly and do all the plumbing yourself. Well DLinq does exactly that.

In this case, disconnected means the database connection is closed while change are made to the cached dataset but reopened in real time when updating the data store.

Update 4/2/2007: I recalled discussions in mid-2006, when the first Entity Framework white papers re-appeared, about . For example, "The ADO.NET Entity Framework: Making the Conceptual Level Real," a revised verision of a presentation to the 25th International Conference on Conceptual Modeling, Tucson, AZ, USA, November 6-9, 2006, by José A. Blakeley, David Campbell, S. Muralidhar, Anil Nori of Microsoft, contains this paragraph:

Occasionally Connected Components. The Entity Framework enhances the well established disconnected programming model of the ADO.NET DataSet. In addition to enhancing the programming experiences around the typed and un-typed DataSets, the Entity Framework embraces the EDM to provide rich disconnected experiences around cached collections of entities and entitysets.

I've found no evidence of support for the client-side persistance of the ObjectStateManager's entity state and updated and original member values in the Orcas March 2007 version of the EF.

Revised Conclusion

In my opinion, nNeither Andres nor Udi deal with totally disconnected operations, disconnected problems or such as OCS. The issue they're addressing is handling potential short-term concurrency conflicts in fully connected systems that have untracked objects.

The Shape of Things to Come

Most folks appear to be writing serial expositions on the same or related LINQ or EF topics, so consider this post to be the first member of the "Concurrency Quartet," with apologies to Lawrence Durrell.

Part II, Change Tracking in the Entity Framework and LINQ to SQL, offers my views about the change tracking and concurrency conflict issues Andres and Udi discuss. It also takes a look at the differences between EF's and LINQ to SQL's approaches to change tracking and concurrency management in the Orcas March 2007 CTP.

Part III, Local Data Caching for OCS with SQL Server Compact Edition, relates my experiences with substituting SSCE for DataSet XML Updategram files as a local data cache.

Part IV will cover issues relating to LINQ to SQL issues with SSCE in the Orcas March 2007 CTP and other trivia.

Technorati tags: , ,

Thursday, March 29, 2007

Entity Framework Updates

Julie Lerman reports in her March 28, 2007 What to expect in next (and future) Orcas bits for Entity Framework post on Brian Dawson's two Entity Framework presentations in Orlando at DevConnections for the SQL Server track:

SMS309: Entity Framework: Part I – Code Past the Depths of ORM Let’s map objects to the database and find out what else awaits with the next generation of the Entity Framework. The Entity Framework provides more than just another ORM solution, although the Entity Framework does that pretty well. Come join a session which dives into lots of code for the sole purpose of making data access even easier. Also see how objects can become web services, and how inheritance works using the Entity Data Model (EDM).

SMS310: Entity Framework: Part II – Dive Even Deeper into Depths of the Entity Framework See how to program against the value layer and go through a more in depth look at navigating through the Entity Framework; see what CSDL, MSL, SSDL means and how LINQ works the new model. Also as a special addition, learn the business value or an answer to the question, “Why should I use the Entity Framework”, not just for programmers, but also for managers.

Brian is the author of the recent Object Services – Write less code post for the ADO.NET Team blog.


Danny Simmons has posted Change Tracking Mechanisms for the Entity Framework, which covers alternative approaches to change tracking. Change tracking is based on values designated as "concurrency tokens."

He also mentioned in A delay before I write more about persistence ignorance... that it might be a while before he responds to the issue of Persistence Ignorance in the Entity Framework.

Danny warns in the thread of my EDM Designer ETA Slipping Past Orcas RTM? thread in the ADO.NET Orcas forum not to use the Orcas March 2007 CTP as the guide to what's coming in the final product:

While it's certainly true that we are locking down, and I can't speak to this particular feature, folks should NOT use the March CTP as their guide for what's going to be in Orcas. The ADO.Net team has been working frantically to get a number of key features completed and in the product, and we already have a large list working that will show up in a future CTP or Beta (not Beta 1 because that's very close to what's in the March CTP, but after that). These features include things like referential integrity constraints, span, ipoco and others that you may have seen mentioned here or in blog postings. There's really quite a lot of great new things yet to come. Keep your eyes open.

Julie describes many of these new features, such as span and IPOCO (Interface to Plain Old CLR Objects) in her What to expect in next (and future) Orcas bits for Entity Framework.

Mark your calendars! .NET Rocks will feature "Daniel Simmons Tours the ADO.NET Entity Framework!" as the 4/5/2007 broadcast.


Julie's mention of the span parameter brought back memories of ObjectSpaces' OPath query language and Matt Warren's ten 2004 and one 2005 GotDotNet posts on the evolution and demise of that unfortunate project. Trade-offs of pre-fetching vs. demand-loading (eager versus lazy loading) of associated (related) entities has been a continuing issue for projects that query object graphs. Matt says in his ObjectSpaces: Spanning the Matrix post of three years ago:

That’s when I hit upon the solution. Like the dot, it was the graph stupid. Object queries needed that additional bit of information that would allow the user to specify exactly what reachable parts of the network should be pre-fetched together. So I took the OPath parser and added an additional context that would allow the specification of a list of properties, and sub-properties and so on that would form a tree of access paths. Anything touched along these paths would trigger a pre-fetch of that data. With a simple list of dot expressions you could easily specify what part of the matrix you wanted to span. ...

Luca [Bolognese] was a bit dubious of the idea at first, but I wore him down. Ever since then, ObjectSpaces has had the span parameter, and yes the name derives from my own ultra-nerdiness. It refers to the span of a space as used in linear algebra. Crack a book if you don’t believe me.

It seems like only yesterday that I was doing my best to learn the ins and outs of programming Orca (Object/Relational Component Architecture?), the code name for the first technical preview of Object Spaces introduced at PDC 2001. ObjectSpaces Microsoft's first (failed) attempt to deliver an O/R mapper; the project ultimately lost its way after being subsumed by long-gone WinFS.


Wednesday, March 28, 2007

Beth Massi Joins Microsoft to Increase MSDN's VB Content

Visual Basic-oriented developers—including me—lament the preponderance of C#-only documentation and code samples in MSDN publications and MSDN blogs. As an example, the C# team has Charlie Calvert whose LINQ Farm and other LINQ-related posts are cited here because of the paucity of corresponding VB articles and posts. Hopefully the tide will turn shortly.

Beth Massi, a well-known East Bay solutions architect, developer and VB proponent (a.k.a. DotnetFox) has joined Microsoft, tasked with "writing content for the Visual Basic Developer Center and promoting the Visual Basic language in the community."

In response to my "Does this mean you're the VB counterpart to C#'s Charlie Calvert?" question, Beth replied:

Yep, that's right. I'll be focusing on getting some killer content up onto the Visual Basic MSDN Developer Center. Keep an eye out!

Already the VB Team blog has a new and detailed Partial Methods post by , which defines them as "a light-weight replacement for events designed primarily for use by automatic code generators."

Update 5/25/2007: Mike Taulty links to Wes Dyer's May 23, 2007 In Case You Haven't Heard post about partial methods in C#. VB developers heard about partial methods two months ago.

It's great to see Microsoft expending more resources on VB topics topics that appeal to a wider audience than beginning and hobbyist programmers. Real developers do write Visual Basic.

Note: Although the article mentions use of partial methods in the "DLINQ Designer" (called the O/R Mapper in Orcas), the classes I've created with the latest version of the O/R Mapper don't appear to use them. Instead, the classes fire ClassName_PropertyChanging and ClassName_PropertyChanged events:

Protected Sub OnPropertyChanging(ByVal propertyName As String)
    If (Not (Me.PropertyChangingEvent) Is Nothing) Then
        RaiseEvent PropertyChanging(Me, New _
            Global.System.ComponentModel. _
            PropertyChangedEventArgs(propertyName))
    End If
End Sub

Protected Sub OnPropertyChanged(ByVal propertyName As String)
    If (Not (Me.PropertyChangedEvent) Is Nothing) Then
        RaiseEvent PropertyChanged(Me, New _
            Global.System.ComponentModel. _
            PropertyChangedEventArgs(propertyName))
    End If
End Sub

Technorati tags: ,

Orcas EDM Wizard and Designer Previewed at VSLive! SFO

Last night the ADO.NET Team posted EDM Wizard and Designer Featured in VSLive! San Francisco Keynote, which briefly describes Britt Johnson's "Data Explosion: The Last and Next Decade in Data Management with the Microsoft Data Platform" keynote. Near the end of the presentation he demonstrated the Entity Data Model (EDM) Wizard and EDM Designer, neither of which made the Orcas March 2007 CTP cut, with a pair of screencasts.

See the 3/29/2007 and 5/21/2007 updates below.

A careful reading of this paragraph from the post:

Britt also featured 5 short videos or screencasts that demonstrated some of the work, specifically around Tools, that the Data Programmability team (including the ADO.NET) has been doing. These videos provide some great information and a preview of the new EDM Wizard coming in Orcas, as well as a sneak preview of a new EDM Designer that we can expect to see released after the upcoming Orcas release [Emphasis added].

indicates that the Orcas RTM bits won't include the EDM Designer. Frans Bouma and I have added questions about this to the post's comments. I also asked the same question in the ADO.NET Orcas forum.

A similar post in the Data Programmability Team blog has a slightly expanded list of new features and screencasts:

These videos provide some great information and a preview of the new XML Editor, XSLT Debugger, and EDM Wizard coming in Orcas, as well as a sneak preview of a new XSD Designer and EDM Designer that we can expect to see released after the upcoming Orcas release.

Elisa Johnson's VSLive Keynote - San Francisco post of the same date says:

During his presentation Britt talked a lot about Conceptual Data Programming and where Microsoft plans to focus on for future innovation in the Data Access space. He also gave a sneak peak at two tools that hadn't previously been seen... the much anticipated EDM Designer and the XSD Designer (you can expect to see more on these sometime after the upcoming Orcas release).

A working preview of the EDM Designer debuted in September 2006; my October 4, 2006 New Entity Data Model Graphic Designer Prototype post provided a walkthrough with the Northwind database.

Sanjay Nagamangalam, the ADO.NET Program Manger who presented the EDM Designer screencast, posted on March 3, 2007 the following message in the ADO.NET Orcas forum:

An EDM designer is foremost on our minds and we are looking to provide a tool for Beta 1. We don’t have a date yet though.

Of course, the message was accompanied by the usual "This posting is provided 'AS IS' with no warranties, and confers no rights" disclaimer.

Shades of ObjectSpaces. Déjà vu all over again. Please say it isn't so.

Update 3/28/2007: Visual Studio Magazine writer Lee Thé writes in his "Microsoft Moves DBMS into the VS Developer Mainstream" article that covered Britt Johnson's keynote:

The final demonstration featured an entity data models (EDM) Wizard that generates classes from the conceptual model. But the portion of this demo that roduced spontaneous applause from the audience was an EDM designer functionality that will not be available in the Orcas beta release. This hotly anticipated functionality is a database designer and an entity modeler. These features let you map a database to a model, keeping the model in sync. The project manager leading this demonstration created a user entity type from an users' table with drag-and-drop functionality, where glyphs showed mapping of entity type to table. Sophisticated graphical representations of entities and relationships enabled the user to work at the level of the business relationships rather than programming abstractions. [Emphasis added]

It remains to be seen if Lee's report is correct. Stay tuned for Microsoft's official confirmation or denial of the EDM Designer's disappearance from Orcas.

Note: Lee's report on VSLive!'s Monday keynote, "Windows Vista, the 2007 Office system, and ASP.NET AJAX" by Prashant Sridharan is here, and his coverage of K. D. Hallman's general session address, "Visual Studio Everywhere: Tools for Office, Office Business Applications, and Custom Application Extensibility," for Redmond Developer News is here. Click here to read the March 28, 2007 VSLive! Show Daily.

InfoWorld's Paul Krill mentions the EDM Designer in his March 27, 2007 "Microsoft maps data management plans" article without discussing the Designer's future availablity. He notes that the EDM Wizard, XSD Designer, and XSLT Debutter are slated for the Orcas Beta release in May. Elisa Johnson says that The XSD Designer will arrive post-Orcas.

Kevin Hoffman complains bitterly in his Microsoft finally shows off their EDM designer... but it won't ship with Orcas?!? post about the apparent demise of the EDM Designer.

Update 5/21/2007: The 1:04:00 video of Britt Johnson's keynote is available here. Click here for Prashant Sridharan's keynote video.

Update 3/29,2007: Julie Lerman—2,500 miles from San Francisco at the DevConnections conference in Florida—reports in What to expect in next (and future) Orcas bits for Entity Framework :

Britt Johnston did a keynote and showed [a video of] the latest prototype of the EDM Modeler and also let us know that it won't be ready for Orcas but they plan to release it shortly after Orcas. This is really frustrating, but it is just the reality and as developers we know the difficulties of designing tools... so it is what it is and until we have it, I will learn a LOT with the XML and personally hold off on doing any seriously complex modeling. [Emphasis added.]

Pending official word from Microsoft, I'm inclined to believe Julie's rendition, although telepathy might be involved. I'm still waiting for someone from the ADO.NET team to post an official response, either as a blog comment or an answer to my question in the ADO.NET Orcas forum.

Note: There's more from Julie's report on Brian Dawson's two Entity Framework presentations at DevCon in her post.

Tuesday, March 27, 2007

Third-Party LINQ Providers

Following is a short list of the third-party LINQ providers I've found to date in more-or-less chronological order:

  • LINQ to WebQueries by Hartmut Maennel handles searches in the SiteSeer and MSDN Web sites. (This provider predates Fabrice's LINQ to Amazon provider by a few days.)
  • LINQ to Amazon by Fabrice Marguerie, a co-author of the forthcoming LINQ in Action book, was the first third-party LINQ provider that I know of. LINQ to Amazon returns lists of books meeting specific criteria.
  • LINQ to RDF Files by Hartmut Maennel handles queries against Resource Description Format files' triples. Part I of the two-part post is here.
  • LINQ to MySQL by George Moudry, based on the LINQ May 2006 CTP, was in the development stage as of January 2007, but George says it's "capable of simplest queries and updates" and "now has support for most primitive joins."
  • LINQ to NHibernate by Ayende Rahien (a.k.a. Oren Eini) translates LINQ queries to NHibernate Criteria Queries and is based on the Orcas March 2007 CTP. The documentation that describes development of the provider presently is at the Part 1 stage.
  • LINQ to LDAP by Bart de Smet is a "query provider for LINQ that's capable of talking to Active Directory (and other LDAP data sources potentially) over LDAP." As of 4/11/2007, Bart's "IQueryable Tales - LINQ to LDAP" consisted of Part 0: Introduction, Part 1: Key Concepts, Part 2: Getting Started with IQueryable, Part 3: Why do we need entities?, Part 4: Parsing and executing queries, and Part 5: Supporting Updates.
  • LINQ to Flickr by Mohammed Hossam El-Din (Bashmohandes) uses the open-source FlickrNet C# library as its infrastructure.
  • LINQ to Google Desktop by Costa Rican programming language enthusiast Luis Diego Fallas supports GDFileResult and GDEmail types. A subsequent Adding support for projections to Linq to Google Desktop implements the LINQ Select expression.
  • LINQ to SharePoint by Bart de Smet supports writing LINQ queries for SharePoint lists in both C# 3.0 and Visual Basic 9.0 and communicates with SharePoint via Web services or though the SharePoint Object Model. The SpMetal command-line utility automates C# or VB class generation.
  • LINQ to Streams (SLinq, Streaming LINQ) by Oren Novotny processes continuous data streams, such as stock tickers or sensor data. The project's home page on CodePlex includes an animated GIF simulation of a stock ticker displayed in a DataGridView. The current version supports Select, Where, Order By, and Descending only.
  • LINQ to Expressions (MetaLinq) by Aaron Erickson (the developer of Indexes for Objects a.k.a i4o*) lets you query over and edit expression trees with LINQ. Like .NET strings, LINQ expression trees are immutable; the only way you can change a LINQ expression tree is to make a copy, modify the copy, and then replace the original. MetaLinq's ExpressionBuilder lets you create an "Editable Shadow of an expression tree, modify it in place, and then by calling ToExpression on the shadow tree, generate a new, normal, immutable tree." ExpressionBuilder is an analog of the .NET StringBuilder.

* i4o isn't a LINQ provider, per se, but a helper class that can increase the speed of LINQ queries against large collections by a factor of 1,000 or more. InfoQ published on June 22, 2007, Aaron Erickson on LINQ and i4o, an interview of Aaron Erickson by Jonathan Allen about i4o's purpose and background.

Ayende observes:

There is an appalling lack of documentation about how to implement LINQ providers. ... I decided to document what I found out while building LINQ for NHibernate.

However, the "appalling lack of documentation" hasn't thwarted the work of third-party LINQ providers for specialty data domains. A search of the CodePlex site on LINQ returned 15 projects as of 6/3/2007.

If you know of other third-party LINQ providers in development, please leave a comment.

Thanks in advance.

Update 3/29/2007: .NET Rocks features "Oren Eini On NHibernate and RhinoMocks!" as its 3/29/2007 broadcast. LINQ to NHibernate might become a much more popular LINQ provider if the ADO.NET Team doesn't finish the EDM Designer by Orcas RTM. The interview with Oren starts at 11:00. (Thanks to Danny Simmons for the heads-up.) .NET Rocks TV (dnrTV) taped an instructional video interview with Oren on January 25, 2007.

Update 4/7/2007: Added Bart de Smet's LINQ to LDAP project, which includes extensive IL code inspection of LINQ queries.

Bobby Diaz has extended Ayende's initial Part 1 From ... In ... Where ... Select implementation with Part 2: Ordering and Paging (adds Order By, Then By, OrderByDescending, ThenByDescending, Take, Skip, and Distinct) and Part 3: Aggregate and Element Operators (adds First, FirstOrDefault, Single, SingleOrDefault, Average, Count, LongCount, Max, Min, and Sum.) The momentum is building behind LINQ to NHibernate.

Update 4/11/2007: Added Mohammed Hossam El-Din's LINQ to Flickr provider and updated LINQ to LDAP with parts 4 and 5.

Update 5/6/2007: Added Bart de Smet's LINQ to SharePoint project, version 0.1.2.0 Alpha release.

Update 5/12/2007: Added Helmut Maennel's early LINQ to WebSearch and LINQ to RDF Files providers. I haven't tested these providers with later LINQ implementations.

Update 6/3/2007: Added Oren Novotny's LINQ to Streams (SLinq) and Aaron Erickson's LINQ to Expressions (MetaLinq) and Indexes for Objects (i4o).

Update 6/11/2007: Added Luis Diego Fallas' LINQ to Google Desktop of May 11 and 12, 2007, which I had missed.

Update 7/22/2007: Added link to inteview with Aaron Erickson about i4o.

Update 8/7/2007: Aaaron Erickson has written "Indexed LINQ" for .NET Developer's Journal. Subtitiled "Optimizing the performance of LINQ queries using in-memory indexes," the article covers the theory behind creating indexes on in-memory collections and applying an extension method to the Where() standard query operator to enable speeding queries by up to a factor of 100 or so with the indexes. You can download the source code, runtime binary or both for i4o at http://www.codeplex.com/i4o.

Angel Saenz-Badillos on LINQ Extensions

A search on "does not contain a definition" AsEnumerable turned up a February 23, 2007 does not contain a definition for post by Angel Saenz-Badillos, a "voice from the past." During the Whidbey beta, Angelsb had been an indispensable source of information on ADO.NET esoterica, such as Multiple Active Result Sets (MARS), connection/session pooling, asynchronous command execution, transactions, and SQLCLR user-defined types.

He and Pablo Castro saved me many hours of headscratching while writing books and magazine articles before Visual Studio 2005's RTM. Angelsb's posts and responses to forum questions have always been marvels of lucidity and completeness, despite their exclusive use of C#.

During his year or more of what I call exile in the Lotusland of JDBC, I had turned off Angelsb's RSS feed. Now I find he's working on LINQ extensions, specifically LINQ to DataSet and LINQ to Entities.

His February 23 post explains how to overcome in LINQ to DataSet code the

'System.Data.DataTable' does not contain a definition for 'AsEnumerable' and no extension method 'AsEnumerable' accepting a first argument of type 'System.Data.DataTable' could be found (are you missing a using directive or an assembly reference?)

and

The type arguments for method 'System.Linq.Enumerable.AsEnumerable<TSource>(System.Collections.Generic.IEnumerable<TSource>)' cannot be inferred from the usage. Try specifying the type arguments explicitly

exceptions by adding using/Imports System.Linq to your class and a reference to System.Data.Entity.dll to your project.

I'm looking forward to las joyas de Saenz-Badillos and, needless to say, have added his feed to my growing list of LINQ-related blogs. Recepción a bordo.

P.S.: Apparently, Julie Lerman was having the same problem as I. Her March 5, 2007 LINQ and Entity Framework Resources for March Orcas CTP post was the second hit of my search.

Monday, March 26, 2007

Updated "Overview of Visual Basic 9.0" Stealth Post

Microsoft recently published a February 2007 update to "Overview of Visual Basic 9.0" by Erik Meijer, Amanda Silver and Paul Vick as a Visual Studio 2005 Technical Article. The update's timing obviously is tied to the Orcas March 2007 CTP release, which occurred in late February. The first reference I've seen to it was by Beth Massi (a.k.a, DotnetFox) on February 9, 2007 in the Hooked on LINQ wiki, although it's possible that the reference could be to an earlier version.

I use the term stealth post because none of the authors or the Visual Basic Team has mentioned the updated version publicly, as far as I can determine. Following are the results of searches I ran to find references to the February 2007 version:

Note: Jim and I discovered the February 2007 version from the link in Bill McCarthy's blog of yesterday.

Updated documentation for the language extensions to Visual Basic 9.0 is important, at least to VB programmers, although the Orcas March 2007 CTP include VB-specific topics for anonymous types, object identifiers, and query expressions, as well as a substantial number of LINQ-related online help topics.

The lack of links to the Overview's February 2007 version is surprising, considering that one of its authors, Paul Vick, is an active blogger and Amanda Silver posts to the Visual Basic Team blog occasionally. Could the reason for the lack of links be that the authors aren't proud of their work?

Issues with the February 2007 Version

Jim Wooley takes issue with some of the content of the February 2007 update in today's VB 9.0 documentation post:

I took a couple minutes looking it over and it does give a quick glimpse of the basic underlying concepts that hopefully are coming. Unfortunately, there are a number of items in the documentation that don't appear to be included in the current [Orcas March 2007] CTP. I am definitely hoping that they do make it in the next drop. The features that are discussed but not yet included are: Joins, Lambdas, and [shorthand DateTime? syntax for] Nullable types. In addition, the samples seem to use an Auto-Implemented Property syntax as introduced in the current C#, but reading more closely, they are just using a pseudo code syntax. [Emphasis added].

Jim then adds details about the three missing features.

Comparison with and of Previous Versions

The February 2007 version contains the following topic list:

  • Introduction
  • Getting Started With Visual Basic 9.0
  • Implicitly Typed Local Variables
  • Object and Array Initializers
  • Anonymous Types
  • Deep XML Support
  • Query Comprehensions
  • Extension Methods and Lambda Expressions
  • Nullable Types
  • Relaxed Delegates
  • Conclusion

The previous version was first published as a Microsoft Word file by the same authors in September 2005. The LINQ May 2006 CTP contained an updated May 2006 version of of the September 2005 release. The topic lists were the same for both versions:

  • [Getting Started with VB 9.0]
  • Implicitly typed local variables
  • Query comprehensions
  • Object initializers
  • Anonymous types
  • Full integration with the Linq [sic] framework
  • Deep XML support
  • Relaxed delegates
  • Nullable types
  • Dynamic interfaces
  • Dynamic identifiers
  • [Conclusion]

The primary differences between the two previous versions, determined by running a compare operation between the two .doc files with Microsoft Word, were minor syntax changes and adoption of the C# syntax/sequence (From ... Select) for LINQ queries. There were 127 deletions and 117 insertions, most of which were one or a few characters.

Jim Wooley's Converting from VB LINQ to Orcas post documents the manual changes required to make his LINQ May 2006 samples run with the Orcas March 2007 CTP LINQ implementation.

Update 3/28/2007: Beth Massi, who's taken a new job at Microsoft "writing content for the Visual Basic Developer Center and promoting the Visual Basic language in the community," notes in a comment that the What’s New in Visual Basic 9.0? link on the main Visual Basic Developer Center page links to the updated post. However, it's my recollection that this link formerly pointed to earlier version(s) and there's no indication that the information was recently updated. Beth says there will be pointer to the doc in a future VB Team post.