Tuesday, April 29, 2008

LINQ and Entity Framework Posts for 4/28/2008+

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

Matt Davey: Investment Banking Needs PLINQ

In his Parallel Extensions to the .NET Framework article of April 23, 2008 for Dr. Dobbs Portal, financial services developer Matt Davey discusses Microsoft Research's Dryad Network and DryadLINQ and suggests using a C# 3.0 extension method to use PLINQ to submit work to a DigiPede Distributed Computing Network. Matt concludes:

Sitting in the financial vertical, PLINQ can't be released quickly enough. As long as banks understand the implications, PLINQ will improve the trading cycle. Microsoft, however, needs to continue to push in the concurrency field, making developers' lives easier by giving them access to cores locally as well as remotely, and ensuring that the development/debugger tools keep up with the library as it advances.

Added: 4/29/2008

Julie Lerman Creates an Extension Method to Visualize EntityStateObjects

Julie's An extension method for visualizing EntityStateObjects post of April 29, 2008 shows the design and provides the source code to simulate a debugger visualizer for the current EntityStateObject. The EntityStateObject isn't serializable, so she wrote an extension method with the DEBUG ContitionalAttribute to prevent it from appearing at runtime.

Bravo, Julie! And thanks for the source code.

Added: 4/29/2008

Rob Conery Implements a Repository+ Pattern by Passing Out an IQueryable<T>

Rob starts a controversy by redefining the Repository pattern to a Repository+, which outputs IQueryable<T>. With help from Oren Eini (Ayende Rahien), Rob adds a LazyList<IQueryable<T>> to provide lazy-loading generic list without relying on LINQ to SQL's built-in lazy loading feature.

He then goes on to discuss with John Galloway the use of HTML and CSS in ASP.NET MVC to create a UI for the project replacing tables with divs for layout.

Added: 4/29/2008

Randolph Cabral Continues His LINQ to SQL n-Tier Series

Exploring N-Tier Architecture with LINQ to SQL (Part 2 of n) of April 29, 2008 proposes wrapping a LINQ to SQL NorthwindDataContext object with a NorthwindBusinessContext to decouple the DataContext from the business layer and adds GetCustomerById() and PersistState() methods to more closely resemble the ActiveRecord pattern.

Added: 4/29/2008

Google Engineer Admits the App Engine Has Latency Problems Reading and Writing Datastore Entities

Perhaps apps running on the Google App Engine aren't as scalable as one might assume. According to Ken Ashcroft, a Google software engineer, who wrote Tips on Writing Scalable Apps of April 29, 2008:

    • Avoid contention on datastore entities. If every request to your app reads or writes a particular entity, latency will increase as your traffic goes up because reads and writes on a given entity are sequential. One example construct you should avoid at all costs is the gobal counter, i.e. an entity that keeps track of a count and is updated or read on every request. There are some interesting ways of simulating this behavior that don't require reads/writes on every request, and we'll talk about a handy way to cache entities for reads below.
    • Avoid large entity groups. Any two entities that share a common ancestor belong to the same entity groups. All writes to an entity group are sequential, so large entity groups can bog down popular apps quickly if there are a lot of writes to that group. Instead, use small, localized groups in your design.
    • Write sparingly. Writes are more expensive than reads; keep this in mind when designing your data model. If you can avoid a write--it's best to do so.

Added: 4/29/2008

Charlie Calvert Seeds the LINQFarm with an IEnumerable<T> Series

C# community evangelist Charlie Calvert starts another multipart LINQFarm series with LINQFarm: Understanding IEnumerable<T>, Part I, which (as you'd expect) covers the IEnumerable<T> interface.

The second member of the series promises to answer "What is it about IEnumerable<T> that makes it a useful data source and return type for LINQ to Objects queries?"

Added: 4/29/2008

Phil Wainewright Translates Steve Gillmor's Live Mesh Accolade

Phil's Gillmor: Why Google should worry about Live Mesh post of April 28, 2008 summarizes Steve's sometimes rambling 1,000+ words from his surprisingly effusive TechCrunch article, Microsoft Says Yes With Mesh of April 27:

Other commentators have dismissed Mesh as simply a mechanism to protect Microsoft’s desktop-bound assets, but Steve turns that around and points out that what Mesh is really about is connecting the desktop into the cloud (Meshing the desktop into the cloud, as I wrote last Thursday).

Call it self-serving if you like, but Microsoft needs a bridge that will carry its existing market presence over into the cloud and Mesh is that bridge. You could equally call it customer-friendly: Microsoft users will likely be pleased to have a mechanism that helps them make that transition without orphaning their desktop and on-premise IT assets.

Robert Scoble has a shorter translation in Mind Meshing with Steve Gillmor of April 27, 2008:

The only good excuse I’ve heard so far why Microsoft Mesh isn’t interesting is “I hate Microsoft.”

That’s a tough thing to overcome, but I thought Steve Gillmor was one of those who hated Microsoft too. After all, he bought a Mac and kept repeating on his blog “Office is dead.”

But, let’s translate Gillmor: Microsoft Mesh is fascinating. Agreed.

Steve didn't sound all that enthusiastic about Live Mesh during the Gillmor Gang's interview podcast with Dave Treadwell that I reported in the "Sync Guru (Rafik Robeal) Questions the Problems Live Mesh Will Solve" section of LINQ and Entity Framework Posts for 4/21/2008+.

Note: If you're wondering why Live Mesh is germane to the usual topics of this blog, it's because it includes a LINQ implementation ("LINQ to Mesh") and of the potential interaction of Live Mesh with ADO.NET Data Services and SQL Server Data Services (SSDS) as a primary data sources. (Updated 4/29/2008)

Update 4/29/2008: Ori Amiga attempts (but fails) to execute a LINQ to Mesh query against Mesh objects at 47:25 into the Ori Amiga: Programming the Mesh Channel 9 video segment of April 24, 2008. Starting at about 50:00, he shows the code for a typical LINQ query and mentions that the Mesh team is working with the Astoria folks to make sure their query and URL syntaxes are the same.

Other Channel9 videos about Live Mesh:

Bart DeSmet Follows Up on His TechDays Sessions on IQueryable

His Q: Is IQueryable the Right Choice for Me? post shows you how to:

[C]reate your own query pattern implementation by means of instance methods ... by providing an entry-point like Table<T> and further providing a fluent interface pattern that produces Query<T> objects in a chained manner.

as an alternative to implementing IQueryable<T>.

It's nice to see Bart returning to posts about LINQ.

Dinesh Kulkarni Has Resumed Posting about LINQ to SQL

After more than six months of silence following his move "I have moved to another project with the developer division at Microsoft (more about that on a sunny day)" reported in his LINQ to SQL: What is NOT in RTM (V1) post of October 15, 2007, Dinesh posted Lifetime of a LINQ to SQL DataContext on April 27, 2008.

Apparently the sun hasn't shone in Redmond since mid-October.

His latest post provides guidelines for answering the question of whether the DataContext should be short- or long-lived.

As I said in my comment: Welcome back!

Eugenio Pace Produces Screencast of LitwareHR Using SSDS

End to end demo of LitwareHR on SSDS provides an 11-minute screencast of LitwareHD using SQL Server Data Services instead of SQL Server 2005 as the back-end datastore. Eugenio divides the screencast into two acts:

    1. Tenant Provisioning and customization (takes the first 5 min approximately). I show the initial tenant provisioning (creation of a new tenant in LitwareHR, initial configuration, etc) and then a basic customization (e.g. look & feel, position entity shape, etc). You'll notice that I switch back and forth between www.litware.com and SSDS to show how entities look like in the store.
    2. Using the new created instance (this takes the last 6 min). I show a hypothetical recruiter logging-in, opening new positions, then an applicant browsing the open positions and submitting a Resume and finally the recruiter browsing the posted applications. Again, you'll see how do these entities look like in SSDS.

Here are Eugenio's introduction and six-part tutorial about moving LitwareHR to SSDS:

Barry Gervin Starts Yet Another Entity Framework Series

His kickoff, The Entity Framework vs. The Data Access Layer (Part 0: Introduction) of April 27, 2008, explores the roles of a data access layer (DAL, not necessarily a tier) and lays out questions related to it's implementation.

Barry promises that in Part I:

I'll explore the idea of the Entity Framework replacing my data access layer and evaluate how this choice rates against the various objectives above. I'll then continue to explore alternative implementations for a DAL using the Entity Framework.

Liam Cavanagh Offers Sync Framework Tutorials

In apparent response to the increased interest in data synchronization spiked by Live Mesh, Liam's New Sync Framework Tutorial of April 28, 2008 offers the following four projects:

  • Sync101 With Metadata Store – Demonstrates a basic provider for an in-memory data store (replica) that uses the SqlCeMetadataStore class to store the metadata in a SQL Server Compact Edition database.

  • Sync101 Refactored – Factors out the replica-specific code from the code common to any provider in preparation for the next step of adding an additional provider. Also uses a more flexible transfer mechanism class to allow accommodation of more complex schemas.

  • Sync101 Add Xml Provider – Adds a new provider that represents a data store comprised of XML files.

  • Sync101 Add Csv Provider – Adds a new provider that represents a data store containing Comma-Separated Values (CSV) files and also uses XML configuration files to specify the transfer mechanism class properties and the property mappings between providers.

You can download the source code from the MSDN CodeGallery.

Julie Lerman Unveils the Forthcoming ASP.NET EntityDataSource Control

Repeated from: LINQ and Entity Framework Posts for 4/21/2008+

Danny Simmons demonstrated the EntityDataSource control at the MVP Summit 2008 and Julie shares her notes in Sneak Peek at the EntityDataSource Control of April 27, 2008. The EntityDataSource control is the Entity Framework's answer to LINQ to SQL's LinqDataSource control for databinding ASP.NET GridView, ListView and other bindable server controls.

Two important EntityDataSource control features that Julie describes are:

Although I don't remember seeing it during the session, Danny did say that you can choose to eager load related data in the same way that you can with the Include method. I don't know how this is done or if it will impact updating, but I don't know why it would.

One of the most interesting things about the EntityDataSource is that along with its' ability to perform server side paging, it also performs client side caching - of current AND original data. The original data is not stored as complete objects, but the minimal data necessary to reconstruct state when it's time to update. Updates happen, like any other data source, one at a time. So you have to pick an item, edit it and update it.

Availability of the EntityDataSource control will enable ASP.NET Dynamic Data scaffolding to use EF as an alternative to LINQ to SQL as its data source. (See David Ebbo's Dynamic Data at MIX, and upcoming changes post of March 6, 2008.

Hopefully, the EntityDataControl won't share the problems with the LinqDataControl that Julie described in her January 22, 2008 Thinking about the EntityDataSource post.

Note: The link to the OakLeaf blog in the latter post goes to the home page. Julie might have intended to link to go to the Problems Using Stored Procedures for LINQ to SQL Data Retrieval (Updated) post of October 2, 2007. That post contains a "Problems with Stored Procedures That Affect ASP.NET Projects Only" section, which covers sorting and paging problems.

Sunday, April 27, 2008

LINQ and Entity Framework Posts for 4/21/2008+

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

Julie Lerman Unveils the Forthcoming ASP.NET EntityDataSource Control

Danny Simmons demonstrated the EntityDataSource control at the MVP Summit 2008 and Julie shares her notes in Sneak Peek at the EntityDataSource Control of April 27, 2008. The EntityDataSource control is the Entity Framework's answer to LINQ to SQL's LinqDataSource control for databinding ASP.NET GridView, ListView and other bindable server controls.

Two important EntityDataSource control features that Julie describes are:

Although I don't remember seeing it during the session, Danny did say that you can choose to eager load related data in the same way that you can with the Include method. I don't know how this is done or if it will impact updating, but I don't know why it would.

One of the most interesting things about the EntityDataSource is that along with its' ability to perform server side paging, it also performs client side caching - of current AND original data. The original data is not stored as complete objects, but the minimal data necessary to reconstruct state when it's time to update. Updates happen, like any other data source, one at a time. So you have to pick an item, edit it and update it.

Availability of the EntityDataSource control will enable ASP.NET Dynamic Data scaffolding to use EF as an alternative to LINQ to SQL as its data source. (See David Ebbo's Dynamic Data at MIX, and upcoming changes post of March 6, 2008.

Hopefully, the EntityDataControl won't share the problems with the LinqDataControl that Julie described in her January 22, 2008 Thinking about the EntityDataSource post.

Note: The link to the OakLeaf blog in the latter post goes to the home page. Julie might have intended to link to go to the Problems Using Stored Procedures for LINQ to SQL Data Retrieval (Updated) post of October 2, 2007. That post contains a "Problems with Stored Procedures That Affect ASP.NET Projects Only" section, which covers sorting and paging problems.

Added: April 27, 2008

Jeremy Miller Reports on the MVP Summit 2008: Still Not Thrilled with the Entity Framework

The NHibernate Mafia weren't fighting the Persistence Ignorance battle at this year's MVP Summit, but Jeremy still isn't happy about the current (Beta 3) Entity Framework (EF) implementation. He says in A Train of Thought -- MVP Summit 2008 Edition of April 23, 2008:

    • I'm still not thrilled with the Entity Framework and the direction they locked themselves into, but the EF team came prepared to talk about some compromises that might start pushing EF into the usable category for me. I honestly wouldn't care about the EF, but I'll probably be back in consulting at some point in the next 5 years at a shop that will only use Microsoft tooling.
    • Daniel Simmons gets the "Thickest Skin of the Year" award. Not the Hyperion/Endymion Dan Simmons though.

Apparently the NH-Mafia worked Danny over again on EF issues.

In the "What I want for Christmas from Redmond" department, Jeremy's wish list includes:

    • Transparent lazy loading in the Entity Framework. If they want the Entity Framework to be usable in constructing rich Domain Models, they're going to have to do this.

EF enables lazy loading by default, but requires invoking the Load() method to retrieve the associated objects form the server. As Danny Simmons says in item 11. Lazy Load and Eager Load of his Entity Framework FAQ (updated 1/4/2008):

The entity framework attempts to make everything explicit, so even with lazy loading, you must explicitly call the Load method on the relationship in order to load its related entities. That way you know exactly when round trips are made to the database. As systems grow larger and more complex, this kind of explicitness can do a lot to improve overall supportability of the system.

I'm fine with calling Load(). Most of my projects involve multiple tiers, stored procedures, or both, so I ordinarily use eager loading by invoking Attach() with a filter to control depth, as Danny described in his Filtered association loading and re-creating an entity graph across a web service boundary... post of December 21, 2007.

Added: April 26, 2008

Colin Meek Elaborates on Generating Dynamic LINQ Expressions

Colin presented "VMS307: Visual Studio 2008: LINQ Deep Dive and Best Practices" at DevConn 2008 Orlando. His Using LINQ Expressions to Generate Dynamic Methods post extends his session's discussion of the ADO.NET Entity Framework Extension that "materializes  arbitrary CLR types given a data reader or DB command." Colin says:

The System.Linq.Expressions API serves a specific need for integrated queries: it allows the compiler to describe the user’s code as a data structure that can then be translated to targets other than MSIL at runtime, like SQL, Web Services, etc. Expressions can also be compiled into delegates at runtime, which brings me to a .NET 3.5 solution to the default shaper problem… If the compiler can use expressions to describe code, so can we!

Added: April 26, 2008

Rafik Robeal on Local Storage and Synchronization in HTML 5

HTML5 - The Offline Web of April 25, 2008 observes that HTML 5 will contain APIs for persistent storage in key/value and SQL databases and for offline Web applications. Rafik observes:

Isn’t interesting that despite the current networking revolution people are building the next web to work offline!? It is not strange to me but for many people this is bizarre. ...

To me, offline is an experience and programming model. Offline experience is all about richness, responsiveness, and better use of the data pipe. An offline programming model is what I’ve been showing people with Sync Services.

It's obvious that Ray Ozzie and Dave Treadwell share Rafik's enthusiasm for synchronization.

Added: April 26, 2008

Beth Massi Explains How to Query HTML with LINQ to XML

Beth's Querying HTML with LINQ to XML post of April 25, 2008 shows you how to use LINQ to XML to query HTML pages by removing markup entities, such as &nbsp;, that cause the document to be malformed by XML standards.

Added: April 26, 2008

Pat Helland to Present at UC Berkeley's Tribute to Honor Jim Gray

Pat Helland, an architect on the Visual Studio team, will give the "Jim as a Mentor: Colleagues" presentation at the University of California Berkeley's Tribute to Honor Jim Gray. Pat, who worked with Jim Gray at Tandem Computers in the 1980s, announced in his Knowledge and Wisdom -- A Tribute to Jim Gray post of April 25, 2008 that his two-page paper for a special edition of the SIGMOD Record is available for download. The paper summarizes Pat's "experiences with Jim's approach to nurturing and mentoring."

From the press release for the Tribute:

Three organizations dedicated to the advancement of computing science, IEEE Computer Society, ACM, and UC Berkeley, today announced they will join the family and colleagues of Jim Gray in hosting a tribute to the legendary computer science pioneer, missing at sea since Jan. 28, 2007.

The tribute will be held May 31 at UC Berkeley’s Zellerbach Hall. The general session will be from 9-10:30 a.m., followed by technical sessions that will require registration. Registration and other information can be found at: http://www.eecs.berkeley.edu/ipro/jimgraytribute

You can learn more about Jim Gray's mysterious disappearance at sea of and the search for him from these two contemporaneous OakLeaf posts: U.S. Coast Guard Searching for Jim Gray off San Francisco Coast of January 29, 2008 and "Friends of Jim" Halt Volunteer Search for Jim Gray of February 17, 2007.

Added: April 26, 2008

Eugenio Pace Implements a Simple Unit of Work Pattern for SSDS

SQL Server Data Services don't support client-side transactions, so implementing the Unit of Work pattern requires compensating actions in the event one element of multiple related updates fails after previous actions have succeeded.

Eugenio's LitwareHR on SSDS - Part VI - Unit of Work support post of April 25, 2008 describes how he modified his Repository class for the LitwareHR application to implement a simple version of the Unit of Work pattern.

Added: April 25, 2008

Sync Guru (Rafik Robeal) Questions the Problems Live Mesh Will Solve

Rafik Robeal was the technical driving force behind ADO.NET Sync Services, which is now part of the Microsoft Synchronization Framework, in turn a component of the Microsoft's new Live Mesh project. Rafik's moved on to mobile development, but his The Mesh – A New Synchronization Backbone post of April 24, 2008 asks the same questions I've been pondering:

[W]hat is the key problem that Live Mesh is trying to solve?

  1. Is it remote access? ...
  2. Is it data sharing? ...
  3. Is it data collaboration? ...
  4. Is it data synchronization platform? ...

Rafik believes it's basically #3 and #4 for consumers. I've got access to the Live Mesh Technology Preview, but both Rafik and I are waiting for the Live Mesh SDK to learn more about its API and data models.

My initial answer to Rafik's question is loss of developer mindshare and potential platform lock-in to Platforms as a Service (Paas) from Google, Amazon, Adobe and, perhaps, SalesForce.

Podcast: For more details about Microsoft's plans for Live Mesh from David Treadwell, corporate vice president of Microsoft's Live Platform Services and the exec behind SQL Server Data Service (SSDS) deployment as a Live Platform, read Dan Farber's Live Meshing on the Gillmor Gang post of April 25, 2008 and the Gillmor Gang's interview podcast.

Mary Jo Foley's Ten things to know about Microsoft’s Live Mesh of April 22, 2008 provides additional Live Mesh background.

Added: April 25, 2008

Doug Rothaus Performs Identity Transforms with LINQ to XML's ReplaceWith() Method

Doug demonstrates replacing an <eEmail> element with an <a href="mailto:" & eMailAddress ... >... element by using VB's XML literals and LINQ to XML's ReplaceWith() method in his VB XML Cookbook, Recipe 3: Identity Transforms (Doug Rothaus) post of April 25, 2008. A relatively simple pair of VB functions make a substitution that would require a significantly more lengthy XSLT transform.

Added: April 25, 2008

Mike Flasko: Astoria Team Targeting Silverlight 2.0 Beta 2 for REST Services

In the Astoria Team's Using REST Services in Silverlight post of April 24, 2008, Mike Flasko says:

[W]e are targeting Beta 2 of the Silverlight SDK (no dates to announce for this just yet) to have a version of the client library for ADO.NET Data Services. Given that we use many of the core pieces of Silverlight to enable data service interaction, we've waited for those to come into the platform so that we can start to round out our Silverlight experience. 

The scenarios we're looking to enable in Beta 2 are: the ability to send async queries, inserts, updates and deletes for same domain requests.  We're still working through how we'll enable these types of requests in cross domain scenarios.

I believe most of us were expecting an Astoria CTP for Silverlight 2.0 Beta 1 at the end of April, along with Beta 4 or a post-Beta 3 CTP of the Entity Framework. Doesn't look that way now, at least for Silverlight.

Added: April 24, 2008

Randolph Cabral Starts Exploring N-Tier Architecture with LINQ to SQL Series

Randy's Part 1 - Analyzing LINQ to SQL Entities post of April 23, 2008 follows up his earlier Active Record Vs. Unit of Work analysis of April 3 with an attempt to "marry" the Active Record and Unit of Work patterns with LINQ to SQL's DataContext.

He promises:

In the next post, we’ll take a look at the DataContext class and evaluate how we could best take advantage of its object tracking capabilities.  I’ll also explore writing a context manager class that helps ease the pains in dealing with the DataContext.

Added: April 24, 2008

Eric White Posts Second Edition of His Functional Programming Tutorial for LINQ Queries

Query Composition using Functional Programming Techniques in C# 3.0 of April 23, 2008 is Eric's 34-part rewrite of his original 2006 version. Eric says:

As with the previous tutorial, I've targeted this tutorial to C# developers who have no functional programming experience, i.e. the typical object-oriented coder.

One thing that I want to say at this point: This stuff is easy. It's also really fun. You don't have to read academic papers to learn about, enjoy, and benefit from functional programming in C# 3.0. There are about half a dozen concepts you need to learn, each one easy. Concepts like just a new way to write a method (that has no name), or a new way to write a static method for a class. Then you put them all together, and the result is more than the sum of the parts.

As you might expect, based on Eric's day job as an Open XML technical evangelist, he "shows you how to write code to extract the text of paragraphs of an Open XML document, along with the associated style of each paragraph."

Added: April 24, 2008

Jean-Paul Boodhoo Argues His Preference for var with Meaningful Variable Names

J-P says in his Got var? post of April 22, 2008:

As I strive toward more readable, intent revealing code, I find myself looking at the intent behind the usage of the variable coupled with a meaningful name, vs the actual type. In reality, I find the the argument to not use var is a moot point in a static environment that provides you with all the information you need once you hit the "."

His IList<Customer> listOfCustomers = new List<Customer>() example looks a lot like VB's and Access VBA's Hungarian notation that I spent 15 years writing.

Be sure to read the comments.

Added: April 24, 2008

Scott Hunter: New Refresh of Dynamic Data Runtime and Tools is Posted

The headline says it all. Sample code that's updated to work with the latest runtime is also available from the Code Gallery. The new Runtime and Tools drop includes (incomplete) documentation in CHM format.

Added: April 24, 2008

Pablo Castro Analyzes RESTful Optimistic Concurrency Management for Astoria with HTTP 1.1 Entity Tags

Pablo's Optimistic Concurrency & Data Services post of April 22, 2008 describes how HTTP 1.1 entity tags (ETags) can be used to detect whether a server resource has changed before accepting a client modification. The client keeps a copy of "opaque data," such as a version number or timestamp obtained from the server by a GET request. The client submits it in an if-match request header with its HTTP PUT or DELETE request. A failed match returns a 412 "Precondition Failed" status code to the client. Clients can override the match requirement by substituting an asterisk (*) for the opaque data.

ETags in the request header work for single entities; for collections, the plan is to add the ETag as metadata <entry m:type= "someType" m:etag="someValue" ...> to AtomPub and and in JSON's "__metadata" property.

Pablo observes a fly in the ointment: the definition of "strong" and "weak" eTags in section 13.3.3, "Weak and Strong Validators," of RFC 2616 - Hypertext Transfer Protocol - HTTP 1.1. HTTP 1.1 lets validation values remain unchanged when "no significant change in semantics" occurs. Weak TAGS apply only to GET operations, not PUT and DELETE, where he wants to use them.

P.S.: In a post of the same date to his personal blog, The Astoria team is hiring!, Pablo notes that the Astoria team is "looking for folks for Development, Quality Assurance and Program Management positions." It's likely that the team is staffing up to take on the challenge of aligning ADO.NET Data Services and the Entity Data Model (EDM) with SQL Server Data Sources (SSDS).

Eugenio Pace Takes the Complexity Out of SSDS Cross-Container Queries with .NET Parallel Extensions

In his More on parallel queries across containers in SSDS post of April 22, 2008, Eugenio shows the original code he used to implement the CrossContainerSearch() method he described in his earlier LitwareHR on SSDS - Part V - Searching across Containers post.

In this post, he finds that the scheduling, join and state management operations can all be handled by the .NET Parallel Extensions' Parallel.For() method, which greatly simplifies the code.

Eric White Creates a GroupAdjacent LINQ Query Operator for OpenXML Documents and LINQ to XML

Eric notes in his The GroupAdjacent Query Operator Extension Method post of April 20, 2008 that:

Quite often when you are processing an Open XML document using LINQ to XML, you want to group adjacent paragraphs that have the same style.

Let's say that the above array represents paragraphs in a document.  If the value is > 0, the paragraphs are a heading of the specified level.  The zeros represent paragraphs styled as normal.  We want to do some processing on the collection of paragraphs in such a way that we process all adjacent paragraphs of the same style in a single query.  We could group them, and execute a query on each group, but as you saw above, the standard GroupBy extension method will group all of the 0's together and all of the 2's together.

Given this array: int[] ia = new int[] { 1, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0 };

GroupAdjacent groups them like this: In contrast, the standard GroupBy method groups them like this:
Group 1
1
Group 0
0
0
Group 2
2
Group 0
0
0
0
Group 2
2
Group 0
0
0
0
Group 1
1
Group 0
0
0
0
0
0
0
0
0
Group 2
2
2

I believe the GroupAdjacent() query operator will prove quite useful for general LINQ to XML processing, not just OOXML work.

Rob Conery Deep Dives into LINQ to SQL Data Access for his MVC Storefront Project

Rob continues the Webcasts of his ASP.NET MVC Storefront project in ASP.NET MVC: MVC Storefront, Part 4 of April 21, 2008:

In this webcast I dive pretty deep into Data Access and talk about some architectural decisions I need to make, specifically how to get LINQ To SQL to map to my model properly. ...

Steven Harman suggested I run a Spike (a quick prototyping exercise to test out a theory) to make sure that my data access strategy will work with an actual database. Good idea.

I quickly ran into some issues with LINQ To SQL, but found some neat ways to keep things clean and tidy so I don't explode my database all over my happy little application.

Previous episodes are:

Update April 24, 2008: Rob's ASP.NET MVC: MVC Storefront, Part 5 covers globalization issues.

Scott Hanselman Interviews Scott Hunter About ASP.NET Dynamic Data

Scott Hunter is a program manager on the ASP.NET Dynamic Data team. The Hanselminutes podcast is at <ASP.NET Dynamic Data with Scott Hunter/>.

Matthew Hunter Continues Improvements to his LINQ to SQL Entity Base Implementation

Matt describes these improvements:

  1. There is no longer need to have a timestamp field
  2. Option to keep original entity values.

to his LINQ to SQL Entity Base implementation in his Improvement: No requirement for timestamp column any longer post of April 23, 2008.

Thursday, April 17, 2008

LINQ and Entity Framework Posts for 4/14/2008+

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

Updated: 4/20/2008

Latency and Service Level Agreement Sections Added to Comparison of Online Databases

Data latency and eventual consistency are known problem issues Amazon SimpleDB, might be an issue with Google App Engine's Bigtable-based Datastore, and probably won't be a problem with SQL Server Data Services. None of the three beta "datastores in the cloud" services offer a Service Level Agreement (SLA) at present, but Microsoft claims that data backups are stored in each cluster, and geo-redundant data copies provide disaster recovery.

Read more about these features in Comparing Google App Engine, Amazon SimpleDB and Microsoft SQL Server Data Services.

Added: 4/19/2008

David Hayden Walks Through the New ASP.NET Dynamic Data Wizard

Scott Guthrie's "Visual Studio Dynamic Data Project Wizard" topic from his ASP.NET MVC Source Refresh Preview post of April 16, 2008 gives a brief introduction of the enhanced Dynamic Data Wizard that generates the LINQ to SQL partial classes and DataContext code for highly customized template pages that include selectable INSERT/UPDATE/DELETE UIs.

Dave's ASP.NET Dynamic Data Wizard - Generating LINQ To SQL Data Model and Custom Pages post of April 19, 2008 goes Scott one better with a fully illustrated and highly detailed Wizard walkthrough.

Added: 4/19/2008

Aral Balkan's GAE SWF Project Demonstrates Flash and Flex on Google App Engine

Aral's The GAE SWF Project is a simple Google App Engine application that uses a Flash form to save individual user profiles in GAE's Datastore. The form uses the Users API, DataStore API, and Mail API to log the user in with his or her Google account, create a new login, and save the data in the Datastore, and log the user in automatically on return. As a plus, Aral includes code from his Make Flash obey text size changes post.

The demo also proves that it is possible to create simple, utilitarian Web components with Flash and Flex.

Update 4/20/2008: Aral notes in his The GAE SWF Project 1.21 post that he updated The GAE SWF Project to version 1.21 on April 20, 2008.

Added: 4/19/2008

Updated Version of Visual LINQ (VLINQ) Query Builder Project Available with Source Code

Microsoft France's add-in for Visual Studio helps you to visually build LINQ to SQL queries with a process similar to the Access query builder. This new version, posted to CodePlex on April 17, 2008 and updated April 18, includes a fix for an installer bug and delivers full source code.

Added: 4/19/2008

Rick Strahl Suggests Using LINQPad as a Code Snippet Execution Engine

Rick says in his LINQPad as a Code Snippet Execution Engine post of April 17, 2008:

LINQPad does a great job at LINQ execution and visualization, but it has a lot more uses than just a LINQ query tool. It's basically a snippet editor that allows you to save snippets and more importantly, execute just about any code that you can write as an expression or single function block . You can execute both Expressions which is a single command that returns a result or a single block of commands or a Statement which is a block of commands in a single execution block (essentially what would amount to a method body).

It's awesome if you just want to very quickly verify how some .NET function or expression  works without having to write a test, console output routine or change your code and run it with the debugger.

Added: 4/17/2008

Ruurd Boeke Wraps Up His n-Tier Entity Framework Implementation

His latest New sample application for disconnected n-tier EntityFramework objects of April 16, 2008 is an MVC client for the April 7, 2008 version the Disconnected N-Tier objects using EntityFramework project, which Ruurd describes as:

[A] sample application that uses a server to retrieve data with EF and a client that is totally unaware of EF. Changes on the client are changetracked and serialized in a pretty xml format. Then, the server attaches to the graph and is able to use a context to save changes.

The MVC client is based on Microsoft patterns & practices' new Prism framework for developing composite Windows Presentation Foundation (WPF) applications. The Prism group describes their framework as:

"Prism" addresses the challenges around building complex enterprise WPF applications. As complexity increases and teams grow, applications become increasingly difficult to maintain. Using "Prism" enables designing a composite application that is composed of many discrete, loosely coupled modules. These modules can be developed, tested and deployed by separate teams.

Source code for Ruurd's project is available from CodePlex.

Added: 4/17/2008

Beth Massi Continues her LINQ to SQL n-Tier Smart Client Project

Beth's LINQ to SQL N-Tier Smart Client - Part 3 Database Transactions of April 16, 2008 aggregates INSERT, UPDATE, and DELETE operations on a previously disconnected DataContext into a single explicit transaction.

Following are links to Parts 1 and 2:

Added: 4/17/2008

Kevin Hoffman Adds Continuous Aggregation (Including VWAP) to CLINQ

Kevin's been working on Continuous LINQ (CLINQ) again, as evidenced by his CLINQ v1.1 - Extending the AggregateViewAdapter to Create Continuous VWAP post of April 16, 2008 and the first two posts below. His latest post describe improvements to v1.1 to include Volume-Weighted Average Prices (VWAP), a means of normalizing historical stock prices by taking into account the number of shares traded at a given price.

Source code is available on CodePlex.

CLINQ is similar in concept to LINQ to Streams (SLINQ or Streaming LINQ) by Oren Novotny, which is described in Third-Party LINQ Providers of March 27, 2007, last updated 8/7/2007. Looks like it's time to do another third-party LINQ provider update.

Added: 4/17/2008

Lack of SSL Support Nullifies Google App Engine as a Web Data Store

According to Google's Marzia in an April 10, 2008 message to the Google App Engine (GAE) group, "Please keep in mind when designing any system that Google App Engine does not currently provide SSL support for your domain." There are indications in another GAE group thread that the premium (paid) version will support SSL.

Failure to support SSL is a major obstacle to GAE's adoption for commercial applications. Google must confirm that the premium version will support SSL before professional developers can  justify devoting resources to this service.

For more details, see the Comparing Google App Engine, Amazon SimpleDB and Microsoft SQL Server Data Services post of April 9, 2008 (updated April 15, 2008).

Thanks to Filip Verhaeghe for the heads up in an April 15, 2008 comment to the preceding post on this issue.

Pablo Castro: ADO.NET and SQL Server Data Services to Converge

Pablo's Astoria Online Service --> SQL Server Data Services post of April 14, 2008 outlines plans to harmonize standards for on-premise ADO.NET Data Services and Microsoft-hosted SQL Server Data Services.

As part of our unified Data Services vision, we will provide a solution that enables seamless integration between on-promise deployments (software) and cloud based deployments (services). 

We’re working on aligning aspects of SSDS and Astoria and this alignment will come over a series of updates to both Astoria and SSDS. For example, we will likely add AtomPub and JSON support to SSDS to match the results encoding of Astoria and are already working on extensions to EDM to incorporate the open content model of SSDS.

We’ll be working to extend Astoria as needed to ensure it provides a great development experience over the SSDS service. It’s also worth noting how the Microsoft Sync Framework can be used to tie multiple deployments together – Nigel covers this in his talk. Stay tuned for more details.

Extending the EDM to cover SSDS's free-form "open content model," including "flexible entities" doesn't appear to me to be a piece of cake.

New LINQ to CSV Library on CodeProject

Matt Perdeck claims the following features for his LINQ to CSV library posted April 10, 2008:

  • Follows the most common rules for CSV files. Correctly handles data fields that contain commas and line breaks.
  • In addition to comma, most delimiting characters can be used, including tab for tab delimited fields.
  • Can be used with an IEnumarable of an anonymous class - which is often returned by a LINQ query.
  • Supports deferred reading.
  • Supports processing files with international date and number formats.
  • Supports different character encodings if you need them.
  • Recognizes a wide variety of date and number formats when reading files.
  • Provides fine control of date and number formats when writing files.
  • Robust error handling, allowing you to quickly find and fix problems in large input files.

Looks like a worthwile addition to third-party LINQ implementations to me. The date-handling features are a must-have for production use.

Thanks to David Hayden for the heads up.

Rick Strahl Revisits Options for LINQ to SQL Dynamic Queries

Rick says in his Dynamic Queries and LINQ Expressions post of April 14, 2008:

I'm revisiting some code in my LINQ to SQL business objects layer that I've written about before. The problem I ran into and described was that I had a class with generic business object behavior that needs to look up values based on a database field that wouldn't be known until runtime.

He then goes on to examine these options:

  • Skip LINQ and use SQL strings with ExecuteQuery<T>
  • Dynamic Query
  • Use Lambdas instead of fixed Parameters
  • Storing and Reusing a Lambda Expression

As usual, it's a good read.

Matthew Hunter Releases Update to LINQ to SQL Entity Base

Matt says in New Version of LINQ to SQL Entity Base Class (Beta 3.0) of April 14, 2008:

In the example that comes with the LINQ to Entity Base, [I]'ve used the data contract serializer (which is what WCF uses to serialize/deserialize objects) to demonstrate this. I've also improved the example so you can scroll through the results by converting it to a simple windows form.

Matt's earlier posts about n-tier deployment and disconnected updates with LINQ to SQL are here.

Terry Aney Implements Batch Updating and Deletion for LINQ to SQL

Terry's Batch Updates and Deletes with LINQ to SQL post of April 14, 2008 is a further refinement of Jeffry Zhao's approach to the batch deletion topic in his LINQ to SQL Extension: Batch Deletion with Lambda Expression post of March 6, 2008.

Source code for Terry's project is available here.

Justin Etheredge Explores LINQ's Let Keyword

In The Linq "let" keyword of April 14, 2008, Justin covers the use of the let keyword in LINQ expression syntax to make queries more readable.

Beth Massi Continues Her LINQ to SQL n-Tier Smart Client Series

LINQ to SQL N-Tier Smart Client - Part 2 Building the Client (April 14, 2008) shows you how to build the "very simple Windows client form that works with our middle-tier" that her LINQ to SQL N-Tier Smart Client - Part 1 Building the Middle-Tier post of April 12, 2008 describes.

Eugenio Pace Shows You How to Search Across SSDS Containers

SQL Server Data Services (SSDS) ordinarily limits the scope of queries to a container, which is its basic unit of data storage. However, if you're willing to implement Eugenio's CrossTenantSearch helper class to run concurrent searches, you can overcome this limitation.

Eugenio's LitwareHR on SSDS - Part V - Searching across Containers post of April 13, 2008 contains a diagram

AppDrop Ports Google App Engine SDK to Amazon EC2

Andy Baio, the developer of Upcoming.org (now a Yahoo! service), describes Chris Anderson's AppDrop application:

How does it work? Behind the scenes, AppDrop is simply a remote installation of the App Engine SDK, with the user authentication and identification modified to use a local silo instead of Google Accounts. As a result, any application that works with the App Engine SDK should work flawlessly on AppDrop. For example, here's Anderson's Fug This application running on Google App Engine and the identical code running on EC2 at AppDrop.

Of course, this simple portability comes at the cost of scalability. The App Engine SDK doesn't use BigTable for its datastore, instead relying on a simple flat file on a single server. This means issues with performance and no scalabity to speak of, but for apps with limited resource needs, something as simple as AppDrop would work fine.

For additional AppDrop details and links, see Andy's Exclusive: Google App Engine ported to Amazon's EC2 post of April 14, 2008.

Microsoft's Red Dog Project Promises [Windows] Applications in the Cloud

LiveSide - News blog's Red Dog: Ray Ozzie's answer to the Google App Engine? post of April 9, 2008 claims that the "Microsoft Utility Computing Platform, code named Red Dog, sounds very much like a platform for building a Google App Engine type service (except maybe quite a bit better)" and also might be a competitor to Amazon's EC2.

A job posting by the Cloud Infrastructure Group gave this Red Dog feature list [paraphrased by LiveSide]:

  • An "efficient, virtualized" environment
  • A "fully automated service management system" (like the Google App Engine, you won't have to worry about managing the system)
  • On "highly scalable" storage services (you only use the storage you need)
  • The service will "scale to millions of machines" across Microsoft's data centers (geo-located, easy to maintain data centers, remember?)  
  • "[W]ill lead the marketplace as the best platform for rapid development, deployment, and maintenance of internet services and applications"
  • SDK and tools will be included for external and internal customers
  • V1 for external customers in the coming year

Mary Jo Foley adds some code-name spice to the topic in her Red Dog: Yet another unannounced Microsoft cloud service article of April 9, 2008.

EMC also has a Cloud Infrastructure and Services Division run by former Microsoft exec Paul Maritz.

Forthcoming Persistent Storage for EC2 Can Run Relational Databases

Developers will have another "database in the cloud" option when Amazon Web Services (AWS) releases its newly-announced persistent storage feature for their Elastic Computing Cloud (EC2) feature. According to Jeff Barr in the Amazon Web Services blog's Storage Space, The Final Frontier post of April 13, 2008:

[O]ur forthcoming persistent storage feature will give you the ability to create reliable, persistent storage volumes for use with EC2. Once created, these volumes will be part of your account and will have a lifetime independent of any particular EC2 instance.

These volumes can be thought of as raw, unformatted disk drives which can be formatted and then used as desired (or even used as raw storage if you'd like). Volumes can range in size from 1 GB on up to 1 TB; you can create and attach several of them to each EC2 instance. They are designed for low latency, high throughput access from Amazon EC2. Needless to say, you can use these volumes to host a relational database. [Emphasis added.]

There's more detail in Persistent Storage for Amazon EC2 post in the AWS Developer Connection blog, and RightScale's Amazon takes EC2 to the next level with persistent storage volumes, both of the same date.

Any chance that the Google App Engine announcement had something to do with Amazon's announcement timing?

Saturday, April 12, 2008

LINQ and Entity Framework Posts for 4/7/2008+

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

Comparison of "DataStores in the Cloud" Started

My Comparing Google App Engine, Amazon SimpleDB and Microsoft SQL Server Data Services post of April 9, 2008 is the beginning of a full-length comparison of Amazon SimpleDB, SQL Server Data Services, and Google App Engine beta versions.

As of April 10, 2008, the introduction and Data Model sections are complete.

Update 4/12/2008: Security and authentication topics expanded and moved to the "API" section, "API" section updated with query syntax and API limitations.

Added: 4/10/2008, Updated 4/12/2008

Jeff Currier Explains How to Use the cURL Utility with SQL Server Data Services

According to its author, Daniel Stenberg:

cURL is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks.

Jeff's cURL'ing up with SQL Server Data Services post of April 12, 2008 shows you how to use cURL at the command prompt to query an SSDS authority, as well as create containers and create, update and delete entities from file-based templates.

Added: 4/13/2008

Rick Strahl Encounters an Anomaly in LINQ to SQL Behavior with Object Tracking Disabled

Object tracking creates a very small performance hit, so it's a common practice to set DataContext.ObjectTrackingEnabled = false if you don't intend to update entities. However, you receive an "Object Reference not set to an instance of an object" exception if the entity has deferred loading associations. Eager loading is required in this case.

Rick's LINQ to SQL ObjectTrackingEnabled and Deferred Loading of Related Data of April 12, 2008 notes:

It turns out that this is a known issue that has been reported on Connect before.

and he goes on to quote Alex Turner's response to the Connect Bug report, which explains the reason for throwing the exception.

Added: 4/13/2008

Sahil Malik Writes a Windows Communication Foundation Tutorial

You need to know how to create WCF services and clients if you intend to try n-tier deployment of LINQ to SQL or the Entity Framework. Sahil's irreverent approach to his tutorials makes them more interesting (and informative) than the ordinary step-by-steps from MSDN and elsewhere.

He starts the series with four (count 'em, four) posts on April 12, 2008:

  • What is WCF? explains the basics of Service Oriented Architecture (SOA) and what makes WCF different from its Web service predecessors.
  • Writing the WCF Hello World App shows you how to create a WCF service class library, add a WCF service, and edit and implement the ServiceContract interface. Sahil also explains the mysteries of the App.config file (for a class library, yet!)
  • Writing your first WCF client demonstrates using dynamic proxy generation with metadata from the mex endpoint or metadata predistributed to the client in a DLL.
  • Host a WCF Service in IIS 7 & Windows 2008 - The right way shows you how to deploy a WCF service to IIS 7.0, a topic that Sahil says appears "nowhere else on the web." The process is by no means straightforward.

It will be interesting to see if more episodes follow.

Added: 4/13/2008

Beth Massi Starts LINQ to SQL N-Tier Smart Client Series

Beth's LINQ to SQL N-Tier Smart Client - Part 1 Building the Middle-Tier post of April 12, 2008 covers the following topics about the middle tier:

  • The Great Debate - DataSets or objects?
  • Going N-Tier with LINQ to SQL
  • Contract First
  • Disconnected Retrieval
  • Disconnected Updates and Deletes

Full VB 2008 code for the middle tier is included. Beth promises that her next post in the series "we'll build our client form and implement a simple technique for change tracking."

Added: April 12, 2008

Guy Burstein: Download the .NET 3.5 Enhancements Training Kit Preview

Guy's .NET 3.5 Enhancements Training Kit is available for Download says:

The Developer and Platform Evangelism Group in Microsoft has created a new training kit for all the enhancements for the .Net Framework 3.5:

  • ASP.NET MVC
  • ASP.NET Dynamic Data
  • ASP.NET AJAX History
  • ASP.NET Silverlight controls
  • ADO.NET Data Services
  • ADO.NET Entity Framework

Download the training kit (34.9 MB)

The April Content Preview contains Developer and Platform Evangelism Group's elementary Hands-on Labs for ADO.NET Entity Framework, ADO.NET Data Services, and ASP.NET Dynamic Data. Content for the Presentations, Demos, Screencasts, and Resources "will be added in a future release of the training kit.

Added: April 12, 2008

Upcoming Microsoft Developer Webcasts about LINQ and ADO.NET Data Services

From Scott Lum's MSDN Online Media Blog: Upcoming Microsoft Developer Webcasts: WCF, WF, Linq, AJAX, IIS 7.0, MS Sync Framework post:

MSDN Webcast: geekSpeak: Inside LINQ to XML with Paul Sheriff (Level 200)
In this episode of geekSpeak, Microsoft Regional Director Paul Sheriff explains how to put LINQ to XML to work in your applications. Guest Presenters: Paul Sheriff, President, PDSA, Inc. He has authored several books, webcasts, videos, and articles on the Microsoft .NET Framework, Microsoft SQL Server, and Windows SharePoint Services.
4/16/2008 12:00 PM - 1:00 PM Pacific Time | Duration: 60 Minutes

MSDN Webcast: LINQ Features in Visual Studio 2008 (Level 200)
Think you have heard all there is to know about Microsoft .NET Language-Integrated Query (LINQ)? Think again! In this webcast, we dazzle and amaze you with our staggering array of wondrous tools to make your LINQ experience a memorable one! Presenter:: Zain Naboulsi, Developer Evangelist, Microsoft CorporationTechnology is useless if it does not serve a clear purpose. That's Zain's philosophy. In fact, showing people how technology can make their lives better delivers his greatest on-the-job thrills
4/16/2008 1:00 PM - 2:30 PM Pacific Time | Duration: 90 Minutes

MSDN Webcast: Offline Data Synchronization with the Microsoft Sync Framework (Level 100)
In this webcast, we give an overview of the Microsoft Sync Framework and describe its key components that enable any data store to exchange information. We examine the built-in synchronization providers, Sync Services for ADO.NET, Sync Services for File Systems, and Sync Services for FeedSync, in addition to explaining how to implement custom synchronization providers for custom data sources. Lastly, we take a look at an example of using the Microsoft Sync Framework along with the new Microsoft SQL Server Data Services to provide synchronization capabilities across multiple applications, like Microsoft Office Access and Outlook. Presenter: Lindsay Rutter, Developer Evangelist.
4/17/2008 10:00 AM - 11:00 AM Pacific Time | Duration: 60 Minutes

Related Topic

MSDN Webcast: Database Features in Visual Studio 2008 (Level 200)
Like working with data? The Microsoft Visual Studio 2008 development system comes with many new and improved data tools. Who could say no to those cute little controls? Join this webcast for the ultimate database tools experience that you can have without a laser light show! Presenter: Zain Naboulsi, Developer Evangelist.
4/17/2008 1:00 PM - 2:30 PM Pacific Time | Duration: 90 Minutes

Added: April 12, 2008

Pratik Patel Describes the IUpdatable Interface for ADO.NET Data Services

The new IUpdatable interface supports create, update, and delete (CUD) operations on ADO.NET Data Services entities. Pratik's IUpdatable & ADO.NET Data Services Framework post of April 10, 2008 to the Astoria Team Blog describes the interface's following 10 methods:

  • CreateResource()
  • GetResource()
  • SetValue()
  • GetValue()
  • SetReference()
  • AddReferenceToCollection()
  • RemoveReferenceFromCollection()
  • DeleteResource()
  • SaveChanges()
  • ResolveResource()

Pratik promises "some examples and the sequence of calls made on the IUpdatable interface for each of them" in a follow-on post, as well as "features like ETag, Update interceptors" in later posts.

Added: April 10, 2008

White Paper: How to Choose a Data Synchronization Technology

Liam Cavanaugh's How to Choose a Data Synchronization Solution for Offline and Collaboration post of April 10, 2008 says the following about this Microsoft whitepaper about choosing between multiple sync technologies;

[W]e have posted a document titled "How to Choose a Data Synchronization Solution" which is an attempt to differentiate the offline and collaborations solutions available from Microsoft.  Hopefully this will help you better understand the various data sync technologies as well as to help answer the question of which technology is best suited for your particular needs.

Added: April 10, 2008

Rob Conery Starts a Series of MVC Storefront Tutorials

Rob describes his series as follows:

I'm creating an ongoing series of webcasts and blog posts, documenting the building of an eCommerce storefront using ASP.NET MVC. It's important to understand that this application has not been built yet - you're gonna help me do it :).

The goal is to build this application as openly, and "currently" as possible using an Agile approach with TDD. My goal is to post to this series at least twice a week as I build this application, taking your feedback and adjusting/discussing issues as they come up.

The project uses LINQ to SQL as its default data source, but Rob plans to plug in NHibernate and Subsonic later in the series.

Here are the episodes as of April 10, 2008:

So far, Rob has received plenty feedback on his "Agile approach with TDD" from TDD purists. His MVC Storefront: Intermission post of April 8, 2008 documents his reaction to the comments to the first two posts.

Added: April 10, 2008

Scott Guthrie: ASP.NET Dynamic Data Preview Available

Scott's ASP.NET Dynamic Data Preview Available post of April 10, 2008 includes the following description:

This new dynamic data preview now works with the standard built-in ASP.NET data controls (GridView, ListView, FormView, DetailsView, etc).  The dynamic data support enables these controls to automatically handle foreign-key relationships.  For example, on a gridview you'll now get automatic friendly name display of foreign key column values and automatic drop-down list selection support of these values when in edit mode.

The preview doesn't yet support Entity Framework. According to David Ebbo's day-earlier post of the same name:

Note that even though the drop has the ability to support Entity Framework (in addition to Linq To Sql), you will not quite be able to use it yet because it targets an Entity Framework build that is newer than the latest public build.  But don't worry, it won't be long before the missing pieces that will allow this are made available.

Added: April 10, 2008

Chris Rock Continues His LINQ to SQL Dynamic Queries Series

His LINQ TO SQL Dynamic Queries #3 (And's & Or's Together) post of April 10, 2008 extends his quest for dynamic Where clauses in LINQ to SQL expression. His previous two posts on this topic are:

LINQ TO SQL Dynamic Queries (And Operators)
LINQ TO SQL Dynamic Queries (Or Operators)

Added: April 10, 2008

Damien Guard Creates a Tiny Class to Enumerate Enums with LINQ

Damien's Using LINQ to foreach over an enum in C# post of April 10, 2008 describes a small Enums class to enable:

foreach(CustomerTypes customerType in Enums.Get<CustomerTypes>())

Cool.

--rj

Calais.NET Abstracts RDF Metadata from HTML, XML and Plain Text Documents with LINQ to XML

Chris Fulstow, an ASP.NET developer in Sydney, has written a API wrapper for the Calais Web service "that abstracts away web service details like complex XML input parameters and verbose RDF output data by processing the data with LINQ to XML." Chris's Calais.NET - generating metadata using the Calais web service post of March 21, 2008 explains his open-source project, which is licensed under the Microsoft Reciprocal License (Ms-RL) and available for download from Codeplex.

You pass the URL for an HTML, XML or plain text document to the Calais.NET API wrapper and receive a IEnumerable<string> of Resource Description Format (Semantic Web) entities that the Calais Web service detects in the document. For the current list of entities that Calais claims to detect, go to Calais Semantic Metadata.

Calais, which is sponsored by Reuters, delivers a free Web service that has this lofty goal and components:

The Calais initiative seeks to help make all the worlds content more accessible, interoperable and valuable via the automated generation of rich semantic metadata, the incorporation of user defined metadata, the transportation of those metadata resources throughout the content ecosystem and the extension of it’s capabilities by user-contributed components.

The Calais initiative has three major components:

  • The Calais Web Service is the core. The Web service provides for the automated generation of rich semantic metadata in RDF format.
  • A series of sample applications to demonstrate how the web service can be utilized and serve as a starting point for other’s development activities.
  • Active support for developers that want to incorporate Calais capabilities in their applications and web sites.

The Calais initiative is sponsored by Reuters and built on ClearForest technology.

Calais was the primary topic of The semantic web: Start making sense story for The Economist's "Technology Monitor" column of April 9, 2008. The column also mentions a number of other startups whose business plans relate to extracting metadata from ordinary text

Added: April 10, 2008

Danny Simmons: Visual Studio 2008/.NET Framework 3.5 SP1 to be Entity Framework's Shipping Vehicle

Danny wouldn't provide a date, but advises in EF will ship with SP1 of VS 2008/.Net Framework 3.5 (April 9, 2008) that EF will ship in VS2008 SP1 "this summer" and that EF beta bits will be in the forthcoming VS 2008 SP1 beta.

Danny also says that he'll be at DevConnections in Orlando in a couple of weeks giving these two EF presentations:

VMD314: Entity Framework in the Real World
Daniel Simmons
Come see the Entity Framework in action! Check out an exciting new open source application built on the Entity Framework. During this session we’ll discuss and demo the use of the Entity Framework to build a LOB application in the healthcare vertical.

VDM215: Entity Framework: Application Patterns
Daniel Simmons
Microsoft is introducing the ADO.NET Entity Framework and the Entity Data Model to help developers code against first-class business objects when creating business applications. Like any new technology, most of the information available on the topic focuses on what the Entity Framework is, what are its constituting components and related aspects. This session takes the audience beyond the “what“ of the Entity Framework, instead delving into various application scenarios and approaches to application architecture to show how one can use the Entity Framework today. We shall discuss the role of Entity Framework in Web, rich-client, and service-oriented applications.

Ryan Dunn Posts First SQL Server Data Services Sample App Available to Download or Test

It might have a funky name but Ryan's PhluffyFotos Sample Available post of April 9, 2008 is the first of what I hope will be several sample applications that use SSDS as their data source. Following are highlights:

    • This sample has a LINQ-to-SSDS provider in it.  You will notice we don't use any strings for queries, but rather lambda expressions. I had a lot of fun writing the first version of this and I would expect that there are a few more revisions here to go. Of course, Matt Warren should get a ton of credit here for providing the base implementation.
    • This sample also uses a very simplistic ASP.NET Role provider for SSDS. Likely updates here will include encryption and hashing support.
    • We have a number of Powershell cmdlets included for managing authorities and containers.

You must have credentials for the SSDS limited beta to run the sample code. If you don't, here's a link to an online version.

Beth Massi Offers Link List for VS 2008 N-tier Application Resources

Beth has accumulated a feed of Resources for Building N-tier Applications (April 9, 2008), which includes N-Tier and Remote Applications with LINQ to SQL.

Liam Cavanagh Demonstrates FeedSync Between Machines with the Sync Framework

Using the Microsoft Sync Framework to upload data to SQL Server Data Services (SSDS) isn't a built-in feature yet, but the following sample project will give you a leg up when Sync becomes the favorite way of keeping offline data sources synchronized.

According to Liam's Synchronization of Browser Favorites using FeedSync and the Microsoft Sync Framework of April 8, 2008:

At first, creating a new provider and figuring out how to make it sync can be a little intimidating. In order to help you through the process, we will walk through the creation of a simple provider that can sync between directories that contain Favorites. We will start first with the metadata store that the provider will use, since considering how metadata will be stored is the first step a provider writer should take when writing a provider. On top of this, we will build the provider, which will provide our actual sync capability. Then, we will use this provider to produce and consume feeds so that we can share our favorites between computers.

Liam presented Sync to the Web - Enable Offline Access to Web Data from any Data Store, which covers the use of Sync Framework with SSDS, at MIX 08.

Pablo Castro wants Input for Batching ADO.NET Data Services Requests

Pablo's Batching Data Service Requests post of April 6, 2008 casts a net for suggestions from developers and data architects for the syntax of batched CRUD operations with Astoria.

Ryan Dunn Interviews SSDS Architects Istvan Cseri and Nigel Ellis for Channel9

The blurb for the Istvan Cseri and Nigel Ellis: SQL Server Data Services Architecture interview posted April 7, 2008 says:

SQL Server Technical Evangelist Ryan Dunn sits down and talks turkey with two of the creators of SQL Server Data Services (SSDS), Architect Istvan Cseri and Development Manager Nigel Ellis. Istvan and Nigel dig into how to design applications for SSDS and cover a number of the interesting aspects of working with SSDS in terms of features, design, and security.

If you're interested in working with SSDS, don't miss this video segment.

Debra Dove: Avoid SQL Server 2008 (Katmai) Connection Problems

If you're using a pre-release version of SQL Server 2008 (Katmai) you've probably performed the required patches. If not, read Debra's Connecting to Pre-Release Versions of SQL Server 2008 – Part Deux of April 7, 2008.

Note that neither LINQ to SQL or Entity Framework will support SQL Server 2008's GEOMETRY or GEOGRAPHY datatypes or SPARSE columns.

Paul Stovell Demonstrates SyncLINQ for Silverlight in a Live Application

Paul's SyncLINQ for Silverlight post of April 7, 2008 has an embedded Silverlight app that demos data binding with his open source SyncLINQ project.

Note that the entries you add don't persist.

Updated Version of "Rumor: Google to Compete with SimpleDB and SSDS with Bigtable as a Web Service"

My post about the Google App Engine, which undoubtedly will compete with SQL Server Data Services, has been extensively updated to cover it's release to limited beta status on Monday night, April 7, 2008.