Saturday, March 15, 2008

LINQ and Entity Framework Posts for 3/10/2008+

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

SQL Server Data Services Team Promises Tech Docs "Soon"

KellyAlt of the SSDS team says in the When will we release the Technical Documentation? post of March 15, 2008:

I talked to our lead about this and we are working on releasing the technical documentation soon.  Keep you[r] eye on this blog as I will post it as soon as the documentation goes live.

Added: March 15, 2008

Eugenio Pace Starts a Series on the LitwareHR Demo on SQL Server Data Services

As mentioned in the "Eugenio Pace: SQL Server Data Services - SSDS - New version of LitwareHR" topic of the Spelunking SQL Server Data Services post of March 9, 2008, Eugenio ported the LitwareHR hosted multi-tenant demo app from SQL Server 2005 to SSDS.

His LitwareHR on SSDS - Part I - Multi-tenancy & Flexibility post of March 14, 2008 explains SSDS's Authority-Container-Entity (ACE) storage architecture and how LitwareHR uses it to store individual Position and Resume entity sets for each tenant. He concludes:

In the next chapters, I will go deeper into LitwareHR on SSDS architecture, the challenges we faced and how we solved them.

Added: March 15, 2008

Ruurd Boeke Adds Complex Types to His IPOCO Entity Framework Implementation

The "Ruurd Boeke Continues His Postcompiling for Entity Framework Series" topic of my LINQ and Entity Framework Posts for 2/18/2008+ post describes Ruurd's Entity Framework Contrib (EFContrib) project that uses PostSharp to create a clean IPOCO interface to an Entity Data Model.

Here's an updated list of his posts on the topic:

Ruurd's Complex types in EF, how they work and support in EFContrib of March 14, 2008 describes his newly added support for complex types (a.k.a., value types) with PostSharp.

Added: March 15, 2008

Samir Bajaj Creates a Drawing Editor Demo with LINQ to SQL and Entity Framework

Samir, who's a developer on the ADO.NET team, has uploaded to the MSDN Code Gallery a SketchPad demo app that let's you choose between LINQ to SQL and Entity Framework as a spatial data source for a simple drawing program. You choose the Entity Framework data source (to implement a the strategy pattern) by adding a command-line switch when starting the program.

Although Samir mentions SQL Server 2008's spatial data types (GEOMETRY and GEOGRAPHY) he explains in his SketchPad: A Simple Drawing Editor post of March 14, 2008 that he built a custom spatial layer for his app. You must restore a SQL Server 2005 database backup file, Cars.bak, from the project (\SketchPad) folder with SQL Server Management Studio to run the application.

A more sophisticated that uses the GEOMETRY data type would be interesting. However, it appears that the the LINQ to SQL team only intends to include the DATE, TIME, DATETIME2 and DATETIMEOFFSET data types their update. Danny Simmons says in a comment to Faisal Mohamood's Coming soon to LINQ to SQL post of February 21, 2008:

It won't, unfortunately, support the new spatial data types.  That's something which will have to come at a later time.

Added: March 15, 2008

Zlatko Michailov Explains the Entity Framework's Connection String Builder

The Entity Framework has an EntityConnectionStringBuilder for the EntityClient class that's similar to the ADO.NET 2.0 ConnectionStringBuilder. Zlatko's March 14, 2008 Primer to EntityConnectionStringBuilder post provides a brief introduction to it and a sample program to demonstrate its use.

Alex James previously connection strings for Entity Data Models in his November 2007 Using a random model at runtime and EntityConnectionStringBuilder posts.

Added: March 15, 2008

Eric White Demonstrates Open XML's New Annotation Feature with LINQ to XML

Annotations enable attaching a LINQ to XML XDocument to an Open XML document part instead of, for example, in an in-memory dictionary. His Technical Improvements in the Open XML SDK post of March 13, 2008 includes a sample LINQ to XML extension method for calling any OpenXmlPart object.

For a primer on using LINQ to XML with Open XML documents, see Mehfuzh's OpenXML to parse your office documents of March 15, 2008. Mehfuzh is the author of LINQ to Flickr and LINQExtender.

Added: March 15, 2008

Ryan Dunn Explains SQL Server Data Service's Query Model

His SSDS Query Model post of March 13, 2008 covers the basics of SSDS v1's current query model with the following topics:

  • Design Decisions
  • The Query Model: Syntax, Property, Operator, Constant Paging
  • Pulling It Together
  • Limitations Today

As to limitations, Ryan says:

The queries are fairly simple.  There is no capability for cross-container queries or joins of any type today.  There are no group by operators, or order by functionality.  There is also no "LIKE", Contains, BeginsWith, or EndsWith functionality.

I have to stress however, that this is a starting point for the SSDS query API, not the final functionality.

The initial offering appears somewhat rudimentary when you consider the capability of the underlying RDBMS. So far, I haven't heard the proposed method of bulk-inserting entities. I assume that the Microsoft Replication Framework could handle this task with a undirectional update operation.

Added: March 13, 2008

Mircea Trofin: LINQ Framework Design Guidelines

Mircea's a Program Manager at Microsoft who's compiled a set of LINQ Framework Design Guidelines in a March 13, 2008 blog post. Microsoft framework czar, Krzysztof Cwalina, plans to incorporate them into Framework Design Guidelines manuscript. Here's a brief table of contents:

  • A Brief Overview of LINQ
  • Extension Methods, Func<>, Action<>, and Expression<>
  • Extending on LINQ
  • Extending IEnumerable<>
  • Extending IQueryable<>
  • Implementing the Query Pattern

His guidelines for the use of extension methods have applicability wider than LINQ.

Added: March 13, 2008

Priyang Patel Interviews Perry Birch about N-Tier LINQ to SQL Architecture

Priyang's VSLive! San Francisco Preview: LINQ to SQL Q&A with Perry Birch post of March 13, 2008 is an interview with Perry Birch, who's presenting the "Practical DLinq - NTier Web Application Development" session at VS-Live! San Francisco for the ASP.NETLive! Track 2 on Wednesday, April 2. Here's the abstract of his session:

DLinq, a component of the LINQ Project, provides a run-time infrastructure for managing relational data as objects without giving up the ability to query. It does this by translating language integrated queries into SQL for execution by the database and then translating the tabular results back into objects you define.
Your application is then free to manipulate the objects while DLinq stays in the background tracking your changes automatically.

In this session we will be exploring the DLinq engine and tools by implementing a simple N-Tier Web Application. The technology stack that will be used includes MS Sql, DLinq, WCF and ASP.Net.

It sounds like Perry accomplished what the LINQ to SQL team couldn't deliver in v1: an n-tier implentation.

Added: March 13, 2008

George Moore Outlines Unified Storage Protocols Based on AtomPub and ADO.NET Data Services

George Moore's A Unified Standards-Based Protocols and Tooling Platform for Storage from Microsoft of March 12, 2008 is a formalization of the parts of David Treadwell's pre-MIX08 post of February 27, 2008 that I discussed in my SQL Server Data Services to Deliver Entities from the Cloud and Atom and AtomPub Support Extended to Windows Live Photos and Application Based Storage posts. The ADO.NET Data Services Framework is central to the new services.

The main points of George's message are:

For the first time ever we have a unified protocol and developer tooling story across most of our major storage products from Microsoft:

The unified on-the-wire format is Atom, with the unified protocol being AtomPub across all of the above storage products and services. For on-premises access to SQL Server, placing an AtomPub interface on top of your data + business logic is ideal so that you can easily expose that end point to everybody that wants to consume it, whether they are inside or outside your corporate network. ...

[T]he most efficient programming comes from the highest levels of abstraction provided by ADO.NET Data Services (aka “Project Astoria”) which provide LINQ statements for .NET against any of the above on-premise or cloud-based storage endpoints. ...

And finally, layered on top of all these formats, protocols, and tools is a unified synchronization framework based upon the FeedSync extensions to the AtomPub protocol. The FeedSync specification is available under the Creative Commons Attribution License and the Microsoft Open Specification Promise. Also revealed at MIX is the Microsoft Sync Framework which provides an extensible model for online/offline synchronization and replication of any data source across any device on any network topology. Completing the sync picture is “Astoria Offline” which utilizes the Sync Framework to provide direct synchronization against any ADO.NET provider, including the storage services described at the beginning of this post.

Extension of the AtomPub protocol and Astoria's data access capabilities to these Windows Live services is a step in the right direction. It's also undoubtedly responsible for adding the Framework suffix to ADO.NET Data Services and removing the Web prefix from several classes.

George Moore is the General Manager of Live Platform Services.

Added: March 13, 2008

SQL Server Data Services Team Wants Feedback on SSDS Documentation and Open-Source Client Development

Soumitra Sengupta's In the spirit of open discussions . . . post of March 12, 2008 asks the following questions about the SQL Server Data Services (SSDS) team's developer support program:

  1. Should we post our technical and service interface documentation on the SSDS site? 
  2. What benefit would that provide to developers who are not yet part of the "invitation only" beta?
  3. If you are an open source developer building applications using Java, Ruby or PHP on Linux, what would make SSDS interesting to you? 
  4. Should we release code samples to help you along or should we release libraries and support those libraries? 
  5. How does it matter that the service is built using Microsoft products like Windows Server and SQL Server? 

The post also provides additional insight into the business issues raised by recent articles about SSDS, especially "cannibalization" of the SQL Server market by SSDS. 

The article to which Soumitra refers probably is Computerworld's "Cloud database vendors: What, us worry about Microsoft?" by Eric Lai, duplicated in The Industry Standard, which quotes Pankaj Malviya, CEO of Sunnyvale, Calif.'s LongJump Inc.:

The question for Microsoft is: Will its hosted solutions cannibalize their on-premise solutions business, and which approach will take precedence?

Industry pundits asked the same question when the SQL Server team released MSDE 1.0 and 2000, as well as SQL Server 2005 Express; SQL Server has continued to experience high growth rates.

My answers to the questions:

  1. Absolutely.
  2. It would enable developers excluded from the first, invitation-only, beta to determine their level of interest in the later public beta.
  3. I'm not an open-source developer but SSDS would interest me because, unlike Amazon's SimpleDB, SSDS has numeric, datetime, boolean and binary data types. Using string semantics for numeric values is particularly cumbersome.
  4. I'd suggest initial code samples for REST semantics for Ruby and PHP because Astoria-style typing isn't a major issue for dynamic languages. Presumably IronPython and IronRuby could use the ADO.NET Data Services runtime assemblies with the DLR. Java developers probably would want a library.
  5. Assuming service charges similar to SimpleDB for an equivalent SLA, I'd say it's a plus to have SQL Server as the "operating system," rather than Erlang, because SQL Server has the potential to offer more sophisticated data types and data-related services in the future, perhaps as "premium" versions. The Sync Framework is a definite benefit for Windows developers.

Added: March 13, 2008

LINQ to XPO Available for eXpress Persistent Objects for .NET

DevExpress's eXpress Persistent Objects for .NET (XPO) is a "transparent" object/relational mapping (O/RM) tool which generates by default an Access (!) database in your project's root directory from the domain objects you design. (This feature was planned for the ADO.NET Entity Framework but was dropped in v1.)

DevExpress announced the availability of LINQ to XPO in XPO v7.3 on March 12, 2008. You can download a sample project from the announcement page. It's not clear from the DevExpress Knowledge Base article if LINQ to XPO supports all LINQ Standard Query Operators, but the sample project contains queries that use Take(), Join(), Count(), Average(), and Any().

Note: XPO supports all popular RDBMSs.

Added: March 12, 2008

Mike Taulty Verifies that ADO.NET Data Services Returns Identity Values on POSTs

In his ADO.NET Data Services - Identity columns and id values on the client of March 12, 2008, Mike describes a simple project for an SQL Server table named test with id (int identity PRIMARY KEY NOT NULL) and someColumn (nvarchar(30) NOT NULL) columns. Adding a new record by invoking the .AddObject("test", newTestRecord) and .SaveChanges() methods (with MergeOption.OverwriteChanges set) returns the new id value of the row to the "test" entity.

Added: March 12, 2008

Justin Etheredge Shoehorns LINQ to SQL into His Custom Data Layer

Justin's Fitting Linq To Sql into a real world datalayer post of March 10, 2008 describes how he adapted LINQ to SQL with:

  • A base class for his business objects
  • Classes in different namespaces
  • Mappings in an handcrafted XML file to avoid attributes on business objects
  • Wrapper classes to make base class properties work.

Graciously, he offers his source code for the project for download.

Three Open Space Videos about SQL Server Data Services

Jason Hunter and Jeff Currier on SQL Server Data Services is a 39:05 session entitled "SQL Server Data Services Patterns and Practices" with a very noisy audio track. Jason is a Principal Development Lead for SSDS and Jeff is an SSDS Software Design Engineer, so this session provides a deep dive into the client-side source code for accessing data from SSDS. Unfortunately, the code isn't readable but Jason and Jeff promise to post it on the SSDS blog site for inspection.

Istvan Cseri on SQL Server Data Services is a 10:42 interview by Ryan Dunn of one of SSDS's two initial data architects (Peter Spiro, a Microsoft Technical Fellow, is the other). Istvan discusses the "flexible entity" approach that claims to eliminate the need for the traditional relational database schema. An entity is a type (property bag of name/value pairs) that you can change on the fly by adding new properties or different data types. SSDS offers string, numeric, date/time, boolean and binary data types. He describes the hierarchy of Authorities (namespace), Containers (entity collections) and Entities (ACE) for storage.

Alfred Biehler Talks About SQL Server Data Services is 3:52 monologue about the business case for SSDS by a Microsoft UK lead for a "<Censored>" product, presumably SSDS. Here's a link to his Spaces profile.

These videos appeared over the weekend.

IdeaBlade Offers Downloadable Beta of DevForce Entity Framework

DevForce Entity Framework (DevForce EF) is adaptation of IdeaBlade's original DevForce framework to use parts of the Entity Framework to map from a relational data store to the Entity Data Model (EDM). The abstract of their LINQ and the DevForce Entity Framework white paper says:

DevForce ® from IdeaBlade, Inc. is a framework for building and operating multi-tier, data-driven enterprise applications. DevForce is especially suited to applications that require a Windows-like experience delivered to remote, often Internet connected, clients. DevForce facilitates rapid development without sacrificing power, performance, or flexibility.

Microsoft is launching some exciting technologies in 2008 in concert with version 3.5 of the .NET framework. Language Integrated Query (LINQ) and the ADO.NET Entity Framework will improve the developers ability to manage application data in object-oriented fashion.

This paper describes what these technologies do well – and how they fall short of what enterprise application developers actually need.

DevForce EF, whose release will coincide with Microsoft's .NET 3.5 launch, addresses these shortfalls head on. It starts by leveraging and extending them with the DevForce to Entities query language and the DevForce Entity Framework. [Emphasis added.]

You can register for the beta and view a Webinar or PowerPoint slide deck here.

Thanks to Julie Lerman for the heads-up on this interesting EF adaptation and the following site. Keeps You Up To Date with All Things .NET Data-Related

I hadn't seen the site until Julie's March 10, 2008 post. In addition to recent posts on the home page, it offers these categories:

  • Hot Topics: Pointers to news, interesting blog posts, forum threads, articles, Webcasts and more
  • Articles: Original content and links to articles elsewhere
  • Tutorials: Get up and running on specific data access functions with these Tutorials
  • Videos: Learn data access techniques by watching these screencasts
  • Resources: Community Sites, Forums, Bloggers and Books
  • Authors: Contributors to the website

This site covers a wider range of topics than the OakLeaf blog. Most abstracts are a bit shorter than those here.

The link to DataDeveloper's RSS feed is on the Hot Topics page.


C# Version of Jim Wooley's Personal Web Starter Kit is Available

His LINQ enabled Personal Web Starter Kit in C# post of March 9, 2008 describes the port and provides links to the original VB and the new C# version.