Friday, May 30, 2008

Google App Engine Opens to All Comers and Gets Price List

Updated May 30, 2008: See end of post for Garrett Rodger's take on GAE vs. AWS pricing (from ZDNet)

Google's May 27, 2008 Google App Engine to Announce Open Sign-ups, Pricing Plans, and New APIs at Google I/O press release announces that:

Google App Engine is announcing open sign-ups. More than 150,000 developers have joined the product's waiting list over the past 6 weeks; on Wednesday, Google App Engine will be available to everyone -- no waiting required.

Later this year, once the preview period has ended, developers can expect to pay:

  • Free quota to get started: 500MB storage and enough CPU and bandwidth for about 5 million pageviews per month
  • $0.10 - $0.12 per CPU core-hour
  • $0.15 - $0.18 per GB-month of storage
  • $0.11 - $0.13 per GB outgoing bandwidth
  • $0.09 - $0.11 per GB incoming bandwidth

Google App Engine will provide two new APIs in the coming weeks. The image-manipulation API enables developers to scale, rotate, and crop images on the server, and the memcache API is a high-performance caching layer designed to make page rendering faster for developers.

For comparison, here's Amazon's SimpleDB pricing:

  • Machine Utilization - $0.14 per Amazon SimpleDB Machine Hour consumed
  • Data Transfer $0.100 per GB - all data transfer in$0.170 per GB - first 10 TB / month data transfer out
    $0.130 per GB - next 40 TB / month data transfer out
    $0.110 per GB - next 100 TB / month data transfer out
    $0.100 per GB - data transfer out / month over 150 TB
  • Structured Data Storage - $1.50 per GB-month

Notice Google's aggressive pricing for their version of "structured data storage"; otherwise Amazon's rates for SimpleDB are similar to Google's.

Here are the US rates for Amazon S3, which are similar to those for GAE:

    • Storage
      $0.15 per GB-Month of storage used
    • Data Transfer
      $0.100 per GB - all data transfer in
      $0.170 per GB - first 10 TB / month data transfer out
      $0.130 per GB - next 40 TB / month data transfer out
      $0.110 per GB - next 100 TB / month data transfer out
      $0.100 per GB - data transfer out / month over 150 TB
    • Requests
      $0.01 per 1,000 PUT, POST, or LIST requests
      $0.01 per 10,000 GET and all other requests except DELETEs

Amazon EC2 has the same data transfer rates as SimpleDB and S3. EC2's Small Instance [1.7 GB of memory, 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit), 160 GB of instance storage, 32-bit platform] is $0.10 per hour or approximately $72.00 per month. Google's price for 160 GB of storage (at $0.15 per GB/month) is $24.00 per month.

I'd say Google is the price leader at the moment and will set the bar for pricing by all cloud service vendors, including Microsoft, for services that aren't advertising supported (when these services go commercial.)

Update May 30, 2008: ZDNet Googling Google blogger, Garrett Rogers, finds Google App Engine pricing a disappointment in his May 29, 2008 post. Garrett makes a comparison similar to mine and concludes:

It wasn’t a secret that this was going to happen, but I have to admit, I am a bit surprised by the cost of the service. If there was any doubt before, Google has made it clear that it’s in direct competition with Amazon’s web services by making their pricing nearly identical. This surprises me because Google is the king at making things ridiculously cheap — not comparable.

As Garrett admits, it's Google's free quota of 500 MB of data storage and 5 million page views that differentiates their service. Substantially undercutting Amazon's rates for production applications might be considered predatory pricing.

Wednesday, May 28, 2008

LINQ and Entity Framework Posts for 5/27/2008+

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

Les Liaisons Dangereuses

Image courtesy of Julie Lerman, Google, and an attack from a site in the .cn TLD.

Update 5/28/2008: Speaking of attacks from the .cn TLD, check out Wired's Did China's Hackers Shut Off the Lights? article of May 29, 2008 by Noah Shachtman that carries this lead:

Hackers working on behalf of China's People’s Liberation Army have penetrated networks controlling electric power grids in the United States, computer security experts believe. And that may have precipitated a massive blackout on the east coast in 2003, as well as a blackout in Florida this year.

Added: 5/28/2008

Ryan Dunn Explains SQL Server Data Services Plain Old XML (POX) Serialization Scheme

SQL Server Data Services (SSDS) hasn't been upgraded with ADO.NET Data Services' (Astoria's) Atom/AtomPub or JSON wire formats, so you're currently stuck with POX that's similar to what's emitted by the original .NET 1.0 XmlSerializer. (Astoria doesn't support POX, but Pablo Castro once promised it.)

Ryan gives a simple example of deserializing and serializing the POX format to and from a class with the XmlSerializer in his Serialization in SSDS post of May 28, 2008. Serializing is a bit more difficult because the XML is missing the xsi:type element that defines one of the five data types that SSDS currently supports. Ryan ends up using Reflection to get the object's properties and then builds the XElement(s) by hand.

Added: May 28, 2008

More Evidence that the ADO.NET Team is Abandoning LINQ to SQL

Damien Guard's "Short answer: No" comment to the contrary notwithstanding, an anonymous commenter (JD) added on May 28, 2008 the following to my Is the ADO.NET Team Abandoning LINQ to SQL? post:

Further proof: no mention of the released-with-3.5 LINQ to SQL in the prep guide for the upcoming ADO.NET 3.5 certification exam, but there's a full section on the released-post-3.5 entity framework. DUMB.

The "Object Relational Mapping by Using the Entity Framework" topic counts for 11 percent of the overall score for Exam 70-561, Microsoft .NET Framework 3.5, ADO.NET Application Development includes the following subtopics:

  • Define and implement an Entity Data Model.
  • Query data by using Object Services.
  • Map data by using the Entity SQL Language.
  • Access entity data by using the EntityClient Provider.

Added: May 28, 2008

Google App Engine Opens the Gates with Pricing Competitive to or Better than Amazon Web Services

Google's May 27, 2008 Google App Engine to Announce Open Sign-ups, Pricing Plans, and New APIs at Google I/O press release announces that:

Google App Engine is announcing open sign-ups. More than 150,000 developers have joined the product's waiting list over the past 6 weeks; on Wednesday, Google App Engine will be available to everyone -- no waiting required. ...

Google App Engine will provide two new APIs in the coming weeks. The image-manipulation API enables developers to scale, rotate, and crop images on the server, and the memcache API is a high-performance caching layer designed to make page rendering faster for developers.

My Google App Engine Opens to All Comers and Gets Price List post of May 28, 2008 compares Google's posted prices with those for Amazon Web Services: SimpleDB, S3 and EC2. Current CPU usage, data transfer and storage limitations for free services during the preview period will remain in effect until "later this year," when the new pricing for additional capacity will go into effect.

My conclusion: Google is the price leader at the moment and will set the bar for pricing by all cloud service vendors, including Microsoft

Added: May 28, 2008

PDC 2008 to Emphasize The Microsoft Cloud Platform, Live Mesh, SQL Server Data Services and ADO.NET Data Services

Ray Ozzie will keynote Professional Developers Conference 2008 and expand on his MIX 08 keynote about Microsoft's Web-based services.

The initial session list includes the following presentations about the cloud platform, SQL Server Data Services (SSDS), ADO.NET Data Services (Astoria), and Live Mesh synchronization services, including those for Astoria:

  • A Day in the Life of a Cloud Service Developer
  • Architecting Services for the Cloud
  • Developing and Deploying Your First Cloud Service
  • Developing Applications Using Data Services (Astoria and SSDS)
  • Live Platform: Building Mesh Applications
  • Live Platform: Mesh Services Architecture Deep Dive
  • Live Platform: New Developer Services and APIs
  • Logical Queuing: Developing Occasionally Connected Clients
  • Scalable, Available Storage in the Cloud
  • Under the Hood: Architecture of Storage in the Cloud
  • Under the Hood: Building SQL Server Data Services (SSDS)

PDC 2008 will feature 160+ technical sessions plus 11 pre-conference tutorials, including:

NET Data Access from A to Z

Presenter(s): Michael Pizzo, Jose Blakeley

Microsoft® has recently introduced several industry-leading innovations to ADO.NET. These innovations include LINQ to SQL, LINQ to DataSet, and the ADO.NET Entity framework with LINQ to Entities. These technologies are complementary to the existing, familiar ways for accessing data with the ADO.NET foundation such as DataSets and ADO.NET Data Providers. During this A to Z session, Michael Pizzo and Jose Blakeley, architects in the data programmability team at Microsoft, will discuss the motivation and strengths of each technology. After Jose and Michael share their insights and compare and contrast the strengths and goals of these technologies, you will leave this session knowing which data access technology best fits your need; you will also get advice on how, when, and if you should migrate from existing technologies to these new ones.

Building block services are for Microsoft's fledgling Internet Services Bus (ISB) initiative that hosts Windows Communication Foundation-enabled BizTalk services for connectivity, identity and, shortly, workflow as a Software as a Service (SaaS). The following sessions apply to ISB:

  • A Lap Around Building Block Services
  • Architecture of the Building Block Services

MSDN Magazine's recent "Connect Enterprise Apps With Hosted BizTalk Services" article by Jon Flanders and Aaron Skonnard provides an introduction to the ISB and source code for a simple Building Block service. You can sign up for a ISB preview account at the BizTalk Labs site. It wouldn't be surprising to see SSDS and Astoria integrated as Building Block services post-PDC.

Added: May 28, 2008

Steve Naughton Adds Code to Selectively Disable Insert, Edit and Delete Hyperlinks on ASP.NET Dynamic Data Controls

Steve unexpectedly continued his A DynamicData Attribute Based Permission Solution using User Roles project with a Part 6 - Miscellaneous bits post of May 28, 2008, which provides snippets for the following tasks:

  • Disabling Insert hyperlinks on List and Details, etc.
  • Removing; Edit, Delete, Details hyperlinks from Lists

David Ebbo of the ASP.NET Dynamic Data team explains in a Sample: Dynamic Data and attribute based permissions post of May 27, 2008 why role-based permissions weren't provided out of the box:

This is something that we had been thinking about putting in the product early on, but decided against for a couple reasons:

  • This was a short product cycle for us, and we had some pressure to limit the v1 feature set.
  • We were not confident that we could come up with something generic enough to please everyone, so we opted instead to make Dynamic Data extensible enough that the permission system could be implemented on top of it.

Thanks a lot to Steve for coming up with this and taking the time to blog it so thoroughly!

Here's hoping that developers using the scaffold will have heard about Steve's critical addition so they don't need to start from scratch on a critical feature. I'll include a link to Steve's posts in my article about ASP.NET Dynamic Data for Visual Studio Magazine's September issue.

Added: May 28, 2008

LINQ to SQL Advocate Jim Wooley Mulls Over Danny Simmons' "Why Use the Entity Framework" Post

Jim's not sanguine that the entity framework is "a data layer for all seasons" as Danny infers in his Why use the Entity Framework? post of May 17, 2008. Jim says in his Danny Simmons compares the Entity Framework to similar technologies post of May 27, 2008:

[Danny] is indicating that the EF should be the defacto mechanism for building the entity structures around which the various components of your system will be built. Thus one tool to answer the various solutions. Is the EF really the best way to expose relational data from a reporting or analysis perspective, time and performance analyses will tell. He does go on in the comments to his post indicating that he is not necessarily advocating re-using the same entities for all of these various application components, but rather to use a similar tooling to create the potentially separate entities that each subsystem will consume. While it makes the programmatic portion easier, the jury is still out on the other areas.

I'm still getting up to speed on the EF, but do have concerns regarding the POCO (Plain Old Class Objects) story and some of the other requirements that the EF puts on your entity and database models.

My take is that the combination of EF's EntityClient and Entity SQL has the potential to create a truly vendor-agnostic front end for all RDBMSs for which an EF-enabled ADO.NET Data Provider is available. The Canonical Command Tree translates Entity SQL queries into the selected RDBMS's SQL dialect. By EF's RTM, all major commercial and most open-source databases will be EF-compatible. The Object Services layer, which introduces a significant performance hit and would impede reporting and analysis operations by delivering objects, is optional.

The question is whether Microsoft will open SQL Server Reporting Services and Analysis Services/BI to other back-ends via the Entity Client/Entity SQL combination. Perhaps we'll be able to find out from Mike Pizzo or Jose Blakeley in October at PDC 2008's .NET Data Access from A to Z pre-conference tutorial.

Added: May 28, 2008

Marcelo Lopez Ruiz Explains Breaking Changes to the Syntax of ADO.NET Data Services Query Interceptors

Query interceptors return a predicate expression instead of an IQueryable<EntityType> and no longer take arguments, according to Marcelo's Query Interceptor changes for ADO.NET Data Services post of May 27, 2008. The interceptor returns a lambda expression instead of the result of a LINQ where query. Here's the reason for the change:

Why did we make this change? One of the main reasons is that this allows us to run query interceptors on $expand segments in addition to the regular paths. So for example if you query for /Customers?$expand=Orders, then any query interceptors on Orders will also run, giving a consistent view of the data in the service to its clients.

Added May 27, 2008 16:20 PST

Mike Taulty Finds User Authentication for ADO.NET Data Services to be More Complex Than Expected

Mike's Authenticating with ADO.NET Data Services post of May 27, 2008 begins with the assumption that, because Astoria uses HTTP, IIS and Windows Communication Framework (WCF), user authentication can take advantage of in-built services. The problem is that IIS's basic, digest, NTLM, Windows and certificate authentication schemes are wired to Windows credentials.

Mike settles on anonymous IIS access with ASP.NET authentication for the Astoria service. He then sets up his client to use Forms authentication on the Services page of the project's Properties window. Finally, Mike hooks the BeforeSendingRequest event to manage the AuthenticationCookies:

And I am "in business" :-) I have my server-side code doing authentication based on ASP.NET membership, I have my client side code using that same membership system to authenticate its requests into that service and I have an entirely pluggable credential validation mechanism for the back-end.

He then tackles the same process from Astoria's AJAX client from CodePlex and concludes:

Of course, the next question is what to do about authorisation?  but that's another story.

Use LINQ to Simplify Selecting Items From ASP.NET ListBox's ListItemsCollection

Devprise's Querying Selected Items From ListItemCollection Using Lambda Expressions post of May 27, 2008 compares conventional foreach, foreach with yield, a simple LINQ query expression with a where clause, and a LINQ Where method call query to add selected items to a generic List<ListItems> collection.

Alvin Yong Recommends Lightweight DTOs with LINQ to SQL or Entity Framework in n-Tier Scenarios

Alvin suggests in his LINQ for n-Tier Architecture post of May 27, 2008:

... creating lightweight data transfer objects or DTOs which are hydrated from LINQ entities. These objects will contain enough information to populate controls on a page and later are used to encapsulate data which should be sent back to the database.

This strategy worked beautifully from the perspective of using LINQ to interact with the database. The DTOs were simple to write and where they really excelled at was “flattening” of data from related entities. They really shone for containing data that spanned different entities!

He says he "will post more on this architecture later" when he has more free time.

SQL Server Data Services Rolls Out "Sprint 2" Upgrade

The SQL Server Data Services (SSDS) team's Sprint 2 goes live post of May 26, 2008 announces the second upgrade to SSDS servers were completed last week. Here's their list of new or improved features:

  • Full text index and search
  • Multiple B-Trees - this will allow us to deploy schemas as we move toward supporting schemas in SSDS
  • Asynch queries - this will help in exposing fanout queries across multiple containers
  • Logging and tracing improvements to help us manage and debug the service efficiently
  • Backup and restore services
  • Improvements to our Distributed Data Fabric for failover and friendly swapping between primary and secondary partitions

Hopefully, documentation for using the new features will appear quicker than that for SSDS v1.

Repeated from: LINQ and Entity Framework Posts for 5/22/2008+

Tuesday, May 27, 2008

LINQ and Entity Framework Posts for 5/22/2008+

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

SQL Server Data Services Rolls Out "Sprint 2" Upgrade

The SQL Server Data Services (SSDS) team's Sprint 2 goes live post of May 26, 2008 announces the second upgrade to SSDS servers were completed last week. Here's their list of new or improved features:

  • Full text index and search
  • Multiple B-Trees - this will allow us to deploy schemas as we move toward supporting schemas in SSDS
  • Asynch queries - this will help in exposing fanout queries across multiple containers
  • Logging and tracing improvements to help us manage and debug the service efficiently
  • Backup and restore services
  • Improvements to our Distributed Data Fabric for failover and friendly swapping between primary and secondary partitions

Hopefully, documentation for using the new features will appear quicker than that for SSDS v1.

Added: May 27, 2008

Steve Naughton Completes His Five-Part Permission Solution for ASP.NET Dynamic Data

UK Web developer Stephen Naughton has completed a five-part tutorial for adding role-based permissions to an ASP.NET Dynamic Data project on May 26, 2008:

  • Introduction - A DynamicData Attribute Based Permission Solution using User Roles.
  • Part 1 - Permissions Attribute (Metadata) Classes.
  • Part 2 - Sample Metadata for project.
  • Part 3 - The Helper Extension Methods.
  • Part 4 - Limit Tables shown on Default page and List, Edit & Details etc.
  • Part 5 - Generate Columns/Rows (using IAutoFieldGenerator)

    Following are two earlier posts on Dynamic Data topics:

  • DynamicData - Limit the Filter Fields
  • DynamicData - Automatic Column Update

    The ASP.NET Dynamic Data team's David Ebbo thanks Steve for his contribution in his Sample: Dynamic Data and attribute based permissions post of 5/7/2008.

    Added: May 27, 2008, Updated: May 27, 2008

    David Ebbo Explains How to Disambiguate ASP.NET Dynamic Data's PageRequestManagerServerErrorException JavaScript Error

    ASP.NET Dynamic Data turns on AJAX partial rendering using an UpdatePanel by default, which substitutes PageRequestManagerServerErrorException errors for more informative messages. In his Dynamic Data, AJAX and JavaScript errors post of May 25, 2008, David explains how to turn off partial rendering (open the Site.master file (at the root of the app) and set EnablePartialRendering="false") so you can see the real error message.

    Added: May 27, 2008

    ADO.NET Entity Framework v2 Wish List Started in MSDN Forum

    If you want to influence the feature list for the next version of the Entity Framework (EF), now's the time to add your request to the v2 Wish Lists - Add Yours Here thread that John Papa started in the ADO.NET Entity Framework and LINQ to Entities (Pre-release) forum. As of May 27, 2008 there were 13 replies in the thread.

    Added: May 27, 2008

    Diego Vega Explains How the EntityDataSource DataBinds Complex Types to ASP.NET Server Controls

    Diego's EntityDataSource's flattening of complex type properties post of May 24, 2008 is an expansion of the answer he give Julie Lerman in response to her Re: DataBinding Complex Type properties question of the same date in the ADO.NET Entity Framework and LINQ to Entities (Pre-release) forum. This post is an expansion of Diego's earlier EntityDataSource: To wrap or not to wrap post of May 13, 2008.

    In short, the EntityDataSource (EDS) flattens complex properties to enable two-way databinding to ASP.NET controls with Eval("Address.Street"), DataField = "Address.Street" and Bind("Address.Street") methods. An exception is one-way binding to ComboBoxes which requires an explicit projection with an alias, such as Select ContactID, Address.Street As Street.

    Added: May 24, 2008

    Francois Vanderseypen Explains Why He Didn't Use Entity Framework in his Sample Project

    In his Linq To Sql or Entity Framework? post of May 24, 2008 Francois says he decided not to use Entity Framework for the Northwind Factory v2.1 sample project for the following reasons:

    It seems Microsoft had the intention to ship the EF with VS2008 but a lack of time forced them to drop it and it’s now planned for SP1. Still even at this SP1-beta stage it’s somehow unacceptable that the multi-tiered solution, which should be there out of the box, is not present. Neither in L2S nor in the EF. It’s unacceptable for me in the sense that the whole world is now gravitating around multi-layered applications and any ORM or DAL system should enable this scenario (No out-of-the-box story!).

    EF appears to me to be closer to a Microsoft multi-tiered implementation than LINQ to SQL because it serializes complete object graphs with the updated SP1 DataContractSerializer (DCS). Danny Simmons demonstrated the feasibility of a multi-tier EF with the Perseus project and its EntityBag. The question now is whether Danny intends to rearchitect Perseus with DCS or stick with EntityBag.

    Added: May 24, 2008

    Dinesh Kulkarni on Object Tracking and LINQ to SQL DataContext Lifetime

    Dinesh explains that LINQ to SQL's object (instance) tracking feature is intended to prevent entities returned by successive queries from "stomping" on cached entity values. In his LINQ to SQL Tips 6: How to refresh given DataContext won't stomp on your objects post of May 23, 2008, Dinesh notes that you can overwrite the current values of one or more specified entities with the DataContext.Refresh method. However, he cautions that "the changes in the database for a given query can be:

      1. Newly inserted objects
      2. Updates of existing objects
      3. Deleted objects that were present in a previous execution of the same query

    Issuing the same query with the same DataContext takes care of the first. Refresh() can handle #2. But #3 requires a little more thought and computation. You could certainly use another DataContext to compare results."

    The issue resolves to selecting the appropriate DataContext lifetime, as recommended in his Lifetime of a LINQ to SQL DataContext post of April 27, 2008. If your application is stateful, consider separate DataContexts for online transaction processing (OLTP) and reference data. Dinesh's recommendations also apply to projects that use the Entity Framework.

    Added: May 24, 2008

    Rob Conery Completes MVC Storefront Parts 11 and 12 with Moq and Jimmy Bogard Proposes an nHibernate Fork 

    Rob's MVC Storefront, Part 11: Hooking Up The Shopping Cart And Components and MVC Storefront, Part 12: Mocking of May 23, 2008 continue the MVC Storefront saga. Part 12 uses Moq (a.k.a. LINQ for Mocks) to mock the repository's authentication data (Email, UserID, and Password).

    Rob acknowledges in Part 12 Jimmy Bogard's proposal in The MVC Storefront Challenge! post of May 20, 2008 to fork the code with nHibernate replacing LINQ to SQL. The comments include responses from several potential volunteers to help with the coding.

    Added: May 24, 2008

    Test Google Sites LINQ and Entity Framework Wiki Started

    I needed a place to catalog links to LINQ and Entity Framework resources, such as magazine articles, online help pages, and blog posts, that aren't date-sensitive. Google Sites opened as a free service to the public this week, so I set up a LINQ-EF site with pages of "announcements" for LINQ and EF-related topics. The LINQ-EF site isn't meant to compete with Troy Magennis's Hooked on LINQ Wiki; it doesn't include any original content.

    Google Sites is based on the JotSpot model but with many advanced JotSpot features missing. (Google acquired JotSpot in late October 2006.) It's simple to set up and navigate, and it substitutes an HTML editor for the arcane markup used by many wikis. It doesn't yet integrate with other Google Apps. It's certainly not the "SharePoint" killer that some bloggers claim, but it's probably good enough for my current needs.

    Added: May 24, 2008

    Dates, Times and Codes Added to Most Tech*Ed LINQ and Entity Framework Sessions

    The LINQ and Entity Framework Breakout and TLC Sessions at Tech*Ed Developers 2008 post was updated May 23, 2008 to include date, time and code data from the ADO.NET Team's Going to TechEd? Drop by and say Hi! blog of the same date.

    Apparently, only Tech*Ed 2008 Developer attendees have access to this added data.

    Added: May 24, 2008

    Has LINQ to SQL Reached Legacy Status Less than Three Months after Launch?

    LINQ to SQL was the only new data-access implementation to be included in Visual Studio 2008 when it "launched" with SQL Server 2008 and Windows Server 2008 in a series of "Heroes Happen Here" extravaganzas that started on February 27, 2008.

    Judging from my Is the ADO.NET Team Abandoning LINQ to SQL? post of May 21, 2008, Microsoft appears to have ceased further development of LINQ to SQL, based on the lack of new and promised features in the LINQ to SQL SP1 Beta.

    Repeated from: LINQ and Entity Framework Posts for 5/19/2008+

    Updated 5/23/2008 with a response to a comment from Andres Aguiar and Julie Lerman's Damien Guard joins the LINQ to SQL team as a developer post of the same date.

    Quick Links to VS 2008 SP1 Beta Docs

    My VS 2008 and .NET Framework 3.5 SP1 Beta Documentation and Forum Links of May 22, 2008 has links to LINQ, Entity Framework and related topics in the unsearchable (and unindexed) MSDN Library.

    Marcin Dobosz on Customizing ASP.NET Dynamic Data Validation Metadata

    Marcin's Dynamic Data samples: Custom metadata providers post of May 23, 2008 explains how to "programmatically add [data validation] metadata attributes to an in-memory store before you register your model with the Dynamic Data runtime in Global.asax." This sample replaces the XML-based metadata provider for the December 2007 CTP.

    His earlier Dynamic Data samples post contains a list of the current and forthcoming ASP.NET Dynamic Data samples. (I added a "Where's the beef?" comment to this post.)

    A Solution for the KB944899 Problem When Attempting to Install VS 2008 SP1 Beta

    Wally McClure found the Visual Studio 2008 Hotfix Cleanup Utility on the MSDN Code Gallery. This small *.exe file removes KB944899, if present, and removes the registry keys that cause the problem.

    Matt Manela Explains LINQ to SQL's Optimistic Concurrency Management Features

    In his Intro to LINQ to SQL Optimistic Concurrency post of May 22, 2008, Matt explains the significance of the UpdateCheck.Always, UpdateCheck.Never, and UpdateCheck.WhenChanged properties when managing updates with optimistic concurrency conflicts.

    Scott Allen Analyzes Rob Conery's Problems with LINQ to SQL Lazy Loading

    Scott left a comment to my "Rob Conery Runs into a LINQ to SQL Corner with his Repository Model" topic of LINQ and Entity Framework Posts for 5/19/2008+ that Rob's conclusion it was LINQ to SQL's fault: "I'd say that requires more investigation. Doesn't sound correct."

    His Rob's Not So Lazy MVC Storefront post of May 21, 2008 uncovers the real culprit, a type conversion of the IList<Product> property.

    Kevin Lewis Rewrites His UPS Webservice Rate Calculator with LINQ to XML and VB Literals

    His LINQ to UPS to Calculate Shipping Rates post of May 22, 2008 contains the full source code for his updated GetShippingMethodsFromWeb function.

    Samir Bajaj Demonstrates How to Use LINQ to SQL with Table per Type Inheritance

    From the How Did I Miss That? department: Back on April 2, 2008, Samir posted TPT with LINQ to SQL on his MSDN blog that I wasn't tracking at the time. He discusses the three common mapping strategies for object hierarchies: Table per Hierarchy (TPH), Type per Type (TPT) and Table per Concrete Type (TPCT). LINQ to SQL has out-of-the-box support for TPH only. But Samir demonstrates that you can map a TPT hierarchy "using the built-in TPH support and a bit of T-SQL code."

    The sample code is available here: TPT with LINQ to SQL.

    Marco De Sanctis Asserts That It's Not Always a Wise Choice to Eager-Load Associated Entities in LINQ to SQL Projects

    Most developers using LINQ to SQL as the data layer eager-load associated entities to minimize round trips to the database. In When Lazy Loading associations is useful of May 22, 2008, Marco describes two scenarios where lazy loading may be beneficial.

    Marco De Sanctis Wraps LINQ to SQL's Data Context in a Generic Unit of Work Instance for Caching by ASP.NET

    His Linq To Sql in real word Web applications post of May 20, 2008 shows you how to wrap LINQ to SQL's Data Context in a generic Unit of Work instance to emulate nHibernate's SessionPerConversation pattern. His post includes a link to download the sample code.

  • Friday, May 23, 2008

    LINQ and Entity Framework Breakout and TLC Sessions at Tech*Ed Developers 2008

    This list was compiled from the Tech*Ed Developers 2008 Session Catalog with LINQ or ADO.NET as the Keyword.

    Updated May 23, 2008 with date, time and code data from the ADO.NET Team's Going to TechEd? Drop by and say Hi! blog of the same date.

    Breakout Sessions

    Updated May 9, 2008: Added Julie Lerman's Advanced Entity Framework: Take Charge of Object Services session omitted accidentally. There are 19 LINQ, LINQ-related, and Entity Framework breakout sessions.

    LINQ

    LINQ to DataSet

    Date: June 6 Time: 4:30pm-5:45pm Code: TA677 
    Track: Database Platform Presenter: Erick Thompson Level: 300

    Microsoft Visual Studio 2008 introduces a number of new technologies that make working with data a better experience. One of these new technologies is Language Integrated Query (LINQ). The LINQ to DataSet flavor of LINQ gives you the ability to leverage the power of LINQ in your DataSet based applications. This session demonstrates how you can use LINQ to DataSet to improve the performance and reliability of your existing code, as well as utilize new functionality.

    XML LINQ: Linking in the Real World

    Date: Time: Code:
    Track: Developer Tools and Languages Presenter: Paul Sheriff Level: 300

    LINQ technology in .NET 3.5 has some great hooks into XML that make using XML documents a breeze. This seminar explores how you will put this technology to work in your applications. Besides the obvious advantages of using LINQ to iterate over XML data, you can also use it to create and process XML documents. One great way you can use XML is in prototyping. In this seminar, see how to use LINQ and XML to create faster prototypes for your customers.

    Microsoft Visual Basic 2008: Microsoft LINQ Language Tips, Tricks, and Best Practices

    Date: Time: Code:
    Track: Developer Tools and Languages Presenter: Amanda Silver Level: 300

    LINQ (Language Integrated Query) is a key platform innovation introduced with Microsoft Visual Studio 2008, which brings SQL-style query expressions into Visual Basic and Visual C#, enabling you to describe what data to reason about instead of how to access the data. In this session, by taking a much closer look at the language features that enable LINQ-enabled frameworks, we uncover tips, tricks, gotchas and best practices for writing queries that will help you write robust, high-performing, maintainable business applications more quickly. In addition to gaining a solid understanding of LINQ for data access, you’ll also leave this session with a clear understanding of how query and the individual language features can be leveraged in other parts of your application to write less code.

    Super-Optimized Microsoft LINQ: Indexed Objects

    Date: Time: Code:
    Track: Developer Tools and Languages Presenter: Aaron Erickson Level: 300

    LINQ (Language Integrated Query) is a key platform innovation introduced with Microsoft Visual Studio 2008, which brings SQL-style query expressions into Visual Basic and Visual C#, enabling you to describe what data to reason about instead of how to access the data. In this session, by taking a much closer look at the language features that enable LINQ-enabled frameworks, we uncover tips, tricks, gotchas and best practices for writing queries that will help you write robust, high-performing, maintainable business applications more quickly. In addition to gaining a solid understanding of LINQ for data access, you’ll also leave this session with a clear understanding of how query and the individual language features can be leveraged in other parts of your application to write less code.

    How LINQ Works: A Deep Dive into the Implementation of LINQ

    Date: Time: Code:
    Track: Developer Tools and Languages Presenter: Aaron Erickson Level: 400

    Want to know what really happens when you execute your favorite LINQ queries? Curious how the same query expression can target either in-memory data or relational data? In this 400-level talk, Alex Turner, the C# Compiler Program Manager, uses Reflector and other tools to reveal exactly how the compiler translates LINQ query expressions. Gain a deeper understanding of LINQ’s functional roots as we see how lambda expressions and iterator methods enable LINQ to Objects' elegant syntax. Then find out what's the same and what's radically different as we explore LINQ to SQL and the expression trees that make it tick.

    Real-World LINQ to SQL

    Date: June 3 Time: 1:15pm-2:30pm Code: TC19F
    Track: Developer Tools and Languages Presenter: Anthony Sneed Level: 400

    Take a deep dive into a real-world LINQ to SQL application that seeks to exploit the full capabilities of the object-relational mapping technology released with Microsoft .NET Framework 3.5 and Microsoft Visual Studio 2008. This talk focuses on best practices for incorporating LINQ to SQL into your data-driven Windows Forms or Windows Presentation Foundation application, including the use of eager loading, pass-through SQL, batch updating with stored procedures, concurrency control, and disconnected scenarios. We also address object caching and identity issues, as well as support for distributed transactions.

    Parallelize Your Microsoft .NET Framework-Based Applications with Parallel Extensions

    Date: Time: Code:
    Track: Development Practices Presenter: Steven Toub Level: 300

    With the Microsoft .NET Framework today, correctly introducing concurrency into libraries and applications is difficult, time consuming, and error-prone. However, as the hardware industry shifts towards multi-core and manycore processors, the key to high-performance applications is parallelism. Parallel Extensions to the .NET Framework offers solutions to help make writing concurrent applications significantly easier. In this session, we dive into Parallel Extensions, exploring Parallel LINQ-to-Objects (PLINQ), the Task Parallel Library (TPL), the underlying concurrency runtime, and more, in order to provide an in-depth look at the next generation of parallel programming with .NET.

    Introduction to Mock Objects and Advanced Unit Testing

    Date: Time: Code:
    Track: Development Practices Presenter: Roy Osherove Level: 300

    If you've played around with Unit testing but are not sure what the deal is with Mock Objects, Stubs and the like, this talk is for you. We cover, among others: what Mocks and Stubs are, hand-written mocks and stubs, dynamic mock objects using Rhino Mocks and Typemock, dependency injection techniques for Mocks and Stubs, and more; and how to mock out LINQ Queries and extensions methods.

    Use the Open XML SDK and LINQ to Program the Microsoft Office Open XML File Formats

    Date: Time: Code:
    Track: Office and SharePoint Presenter: Ken Getz Level: 300

    Although the Packaging API makes it possible to manipulate the Office Open XML Formats directly, it doesn’t make it easy. The Open XML SDK provides a consistent and neat wrapper around the API, making it far easier to get to the parts you need. Once you get to the part, however, you’re still simply working with XML content. To make this easier, LINQ to XML provides a superb tool. Both Microsoft Visual C# and Visual Basic provide support for LINQ to XML, and Visual Basic adds specific features that make the process far easier. In this session, see how to use the Open XML SDK and LINQ to XML to manipulate Open XML File Formats. Special attention is paid to the issues involved in handling namespace resolution, a tricky issue in any situation.

    Integrating Windows Presentation Foundation and Windows Communication Foundation into Your Office Business Applications 

    Date: Time: Code:
    Track: Office and SharePoint Presenter: Tim Huckaby Level: 400

    This session highlights many of the ways that the Windows Presentation Foundation (WPF) and the Windows Communication Foundation (WCF) can be leveraged in applications built with Visual Studio Tools for the Microsoft Office System (VSTO). Visual Studio 2008 introduced an array of new features aimed at a wide range of Office solution types. With Visual Studio 2008, you can build solutions that incorporate the native capabilities of the Office client applications (like Outlook) combined with the sophisticated UI capabilities of WPF that's connected to remote data and services via WCF and use the RAD features of LINQ to manipulate that data. These new technologies provide opportunities for building powerful solutions with functionality that was previously difficult or impossible to achieve. Now that Microsoft Office has evolved into a true development platform, solutions based on Office are becoming increasingly sophisticated, less document-focused, and more loosely coupled. This session shows you how easy it is to build robust solutions that leverage the latest technologies. WPF provides developers and designers with a unified programming model for building rich Windows smart client user experiences with Office client applications that incorporate UI, media, and documents. WCF contains a support framework and a design-time toolset for building service-oriented solutions that connect rich Office clients with powerful server-side functionality and remote data access. Visual Studio 2008 provides a simple GUI wizard that lets you consume WCF services without having to worry about service metadata, protocols, or XML configuration.

    Jumpstart Data Driven Web Applications with ASP.NET 3.5 (Part 1 of 2)

    Date: Time: Code:
    Track: Web and User Experience Presenter: Scott Hanselman Level: 200

    Explore the new features in ASP.NET 3.5 that make buliding data driven Web applications a breeze. In this first of a two-part series, learn how to use LINQ to take the pain out of interacting with your relational data and how support for LINQ and its constructs are built into the paradigms you are familiar with in ASP.NET and Microsoft Visual Studio 2008.

    Using Data and Web Services in Your Microsoft Silverlight Application

    Date: Time: Code:
    Track: Web and User Experience Presenter: Hamid Mahmood Level: 300

    This session covers how to use data in your Silverlight beta 1 application. Learn how to get the data (in brief… networking is well covered in other talks), how to manipulate the data (LINQ/XLINQ), how to bind the data (Databinding), how to show the data (dive into a few data relevant controls, notably Datagrid), how to validate the data, and how to store the data (isolated storage).

    Building Rich Internet Applications Using Microsoft Silverlight 2 (Part 2 of 2)

    Date: Time: Code:
    Track: Web and User Experience Presenter: Mark Rideout Level: 300

    Silverlight provides a powerful platform for building the next generation of rich interactive applications on the Internet. In this session, we demonstrate building a rich interactive application (RIA) using Silverlight and Microsoft .NET. We cover how to use Microsoft Visual Studio to create applications, how to create UI using XAML markup and code, how to build a custom control, how to retrieve data from a Web service, and how to manipulate data with XML and LINQ.

    An Introduction to LINQ on Devices

    Date: Time: Code:
    Track: Windows Mobile Presenter: Dan Fergus Level: 300

    We’ve all heard the hype, now let’s look at the reality. There are some great things about LINQ, some of which are not supported on devices. But there is much to learn to begin using LINQ effectively. The first is to know what exactly it is and what it can do for you. With a firm foundation, we then look at how to implement LINQ and discuss how it can be implemented.

    Entity Framework

    Understanding the ADO.NET Entity Framework

    Date: June 6 Time: 4:30pm-5:45pm  Code: TA677
    Track: Developer Tools and Languages Presenter: Erick Thompson Level: 300

    Most Microsoft .NET Framework-based database applications out there use ADO.NET to access and manipulate data, and most of them have a data-access layer built on top of ADO.NET to abstract out many of the details related to data-access that can get in the way of business logic. In this session, we introduce the ADO.NET Entity Framework, a high-level data library that pushes up the level of abstraction application developers need to work at when dealing with data in databases. We discuss how the system supports conceptual modeling, the use of the object services layer to do object-relational mapping, and how great integration with LINQ (Language Integrated Query) brings new levels of productivity to the data-access development space.

    Microsoft .NET Framework 3.5 Data Access Guidance

    Date: June 5  Time: 2:45pm-4:00pm Code: T276B
    Track: Developer Tools and Languages Presenter: Julie Lerman Level: 300

    With .NET 3.5, developers now have to choose between “classic” ADO.NET, LINQ to SQL, and a number of options using Entity Framework. The ADO.NET 3.5 Entity Framework presents us with a slew of new options for accessing data which you will learn about during this conference. This session compares and contrasts DataSets and DataReaders, Object Services and Entity Client; Entity SQL, LINQ to Entities and LINQ to SQL, providing guidance as to which methods are appropriate in particular scenarios. We also examine this functionality with respect to both creating new solutions and plugging the Entity Framework into existing applications.

    Advanced Entity Framework: Take Charge of Object Services

    Date: June 5 Time: 10:15am-11:30am Code: T7D80
    Track: Developer Tools and Languages Presenter: Julie Lerman Level: 300

    The Entity Framework combined with the Entity Data Model (EDM) bring data access to a new level in Enterprise Applications. Entity Framework Object Services APIs, while providing a lot of automated functionality, are filled with features that give developers much more control over how objects are handled. The most important jobs of the ObjectContext are relationship management and change tracking. This session drills into how the ObjectContext manages relationships and how you can control its behavior. This is especially important in SOA scenarios where you may need to transport ObjectGraphs. We also look closely at change tracking, focusing on the challenges and solutions for dealing with data concurrency when moving objects across tiers in your enterprise applications. Knowing what to expect from these features and how to take control of them will empower you in your use of the Entity Framework and EDMs in your Web sites, SOA applications, and smart clients, as well as other applications that share the EDM.

    Added: May 9, 2008

    Building Next Generation Data Access Layers with the ADO.NET Entity Framework

    Date: June 3 Time: 4:45pm-6:00pm          Code: ARC305
    Date: June 5 Time: 2:45pm-4:00pm          Code: ARC305R
    Track: Architecture Presenter: Barry Gervin Level: 300

    As Developers, we've been building components in our data access layer (DAL) with ADO.NET classes such as Connections, Commands, DataReaders, DataSets and our own custom Helper classes and Data Classes. We build data access layers with a clear separation of concerns between business logic, data access, and data storage. We do this to increase cohesion and maintainability of our code, and also to increase developer productivity. What does this exactly mean in terms of the Entity Framework? What is the best approach to using the Entity Framework within our Data Access Layer? There are several workable models for leveraging the Entity Definition Model (EDM) within our applications. On one end of the spectrum, we can use the Entity Definition Model as a tactical tool for data access which is isolated to our Data Access Layer. This hides the Entity Framework from the rest of our application, effectively separating the concern of data access from the rest of our application. Another technique includes leveraging the conceptual Entity Definition Model deeply throughout our solution's layers and tiers. In this session, we compare and contrast these approaches including the middle ground, and see how these architectural choices affect maintainability, readability, and developer productivity. Most developers don’t frequently have the opportunity to start from a fresh slate, so we’ll also examine a refactored evolution from traditional data access layers through to incremental use of the Entity Definition Model.

    ADO.NET Entity Framework: Application Patterns

    Date: June 6    Time: 10:15am-11:30am Code: T34C4
    Track: Development Practices Presenter: Shyam Pather  Level: 300

    Microsoft is introducing the ADO.NET Entity Framework and the Entity Data Model to help developers work at the right level of abstraction when creating business applications, and let the system worry about the details on how to deal with the underlying database. 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. There is a need for information on how to actually apply the technology to solve concrete problems in various application scenarios. This session discusses application patterns for the Entity Framework in each of the major application models such as Web applications, SOA-style systems, and data-centric services.

    Technical Learning Center (TLC) Sessions

    There are three TLC sessions.

    LINQ to XML: Plumbing the Depths

    Date: June 6 Time: 2:45pm-4:00pm Code: T4398
    Track: Developer Tools and Languages Presenter: Shyam Pather  Level: 300

    This session provides you the opportunity to expand your knowledge of LINQ to XML. XML permeates the world of data, from content to formatting to services. LINQ to XML is a new way to query this ubiquitous data format using the power of Language Integrated Query (LINQ). LINQ to XML provides both DOM and XQuery/XPath-like functionality, all from within your source code. Additionally, Microsoft Visual Basic 9.0 adds XML as a built-in data type and uses LINQ to XML to allow developers to write what they intend, without compromising best practices. This session explores these capabilities, and shows how LINQ can improve your code and its reliability.

    LINQ to XML, SQL, Entities, DataSets, and Co: Data Access Technologies Explained

    Date: June 5 Time: 1:00pm-2:15pm Code: T8808
    Track: Developer Tools and Languages Presenter: Shyam Pather  Level: 300

    With the release of the Microsoft .NET Framework 3.5, Microsoft introduced several new data access technologies based on its LINQ technology, such as LINQ to SQL and LINQ to DataSets. Shortly after, we expect Microsoft to release the ADO.NET Entity Framework which enables LINQ to Entities in addition to Entity SQL. Finally, we have all the existing ADO.NET data access patterns. This raises one important question: Which data access technology is best suited for which situation? In this session we look at different scenarios and requirements that can inform your technology decision.

    Using LINQ, the ADO.NET Entity Framework and ADO.NET Data Services with Third Party Databases

    Date: June 4 Time: 2:45pm-4:00pm Code: TCD2B
    Track: Windows and Frameworks Presenter: David Sceppa  Level: 300

    The ADO.NET Entity Framework extends the existing ADO.NET provider model to allow provider writers to make their data stores available through the Entity Framework. This model allows developers to execute store agnostic queries against their data stores using LINQ, Entity SQL or ADO.NET Data Services. Provider writers will be in attendance at this Interactive Theater presentation to talk about their plans to support the Entity Framework and demonstrate their current bits.

    Is the ADO.NET Team Abandoning LINQ to SQL?

    Updated 5/23/2008 at the end of the post.

    Danny Simmons' Why use the Entity Framework? post includes an "Entity Framework vs. LINQ to SQL" topic that lists the following advantages of Entity Framework (EF) over LINQ to SQL:

    • Full provider model with support for multiple RDBMSs, including SQL Server Compact.
    • Not tied to a one:one relationship between entities and database tables.
    • Support for Table per Class and Table per Concrete Class hierarchy models.
    • Support for entity-splitting and complex types (also called value types)

    Missing from this list are, for starters:

    • Default support for serializing complete object graphs.
    • An out-of-the-box multi-tier story for SP1.
    • Support for SQL Server Compact 3.5 SP1 in the Object/Relational Designer.

    I had expected LINQ to SQL SP1 to support bidirectional serialization for WCF service applications with SP1's updated DataContractSerializer. However, the Object/Relational Designer's Serialization property still has None and Unidirectional options only. This fix would have taken minimal development and test time. You can accomplish this yourself but refreshing the data model requires adding [DataMember] attributes by hand to Association classes that create cyclic references.

    LINQ to SQL has a much lighter footprint than EF, which makes it a better match for applications that use SQL Server Compact (SSCE) 3.5 SP1 and later. Support for SSCE by SqlMetal.exe arrived just in time for VS 2008 RTM but not by the designer. Surely there was plenty of time between VS 2008 RTM and SP1 Beta to work out this fix.

    I also was looking forward to an early version of the mini connectionless DataContext that Matt Warren promised, as noted in my Changes Coming to LINQ for SQL post of just less than a year ago.

    Compare LINQ to SQL SP1's New Features with Other ADO.NET Members

    According to the ADO.NET Team's What's New in the SP1 Beta for LINQ to SQL? post of May 14, 2008, the following tweaks are what's new:

    Across the LINQ to SQL we have made numerous bug fixes, better SQL translation for queries comparing nullable columns in Visual Basic, and support both in the runtime and the designer for SQL Server 2008.

    New SQL Server 2008 Support includes:

    • Support for connecting to SQL Server 2008 databases in Server Explorer
    • Drag & drop tables in SQL Server 2008 databases from Server Explorer
    • Support for the following new types: Date, Time, DateTime2, DateTimeOffset, Filestream

    SqlClient class members contain the majority of SQL Server 2008 support modifications and the SqlClient update is required to deliver Katmai support for SqlDataReader 3.5 across the entire Microsoft product line.

    EF and the Entity Data Model Designer received a raft of new and improved features, as did ADO.NET Data Services (Astoria), which turned into a framework between November 2007 and May 2008. Astoria currently is staffing up for v2, as evidenced by their Interested in working on the ADO.NET Data Services Framework (aka "Astoria") or XML? post of May 17, 2008.

    It's obvious to me that only trivial resources were devoted to LINQ to SQL in the post-RTM period.

    Is LINQ to SQL a Legacy Data Layer?

    If Microsoft intends to end-of-life LINQ to SQL, the ADO.NET team should notify .NET developers. In the meantime, I'm adding the following caveat to my reasons to choose EF over LINQ to SQL:

    • Entity Framework is Microsoft's strategic data access layer. LINQ to SQL has [almost | already] gained legacy status due to lack of attention from the Data Programmability group.

    Update May 23, 2008: Andres Aguiar agreed with my conclusion in his comment to this post, but stated:

    The Data Programmability Team never owned LinQ to SQL, it was owned by the C# team. That's why we have two O/R mappers, both teams wanted to ship theirs.

    The Data Programmability team gained ownership of LINQ to SQL from the C# team about the time that Tim Mallalieu of SQL-DP took over program management from Dinesh Kulkarni, as Dinesh mentioned in his October 15, 2007 LINQ to SQL: What is NOT in RTM (V1) swansong from the LINQ to SQL team. (That's the post containing the source of the no "out-of-the-box multi-tier story" quote above.)

    Tim doesn't qualify as a "great communicator." The last post to his blog was Databinding with ADO.NET Entity Framework is dated November 11, 2006. According to his LinkedIn profile, he's still employed by Microsoft as a Lead Program Manager.

    Julie Lerman's Demurrer

    Julie disagrees in her Damien Guard joins the LINQ to SQL team as a developer post of May 23, 2008. She says, "I have even seen suggestions that LINQ to SQL was intentionally cobbled and done so for political, not technical reasons." Me, too.

    Matt Warren, the outspoken architect of LINQ to SQL, says in his Mocks Nix - An Extensible LINQ to SQL DataContext post of May 4, 2008:

    LINQ to SQL was actually designed to be host to more types of back-ends than just SQL server. It had a provider model targeted for RTM, but was disabled before the release. Don’t ask me why. Be satisfied to know that is was not a technical reason. Internally, it still behaves that way. The trick is to find out how to swap in a new one when everything from the language to the runtime wants to keep you from doing it. [Emphasis added.]

    (Matt gained his reputation for "telling it like it is" with his The Origin of LINQ to SQL post of May 31, 2007 which recounted the demise of ObjectSpaces in the black hole of WinFS and described his three years after the event as a "political nightmare.")

    Julie interprets the hiring of Damien Guard by the ADO.NET Team as "an indication that the product will continue to evolve." I'm not so sure; Damien might have been hired to replace a dev lost to turnover in the ranks. The real money's being spent on the Entity Framework and its chief client, ADO.NET Data Services.

    My thanks go to Julie for describing the original version of this post as a "deeply analytical blog post." For whatever it's worth, IANAL (I am not a lawyer) nor do I have any interest in being (or imitating) one. ;-) Full disclosure: I was a draftee on a Federal Grand Jury for a year and a half some time ago. :-(.

    Thursday, May 22, 2008

    VS 2008 and .NET Framework 3.5 SP1 Beta Documentation and Forum Links

    The VS 2008 and .NET Framework 3.5 SP1 Beta documentation isn't searchable (for reasons known only to the Developer Division.) Mike Tulty provided some initial links in his VS 2008 Service Pack 1 - Docs and Installation post, which are included here. Following are links to additional topics related to LINQ and the Entity Framework, including (for convenience) links to forums.

    ADO.NET

    ASP.NET

    SP1 [Beta]

    Wednesday, May 21, 2008

    LINQ and Entity Framework Posts for 5/19/2008+

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

    Has LINQ to SQL Reached Legacy Status Less than Three Months after Launch?

    LINQ to SQL was the only new data-access implementation to be included in Visual Studio 2008 when it "launched" with SQL Server 2008 and Windows Server 2008 in a series of "Heroes Happen Here" extravaganzas that started on February 27, 2008.

    Judging from my Is the ADO.NET Team Abandoning LINQ to SQL? post of May 21, 2008, Microsoft appears to have ceased further development of LINQ to SQL, based on the lack of new and promised features in the LINQ to SQL SP1 Beta.

    Added: May 21, 2008

    Francois Vanderseypen Offers a Well-Documented Demo of a Web Client Software Factory Project that uses WCF, WF and LINQ to SQL

    His Frameworks and directions (Kyiv presentation, May 2008) post of May 19, 2008 includes a link to download a large-scale Northwind Factory v.2.1 sample project that combines the Web Client Software Factory (WCSF) from CodePlex with LINQ to SQL, Windows Communication Foundation, and Workflow Foundation. The project, which builds a complete multi-tiered, Model-View-Controller (MVC) pattered Web site, includes a 26-page illustrated NorthwindFactory.docx documentation file. NorthwindFactory.docx is the last file in the .zip archive.

    Francois's later Linq to SQL and Workflows post of May 21, 2008, casts doubt on the compatibility of LINQ to SQL data layers with the Workflow Foundation and raises other commonly blogged LINQ to SQL issues. He concludes:

    All this leads somehow to the conclusion that [LINQ to SQL] was really not designed well to fit with the rest of the .Net 3.5 framework. Great idea, but not too well implemented. Let’s hope the final release of the Entity Framework (around [A]ugust with .Net 3.5 SP1) will bring some cures.

    Francois works for Materialise Dental NV in Leuven, Belgum, the developer of "a range of products and services to aid dental specialists in the treatment of their patients," including "the SimPlant range of solutions for Computer Guided Implantology."

    Added: May 21, 2008

    Randolph Cabral Adds Business Entity Classes to His N-Tier LINQ to SQL Project

    In Exploring N-Tier Architecture with LINQ to SQL (Part 4 of n) of May 21, 2008, Randolph "attempt[s] to build out the domain model and use it in our web UI layer to demonstrate how we could interact with the business entities."

    Added: May 21, 2008

    Ben Hall Recommends When and How to Use Stored Procedures vs. User-Defined Functions with LINQ to SQL

    Ben's Linq to SQL Stored procedure vs Functions post of May 21, 2008 provides a detailed analysis of when to substitute user-defined functions (UDFs) for stored procedures in LINQ to SQL data-access scenarios.

    Added: May 21, 2008

    ASP.NET Dynamic Data Website Wizard Gets Major Overhaul in May 20 Update

    Scott Hunter's May 20th Refresh of Dynamic Data is now Available post to the ASP.NET Forums of May 21, 2008 lists 11 significant changes to the Dynamic Data Website Wizard. An important upgrade is replacing details, edit, and insert ListView with FormView controls.

    The Dynamic Data Runtime gets a few bug fixes, as well as UI and validation tweaks.

    You can download the Dynamic Data Runtime and Templates from the MSDN Code gallery.

    Added: May 21, 2008

    Frans Bouma Red-Flags VB's Aggregate LINQ Reserved Word

    According to his VB.NET: Beware of the 'Aggregate' keyword (updated) post of May 21, 2008, executing

    Dim max = Aggregate o in metaData.Order Into m=Max(o.EmployeeID)

    returns all Order entities and executes the Max() aggregate in the client's memory. Surprisingly, Frans reports in his update that the problem doesn't occur with DateTime or String values.

    Added: May 21, 2008

    Dean Whittaker Explains How to Use LINQ to SQL's DataContext Object to Recreate Test Databases

    It's a common practice to mock database operations when using Test-Driven Development (TDD) to improve performance. If you don't mock the database, it's a good practice to recreate it each time your unit tests run to update it.

    Dean Whittaker shows you how to do this in his Using Linq's DataContext to (re)create your database for testing post of May 21, 2008.

    Added: May 21, 2008

    Mike Taulty Extend's Julie Lerman's Analysis of EF Query Execution to LINQ to SQL

    Mike's "When Do Queries Execute" post of May 21, 2008 extends Julie's discovery that stored procedures execute when invoked with ExecuteMethodCall() rather than when the data is needed (see below) to LINQ to SQL queries.

    However, LINQ to SQL queries that invoke table-valued functions do so with CreateMethodCall(), which defers data retrieval until the data is required.

    Added: May 21, 2008

    Aaron Skonnard Describes the .NET 3.5 SP1 DataContractSerializer's New POCO and Cycle Capabilities

    The Windows Communication Foundation (WCF) Data Contract Serializer (DCS) has two important new capbilities:

    1. Capability to serialize complete object graphs with associations that create cyclic references (a.k.a. bidirectional serialization or cycles) for services without a hack.
    2. Capability to serialize plain old CLR objects (POCOs) by removing the requirement to decorate classes with [DataContract] and [DataMember] attributes.

    Aaron Skonnard takes on #1 in his DataContracts and object references post of May 14, 2008 and #2 in his detailed DataContracts without attributes (POCO support) in .NET 3.5 SP1 post of May 13, 2008. I missed Aaron's posts due to the activity surrounding release of .NET 3.5/VS 2008 SP1 Beta.

    Prior to SP1, you could enable serializing graphs with cycles by setting the PreserveObjectReferences argument to true in the DCS's constructor. (Failing to do this raises an exception when the DCS encounters a cycle in the source object.)

    However, you can't enable this option directly when you use the DCS with WCF in a service operation. Instead, you need to subclass DataContractSerializerOperationBehavior and override the CreateSerializer() method with the code described in Sowmy Srinivasan's seminal Preserving Object Reference in WCF post of March 26, 2006.

    My LINQ to SQL and Entity Framework XML Serialization Issues with WCF - Part 1 post of October 9, 2007 and Serializing Cyclic LINQ to SQL References with WCF of October 30, 2007 cover issues with cycles in LINQ to SQL, which also apply to the Entity Data Model.

    The latter post quotes a response to the System.ServiceModel.CommunicationException - The socket connection was aborted... question in the WCF forum by Microsoft's Ed Pinto:

    Please be aware that there is no interop story for the preservation of object references.

    I observed that "[t]he rumor is that Microsoft deliberately made it difficult to set this attribute value to discourage non-interoperable bidirectional serialization scenarios." It will be interesting to see if Microsoft has come up with an interop story to accompany SP1.

    Added: May 21, 2008

    Danny Simmons Updates Entity Framework FAQs

    His New in version 0.5 of the FAQ… post of May 21, 2008 provides links to:

    Added: May 21, 2008

    Igor Ostrovsky Offers Seven Unusual Uses for LINQ to Objects

    Igor is an infrequent poster but his 7 tricks to simplify your programs with LINQ entry of May 18, 2008 contains the following interesting examples:

    • Initialize an array
    • Iterate over multiple arrays in a single loop
    • Generate a random sequence
    • Generate a string
    • Convert sequences or collections
    • Convert a value to a sequence of length 1
    • Iterate over all subsets of a sequence

    Thanks to Scott Guthrie for the heads-up.

    Added: May 21, 2008

    Matthieu Mezil Offers an Illustrated Introduction to Entity Framework with Advanced Topics

    Matthieu's Entity Data Model Mapping: Beyond the Basics article for DataDeveloper.net starts by creating the requisite Northwind Entity Data Model with the Wizard, but then goes on to cover:

    • Many to many relationships
    • Entity splitting
    • Mapping with added conditions
    • Table Per Type (TPT) inheritance
    • Table Per Hierarchy (TPH) inheritance
    • Complex types
    • Create/update/delete SSDL functions
    • The SELECT SSDL function
    • Performing database operations based on views

    Added: May 21, 2008

    Matt Berseth AJAXifies the DetailsView of a Master/Details Web Form

    Regardless of whether the page's DataGrid and DetailsView controls' data source is an ObjectDataSource, LinqDataSource or EntityDataSource, the AJAX Control Toolkit's ModalPopup with a DetailsView on an UpdatePanel improves the data editing experience.

    Matt's Master-Detail with the GridView, DetailsView and ModalPopup Controls post of April 29, 2008 updates his prior version with a spiffed-up page design and now emulates saving changes to the back-end tables. Source code is available for download, and it's not much work to substitute a LinqDataSource or EntityDataSource for the ObjectDataSource.

    Click here for a live demo.

    If you're interested in AJAXifying DataGrids, read Matt's 7 simple steps to ajax-enable your ASP GridView

    Thanks again to Scott Guthrie for the heads-up.

    Added: May 21, 2008

    Agnes Molnar Continues Her LINQ4SP Demonstrations

    Hungarian SharePoint MVP Agnes Molnar (a.k.a. Aghy) shows her replacement for Bart DeSmet's LINQ to SharePoint implementation creating a lookup to a list in her LINQ4SP - How to create a new item with a lookup to another list? post of May 20, 2008. The post includes a link to a 02:30 silent screencast.

    Ryan Hauert Updates an EF Three-Level Table per Hierarchy Entity with Stored Procs

    Mapping ImportFunctions to stored procedures for updating base (Person) and inherited (Employee and Manager) types isn't a strictly intuitive process, so Ryan's Function Mapping with Inherited Types post of May 20, 2008 demonstrates the simplest approach, which is to create a single set of stored procedures for the base class and call them with wrapper functions in the SSDL file. A hitch in this process is that the wrapper functions are deleted each time you run the Update Database from Model operation.

    Each wrapper changes the discriminator column value to conform to the level in the hierarchy, as discussed in the Re: Stored Procedures with Inheritance post of April 28, 2008 in the ADO.NET Entity Framework and LINQ to Entities (Prerelease) forum and David DeWitter's Entity Framework Stored Procedure Generation post of the same date..

    Julie Lerman Discovers that EF Executes Stored Procs When Invoked, Not When Their Data is Needed

    Her Command Execution of directly called ImportFunctions (stored procs) in Entity Framework post of May 20, 2008 explains the situation, which doesn't seem surprising to me.

    ADO.NET Data Services to Add Replace Mode for Updates

    In his Merge vs. Replace Semantics for Update Operations post of May 20, 2008, Pablo Castro announces that Astoria's current Merge update semantics will be complemented by a Replace option. Replace mode for the HTTP PUT method is required by the AtomPub spec.

    The difference between the two modes is that Replace substitutes default property values for properties that aren't included in the uploaded message body's <Item> element, while Merge ignores missing properties. Missing links in Merge or Replace operations don't affect links on the server.

    ADO.NET Team Offers Two New Entity Framework Web Casts

    How Do I Get Started with the Entity Framework? (09:20)
    In this introductory video, Alex James will show you how to build a simple Entity Data Model in a short amount of time.

    How Do I Use the new EntityDataSource? (11:30)
    In this introductory video Diego Vega will show you how to use the EntityDataSource in an ASP.NET Application.

    SQL Server Compact 3.5 Runtime Bits Missing from VS 2008 SP1 Beta

    SQL Server Compact 3.5 SP1 Beta and Synchronization Services for ADO.NET v1.0 SP1 Beta runtime bits didn't make it into the VS 2008 SP1 Beta package but you can download and install them from the preceding link.

    Julie Lerman Takes on the Entity Framework Doubters

    Julie posted this link to Bloglines citations of Danny's post in her Responses to Danny Simmons "Why Entity Framework" post of May 20, 2008.

    Ironically, her post wasn't included in the Bloglines citation. (Several other cites in my Danny Simmons Answers the Frequently Asked Question: Why Use the Entity Framework? post were missing from Bloglines, too.)

    Rob Conery Runs into a LINQ to SQL Corner with his Repository Model

    He discovers "that if you set any Enumerable anything as a property, its Count property will be accessed when you load the parent object. This negates using any deferred loading for any POCOs, period." Yeah. That's run me nuts, too.

    Update May 22, 2008: Scott Allen left a comment about Rob's preceding statement: "I'd say that requires more investigation. Doesn't sound correct." As it turns out, Scott did do some investigation and concluded that an IList<T> type change caused the overeager loading. See Rob's Not So Lazy MVC Storefront of 5/21/2008. 

    Rob circumvents the problem by refactoring the MVC Storefront's Repository model, as described in his MVC Storefront: Intermission's Over, Made Some Changes post of May 19, 2008.

    Update May 21, 2008: Rob clarifies the identity of his clients (the Microsoft ASP.NET team, the "community" and himself) in MVC Storefront: Client Progress Meeting of May 20, 2008, which details how the MVC Storefront project came to be at MIX 08 and his recent progress meeting with his boss, Shawn Burke.

    Hopefully, it's time to go back to completing the code.

    The SQL Server Data Service Team Breaks Their Silence

    It's been a while since the last post from the SSDS folks. Soumitra Sengupta's What is going on at SQL Server Data Services of May 19, 2008 notes that SSDS is in the process of its second semi-monthly refresh after its introduction at MIX 08. Word on what new features, if any, the updates introduced will come some time after the refresh on May 20, 2008.

    SSDS will be back in business by 9:00 AM on 5/21/2008.

    SSDS documentation finally has been made public as the SQL Server Data Service Primer. The docs have some strange content, such as VS 2005 and .Net 3.0 being "recommended for Microsoft employees" to connect to SSDS. I recommend others use VS 2008 and .NET 3.5.

    Update 5/21/2008: The SSDS team is Correcting an error in our documentation.

    At MIX 07 the public beta was announced for July 2008. However, it's been pushed back two months to September 2008, according to Nigel Ellis's Introduction to New SQL Server Data Services: Web-Based Data Storage in a Cloud Web cast. I scheduled my Visual Studio Magazine article for the July issue to meet the original date; hopefully readers will be able to obtain a beta invitation if they aren't already "on-boarded" by July.

    Mike Taulty Finds the Replacement for ADO.NET Data Services' DataWebKeyAttribute

    Mike's ADO.NET Data Services and the Missing DataWebKeyAttribute post of May 19, 2008 explains that SP1 renamed it DataServicesKeyAttribute. This is consistent with the replacement of Web by Services in most class, method and property names.

    If the Entity Framework back-end can't detect the table's primary key column you mus prefix the the class declaration with [DataServicesKey("ColumnName")] as mentioned in the ADO.Net Data Services Over LINQ to SQL? forum post.

    Wally McClure Finds He Needs the Visual J# Redistributable to Get Meaningful Error Messages from ADO.NET Data Services

    Strange, but apparently true, as Wally reports in ADO.NET Data Services in.NET 3.5 SP1 Beta1 of May 19, 2008. He promises a podcast about his Astoria experiences shortly.

    Jon Skeet Gives Parallel LINQ a Workout with Nine Parallel LINQ (PLINQ) Mandelbrot Set Implementations

    The Mandelbrot set is an ideal test bed for determining the efficiency of parallel processing algorithms and libraries. So Jon Skeet, C# MVP in the UK, decided to compare the performance of Parallel LINQ (PLINQ) with the Parallel Extensions (ParallelFx) with a variety of different approaches. The benchmarks are downloadable from his Mandelbrot revisited - benchmark edition post of May 18, 2008, which includes code samples and commentary.

    Jon finds ParallelFx's ParallelForLoop implementation to have the best overall performance, but the PLINQ Unordered ParallelLinqInPlace approach wasn't far behind it.