Tuesday, December 18, 2007

LINQ and Entity Framework Posts for 12/17/2007+

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

Mike Taulty Tackles Substituting LINQ to SQL for The Entity Framework and Data Updates

Continuing where he left off in his ADO.NET Data Services - Getting Started (2) post of December 19, 2007 (see below), ADO.NET Data Services - Using LINQ to SQL rather than LINQ to Entities later that day follows Guy Burstein's ADO.Net Data Services Part 1 - Building a Simple Web Data Service tutorial to substitute LINQ to SQL for the Entity Framework and LINQ to Entities as the data source.

For updates, the data source must also support IUpdatable as well as IQueryable. Tech lead Pablo Castro says in the "What's Missing" section of his Astoria data sources and system layering post of September 27, 2007:

Update: [W]hile this model enables us to support querying over arbitrary .NET classes that expose containers of instances as IQueryable objects, it does not say how to update stuff. Discussing the update model will take a whole post (or several, most likely), but the short story is that we’ll define an interface, something like IUpdatable or whatever names works, that has the basic operations we need to perform in order to handle updates. The interface would have primitive operations for adding a new resource, remove an existing resource, applying modifications to resources and also handle linking/unlinking of resources.

Mike went on to extend his DataContext's partial class with insert and delete operations, but finds there's no way to provide "original values" as noted in the following of one hour earlier.

Added: 12/19/2007

Mike Tautly Tracks HTTP Traffic Between .NET Data Services and Clients

Mike uses Northwind as an example with the Entity Framework as the data source in ADO.NET Data Services - Experimenting with .NET Client Access Whilst Sniffing the HTTP Traffic of December 19, 2007 while he experiments with the LINQ to REST syntax for inserts, updates, and deletes. He can't find the magic commands to implement cascading deletions for a Customer and all its associated Orders objects.

Added: 12/19/2007

Book Review: LINQ Quickly (Packt Publishing)

Michael Schwartz reviews LINQ Quickly by N. Satheesh Kumar, a 250-page "linq quick-starter" book (as the URL states), in his LINQ Quickly (Book Review) post of December 19, 2007. The US$34.99 list price seems a bit high for this thin a title.

The author and/or advertising copy writer seems to have their .NET version a release behind in these blurb sections:

This book gets you started with LINQ and shows how it will make your programming life easier by making use of new features from the .NET Framework 3.0. This book is split into seven chapters, each of which is dedicated to presenting a feature of LINQ and its usage in real-life scenarios. ...

Overview of new features for LINQ in .NET 3.0—partial methods, expressions, anonymous types, initializers, and implicitly typed local variables. [Emphasis added.]

The following implies that LINQ's "filtering, ordering, and grouping capabilities" are weak:

Directly querying the collections and filtering the required values without using powerful filtering, ordering, and grouping capabilities. [Emphasis added.]

Not very promising.

Added: 12/19/2007

Daniel Cazzulino and Juan Wajnerman Create LINQ to Mock (Objects)

Dan's Linq to Mock: Moq is born and Juan's Mocking with LINQ: Moq is here! posts of December 19, 2007 describe the initial release of LINQ to Mock (Moq). According to the Moq (pronounced Mock-Q) home page on Google Code:

Moq (pronounced "Mock-you") is the only mocking library for .NET developed from scratch to take full advantage of .NET 3.5 (i.e. Linq expression trees) and C# 3.0 features (i.e. lambda expressions) that make it the most productive, simple and refactoring-friendly mocking library available.

The Moq wiki's QuickStart includes several syntax examples. Looks like an interesting mocking method for .NET C# 3.5 projects in general, not just projects that use LINQ.

Added: 12/19/2007

Mike Taulty Continues His ADO.NET Data Services Tutorial

In his ADO.NET Data Services - Getting Started (2) post of December 19, 2007, Mike explores the classes of Microsoft.Web.Data.dll, including WebDataService<T>, IWebDataService, and IWebDataServiceProvider.

Mike observes:

It's been said that you can use "any old IQueryable" in the latest preview of "Data Services" rather than having to use Entity Framework and (from experimenting with LINQ to SQL) that looks to be true but IQueryable doesn't deal with the business of inserts/updates/deletes and so if you want your "Data Services" data to do more than just Query then your T needs to implement IUpdateable which LINQ to SQL doesn't (more on that in a later post).

Another interesting point is that Astoria uses the Entity Framework's Storage Schema Description Languages (SSDL) file to supply the metadata for the Astoria client API, as Christian Weyer observed in his ADO.NET Data Services ("Astoria") Service Metadata post of December 12, 2007. The .ssdl file is used regardless of the services data source type.

Mike's initial ADO.NET Data Services - Getting Started post of the same date consists of a pointer to the Creating ADO.NET Data Services docs.

Added: 12/19/2007

Eric White Explores LINQ to XML for Processing SpreadsheetML

Eric continues his "LINQ to OOXML" series with Using LINQ to XML to process Open XML: The SpreadsheetML Class of December 19, 2007. Following is a partial description of the three members of the LtxOpenXml namespace:

  • The SpreadsheetML class [which derives from the OpenXmlDocument class] contains three nested classes, Sheet, Row, and Cell, which represent some convenient abstractions for a SpreadsheetML document. These nested classes are written in the spirit of dynamic types, with the most terse syntax possible. We don't care that all properties are read/write; all of this code is written in a functional style, where no variables are mutated.
  • The SpreadsheetML class contains the Sheets method, which iterates through the sheets in the workbook.
  • Each Sheet contains a Rows method, which iterates through the rows in the sheet.
  • Each Row contains a Cells method, which iterates through the cells in the row.

His post includes a link to Example that uses the OpenXmlDocument, WordprocessingML, and SpreadsheetML Classes (December 19, 2007) for the Sheet, Row, and Cell members.

Added: 12/19/2007

Julie Lerman Shows You How to Process "Miscellaneous" Stored Procedures with the EDM Designer

Her Implement SELECT Stored Procedures that return miscellaneous data in CTP2 of EF Designer post of December 18, 2007 provides step-by-step, illustrated instructions for processing a stored procedure that returns a rowset that isn't included in the project's schemas. The process requires manually editing the .ssdl, .msl, and .csdl files.

Added: 12/19/2007

Doug Rothaus Calculates Standard Deviation with LINQ and VB 9.0

The VB Team's LINQ Cookbook, Recipe 12: Calculate the Standard Deviation (Doug Rothaus) of December 18, 2007 shows you how to write extension methods to calculate StDev (standard deviation) and StDevP (standard deviation for the entire population). You can use the extension methods in the Into clause of an Aggregate, Group By or Group Join expression.

Added: 12/19/2007

Jonathan Carter Starts 11-Part ADO.NET Data Services Series

Jon has reached the Sixth Episode in his ADO.NET Data Services Training Series that began on December 12, 2007. Jon's a Microsoft evangelist for the .NET Framework and Visual Studio. In an earlier avatar, he was a writer for numerous magazines, so his episodes are more like stories than tutorials. The protagonist is ...

Phillip, who runs a cell phone resale company, and is looking to ramp up his business. Phillip has an extensive database of cell phones, carriers, and manufacturers. Lots of time and effort has been put into the population and maintenance of his precious data. One day he realizes that all that time he put into his database should be making him more money, so he decides to provide access to his data store to other companies looking to build a web presence but don’t have the resources Phillip has.

Here are the "chapters," with links to those complete as of the latest update:

  • ADO.NET Data Services Part 1: Services (December 12, 2007)
  • ADO.NET Data Services Part 1: Services (contd.) (December 12, 2007)
  • ADO.NET Data Services Part 2: Service Addressing (December 13, 2007)
  • ADO.NET Data Services Part 3: Query Parameters (December 14, 2007)
  • ADO.NET Data Services Part 4: Clients (December 15, 2007)
  • ADO.NET Data Services Part 5: LINQ (December 17, 2007)
  • ADO.NET Data Services Part 6: AJAX (December 19, 2007)
  • ADO.NET Data Services Part 7: Data Modification- Client (December 30, 2007)
  • ADO.NET Data Services Part 8: Service Operations
  • ADO.NET Data Services Part 9: Interceptors
  • ADO.NET Data Services Part 10: Open Objects
  • ADO.NET Data Services Part 11: Service Hosting

    Thanks to Andy Conrad for the heads-up.

    Added: 12/19/2007 Updated: 1/1/2008

    Bill Horst Translates SQL GROUP BY and HAVING Clauses to LINQ Expressions

    Bill's Converting SQL to LINQ, Part 5: GROUP BY and HAVING (Bill Horst) of December 18, 2007 continues the series that shows you how SQL statements translate to the VB 9.0 version of LINQ expressions.

    Added: 12/19/2007

    David Sceppa: Updated ADO.NET Entity Framework Sample for Beta 3

    David's Sample ADO.NET Entity Framework Provider - Beta 3 describes the new sample provider code that's been updated for Entity Framework (EF) Beta 3. The new release, which you can download here, has changes to the provider manifest, includes the manifest specification, and adds VS 2008's Data Designer Extensibility (DDEX) features to enable third-party providers to integrate with the EDM Designer.

    Still No Word about the Status of Oracle's ADO.NET Entity Framework Provider

    Another David Sceppa December 18, 2007 post, The Entity Framework - Not Just For SQL Server!, indicates that the Entity Framework (EF) isn't for Oracle. The list of providers is the same as that of the earlier EF Beta 3 press release discussed in my Entity Framework Beta 3 Available for Download post of December 6, 2007; Oracle is still among the missing.

    Update to ADO.NET Data Services Online for CTP1 in Limbo, POX Scheduled for V1

    According to a reply by Mike Lasko to my Astoria Forum question regarding when the Online Services at http://astoria.mslivelabs.com/OnlineService.aspx would be updated to CTP1 and if Plain Old XML support was in the works for ADO.NET Data Services:

    We don't have a timeline yet to update the online service to CTP1.  Once we do, we'll post to blogs.msdn.com/astoriateam

    Regarding POX ... We are strongly looking at adding this serialization into the production version.  We'll likely get this in for V1.

    Good news on the POX front, but Online Services for developers are useless until updated to CTP1.

    Guy Burstein: Using Stored Procedures with Entity Framework Beta 3

    Guy's ADO.Net Entity Framework Tools: Stored Procedures post of December 17, 2007 shows you how to map stored procedures to Entity Data Model Insert, Update, and Delete operations as well as to a Function Import operation to populate entities. The tutorial includes screen captures of all critical steps.

    Guy Burstein: Service Operations with WebGet for ADO.NET Data Services

    Guy continues his ADO.NET Data Services (Astoria) series with the ADO.Net Data Services Part 2 - Using Service Operations with WebGet post of December 16, 2007 which uses a Table Valued Function with LINQ to SQL as a Service Operation. Guy shows you the URL required to call a service operation by its name followed by parameters, as in http://localhost:2445/BlogData.svc/PostsByCategory?categoryID=2, where PostsByCategory is the service name.

    Guy Burstein Test Drives Zlatko Michailov's eSqlBlast Tool

    His ADO.Net Entity Framework: eSqlBlast Tool for E-SQL Queries post of December 13, 2007 provides an illustrated introduction to using Zlatko Michailov's eSqlBlast Tool, which lets you run queries against entities defined by a selected .ssdl, .msl, and .csdl schema file set in a Windows UI.

    Julie Lerman also is an eSqlBlast fan. She considers eSqlBlast the Entity Data Model's Query Builder.

  • Friday, December 14, 2007

    Amazon Announces Beta of SimpleDB Web Services in the Cloud

    Amazon announced in their Amazon SimpleDB™- Limited Beta post of December 14, 2007 that Amazon Web Services, LLC will start selling pay-per-GB space on and traffic to a non-relational, attribute-based database service that's integrated with Amazon Simple Storage Service (Amazon S3) and Amazon Elastic Compute Cloud (Amazon EC2). The database service supports REST and SOAP request/response operations.

    Updated 12/15/2007, 12/16/2007, 12/18/2007, and 12/21/2007

    A SimpleDB domain is a schemaless container (table or catalog) for items which contain values and has a maximum size of 10 GB. Items can be added to or removed from the domain without affecting other items.

    Items are hash tables of attribute-value pairs that correspond to columns. Item name and attribute values can range from 1 to 1,024 characters in length. A domain can contain a maximum of 256 items.

    Attribute values (cells) are strings that the service indexes automatically as you add them; UTF-8 string is the sole data type. This means you must left-pad integers with zeros, offset negative integers, and use ISO 8601 (yyyy-mm-dd) or similar formats for dates to maintain lexicographical order. A domain is limited to 250 million cells.

    Attributes can have multiple values, which gives SimpleDB a directory-like (e.g. LDAP) flavor but no hierarchy. However, it might be suitable as a central host for an identity system like OpenID. (This assumes partitioning could overcome the 250-million cell limit.)

    Here's a sample nine-item domain from the Getting Started Guide's "Putting Data into a Domain" topic:

    ID Category Subcat. Name Color Size Make Model Year
    Item_01 Clothes Sweater Cathair Sweater Siamese Small, Medium, Large      
    Item_02 Clothes Pants Designer Jeans Paisley, Acid Wash 30x32, 32x32, 32x34      
    Item_03 Clothes Pants Sweat-pants Blue, Yellow, Pink Large     2006, 2007
    Item_04 Car Parts Engine Turbos     Audi S4 2000, 2001, 2002
    Item_05 Car Parts Emissions 02 Sensor     Audi S4 2000, 2001, 2002

    Charles Ying's What You Need To Know About Amazon SimpleDB post of December 13, 2007 provides an alpha user's insights about SimpleDB. Ying reports that SimpleDB is written in Erlang, which is a general-purpose concurrent programming language and runtime system that is designed for highly-parallel data processing. The Product: Amazon's SimpleDB and The Current Pros and Cons List for SimpleDB on the High-Scalability site provides links to and a summary of others' opinions of SimpleDB and its architecture.

    Amazon S3 is designed for storing relatively large objects; SimpleDB is designed for fast, indexed access to small objects. SimpleDB can interact with S3 to create, for example, a SimpleDB index to large objects stored in S3.

    SimpleDB's REST API uses GET HTTP requests to return Plain Old XML (POX) responses. Following is a sample GET query request from the Developer Guide's "Query" topic:

    https://sdb.amazonaws.com/
    ?Action=Query
    &AWSAccessKeyId=[valid access key id]
    &DomainName=MyDomain
    &MaxNumberOfItems=3
    &NextToken=[valid next token]
    &QueryExpression=%5B%27Color%27%3D%27Blue%27%5D
    &SignatureVersion=1
    &Timestamp=2007-06-25T15%3A03%3A09-07%3A00
    &Version=2007-11-07
    &Signature=2wVXB1x0NSWWETwLylZPVP%2FtqXQ%3D

    and the POX response:

    <QueryResponse xmlns="http://sdb.amazonaws.com/doc/2007-11-07">
      <QueryResult>
        <ItemName>eID001</ItemName>
        <ItemName>eID002</ItemName>
        <ItemName>eID003</ItemName>
      </QueryResult>
      <ResponseMetadata>
        <RequestId>c74ef8c8-77ff-4d5e-b60b-097c77c1c266</RequestId>
        <BoxUsage>0.0000219907</BoxUsage>
      </ResponseMetadata>
    </QueryResponse>

    (I still believe the Astoria team should support POX responses from URI GET queries.)

    Query operators include =, !=, <, > <=, >=, STARTS-WITH,  AND, OR, NOT, INTERSECTION AND UNION. Queries return groups of results; the size of the group is determined by the MaxNumberOfItems query parameter, which has a maximum of 250 and defaults to 100. The NextToken value determines the starting point of the group.

    Update 12/21/2007: Dare Obasanjo weighs in with his Amazon SimpleDB: The Good, the Bad and the Ugly post of December 21, 2007. He likes "Comoditizing hosted services and getting people to think outside the relational database box," dislikes "Eventual Consistency and Data Values are Weakly Typed," and detests "Web Interfaces, that Claim to be RESTful but Aren’t." I agree with Dare on all topics except eventual consistency. GET requests for data updates are atrocious.

    Replication between nodes means that newly uploaded or modified data won't be visible immediately to all datacenter connections that have domain copies. Developers must abandon Atomicity, Consistency, Isolation, Durability (ACID) transaction concepts and accept Basically Available Soft-state Eventually-consistent (BASE) behavior. (I believe eBay Technical Fellow, Dan Pritchett originated the BASE acronym in his "The Challenges of Latency" InfoQ article of May 2, 2007; Michael Nygard discusses BASE in his November 9, 2007 Architecting for Latency post.)

    Amazon's Getting Started Guide includes C# and VB sample code for the REST API.

    Question: ADO.NET Data Services (Project Astoria) clients have LINQ to REST in CTP1. How long will it be until some enterprising LINQ addict creates LINQ for SimpleDB?

    Backstory: There are similarities between Amazon's approach to the attribute-based database structure and Google Base but Google (not the developer) specifies the attribute names and their data formats. The GDataAPI for Google Base uses an extended Atom Pub protocol. SimpleDB's freeform database design and simple REST URI and SOAP APIs are nice touches for developers, but Atom Pub might have been a better choice for both REST queries and data entry/update.

    Following are a couple of quotes about large-scale databases in the cloud from my Very Large Databases: Bricks, BitVault and BigTable post of April 6, 2006:

    Dare Obasanjo's "Greg Linden on SQL Databases and Internet-Scale Applications" post quotes Greg Linden:

    "What I want is a robust, high performance virtual relational database that runs transparently over a cluster, nodes dropping in an out of service at will, read-write replication and data migration all done automatically. I want to be able to install a database on a server cloud and use it like it was all running on one machine."

    Greg Linden wants a relational database, which SimpleDB isn't, but otherwise it fits most of his requirements. It's interesting to note that Greg "was at Amazon.com from 1997 to 2002 where [he] wrote the recommendation engine used by Amazon.com and later led the software team that developed Amazon's personalization systems."

    Adam Bosworth, who managed the initial development of Microsoft Access, went on to found CrossGain (together with Tod Neilsen, Access marketing honcho), sold CrossGain to BEA and became BEA's chief architect and senior vice president, and now is VP Engineering at Google, lists these three features that database users want but database vendors don't suppply: Dynamic schema, dynamic partitioning of data across large dynamic numbers of machines, and modern [Googlesque] indexing. Adam wants the the Open Source community to "[g]ive us systems that scale linearly, are flexible and dynamically reconfigurable and load balanced and easy to use." Adam does mean give, not sell.

    It's my opinion that SimpleDB would meet almost all of Adam's requirements (except free).

    GigaOm and TechCrunch have columns today on SimpleDB. Neither analysis seems to me to be on the mark.

    Note: There are numerous online databases and forms applications, a few of which are free. For example, blist is a recent startup with plans to provide a scalable database in the cloud that anyone can set up and use. blist appears to share SimpleDB's attribute value flexibility. It's not yet in open beta so I haven't been able to evaluate it or learn anything about blist's business plan. Apparently blist will compete with DabbleDB and other online (Web-based) database services. My Dabble DB: The New Look in Web Databases post of March 19, 2006 analyzed the initial DabbleDB release in the light of its then competitors and Ray Ozzie's widely circulated "Internet Services Disruption" memo of October 28, 2005.

    Dave Winer says in his Amazon removes the database scaling wall post of December 15, 2007:

    It's amazing that Microsoft and Google are sitting by and letting Amazon take all this ground in developer-land without even a hint of a response. It seems likely they have something in the works. Let's hope there's some compatibility.

    Suggestion: It would be very interesting if Microsoft decided to provide developers multiple free .NET Data Services (nee Astoria Project) with SQL Server back ends limited to a total of 1 GB or so, similar to the amount of free space offered by Windows Live's SkyDrive. (The current limit for a "Create Your Own Online Data Service" at astoria.mslivelabs.com is one 100MB database, which is not generous—even for a free service.) Start charging for storage over 1 GB and traffic in 100-MB or 1-GB per month increments. Alternatively, clone Amazon's pricing model.

    On the whole, I believe most developers will be more interested in a reliable, scalable relational store "in the cloud" than SimpleDB's attribute-based model. The 1,024-char maximum length of an attribute value seems to me to be a serious limitation. However, it might be overcome by a link to an S3 object, assuming no serious performance hit.

    Update 2/14/2008: See Dare Obasanjo's Amazon SimpleDB: The Good, the Bad and the Ugly post of December 21, 2007 for another analysis of SimpleDB's feature set.

    Justin Etheredge released LINQ to SimpleDB Alpha 1 (source code and runtime binary) to CodePlex on January 23, 2008 under the Microsoft Public License (Ms-PL). His LinqToSimpleDB Preview post of January 19, 2008 offers operating instructions. See also my LINQ and Entity Framework Posts for 2/11/2008+ post's "Justin Etheredge Offers Preview of LINQ to [Amazon] SimpleDB" topic.

    Tuesday, December 11, 2007

    Link and Entity Framework Posts for 12/10/2007+

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

    Julie Lerman Explains How to Embed Schema Files in the EF's Assembly

    The Entity Framework's EDM Designer connects to a single .edmx file in design mode. By default, building an EF project copies parts of the .edmx file to individual .ssdl, .msl, and .csdl files in the project's ...\bin\debug or ...\bin\release folder.

    As Julie explains in her Embedding EDM schema files in Entity Framework Beta 3 post of December 14, 2007, you can set the .edmx file's MetadataArtifactProcessing property to Embed in Output Assembly to create a self-contained .exe or .dll that includes the three schema files as resources. She points out a bug in Beta 3 that requires you to build the project with Copy to Output selected before you change the preceding property value.

    Added: 12/15/2007

    Matt Manley Explores Late Binding of Visual Basic Lambda Functions

    VB 9.0 lambda functions are more flexible than C# 3.0's because the Microsoft.VisualBasic.CompilerServices.Operators class detects mathematical operators and tests to see if they apply to the functions argument(s). If not, the compiler uses reflection with the Microsoft.VisualBasic.CompilerServices.NewLateBinding class, as it does for arguments of object types. There's more detail about this topic in Matt's Visual Basic .NET Late Binding Explored post of December 15, 2007.

    Added: 12/15/2007

    David Ebbo Posts Dynamic Data FAQs

    Apparently, Scott Guthrie's Dynamic Data tutorial post (see below) generated a lot of interest in Dynamic Data (formerly code-named "Oryx"), so David published some FAQs that shine more light on the features future direction in his Answers to frequently asked ASP.NET Dynamic Data questions post of December 14, 2007.

    Added: 12/14/2007

    Zlatko Michailov Attacks the SQL Server Len() Function's Ambiguities

    In his SQL Server’s LEN() Function of December 14, 2007, Zlatko notes that SQL Server's LEN() function doesn't count trailing spaces.

    Added: 12/14/2007

    Zlatko Michailov's Sales Pitch for the Entity Framework

    Zlatko's December 14, 2007 Entity Framework and Object/Relational Mapping post makes a fervent plea to developers not to think of EF as an O/RM tool but a development platform. Here's his core argument:

    Entity Framework takes a completely different approach – it creates a development platform in the space between database and objects. That is the Conceptual space. It’s a virtual space, unconstrained from objects- and database legacy. That allows Entity Framework to support static modeling capabilities with type hierarchies and containment as well as explicit, navigatable, relationships. What’s similar to O/R Mappers, is the mapping. However, it’s not a single, object-to-store mapping bridge, but two separate bridges – object-to-conceptual and conceptual-to-store. (The object-to-conceptual mapping is implicit for version 1.)

    I wonder what the "NHibernate Mafia" have to say about this claim and EF's persistence ignorance.

    Added: 12/14/2007

    Amazon Announces Beta of SimpleDB Web Services in the Cloud

    Amazon announced in their Amazon SimpleDB™- Limited Beta post of December 14, 2007 that Amazon Web Services, LLC would start selling in a few weeks pay-per-GB space on and connections to a non-relational, attribute-based database service that's integrated with Amazon Simple Storage Service (Amazon S3) and Amazon Elastic Compute Cloud (Amazon EC2). The service supports REST and SOAP request/response operations.

    Read more at Amazon Announces Beta of SimpleDB Web Services in the Cloud.

    Added: 12/14/2007

    Beth Massi Interviews Aver Aharoni about LINQ to XML Literals and Namespaces

    In this 23:47 Channel9 interview, XML Literals Performance and Namespaces Explained, Beth Massi watches VB Team program manager Aver Aharoni ...

    ... as he dives into LINQ to XML and XML Literals in Visual Basic 9 and explains namespace bubbling and the performance gains you may see using XML Literals. This is a good interview to pay attention to if you are struggling with how XML namespaces work in Visual Basic.

    This topic was added before Beth updated her blog.

    Added: 12/14/2007

    Rafik Robeal Describes SyncServices for ADO.NET 2.0's DbPeerSyncProvider

    In his What’s new in Sync Services for ADO.NET 2.0? post of December 13, 2007, Rafik provides an overview of the new DbPeerSyncProvider, which is part of the Microsoft Sync Framework CTP1 Refresh. Rafik says its architecture uses the same programming model as the DbServerSyncProvider.

    Added: 12/14/2007

    Pro LINQ: Language Integrated Query in C# 2008 From Apress

    Joseph C. Rattz, Jr.'s book about LINQ is now available from APress in paper and eBook formats. Links to the ToC and Chapter 1 are here.

    Added: 12/14/2007

    Scott Guthrie's Dynamic Data Tutorial Parallels David Ebbo's Video

    Scott's New ASP.NET Dynamic Data Support post of December 14, 2007 is a detailed tutorial for creating your first scaffolded ASP.NET 3.5 project from a LINQ to SQL data source. The tutorial follows the steps outlined in David Ebbo's video segment at Dynamic Data screencast is now available! (see below for description).

    Added: 12/14/2007

    Noam Ben-Ami Demonstrates the EDM Designer's New Stored Procedure Support

    This 12-minute video clip, which Sanjay Nagamangalam describes in his December 13, 2007 Entity Data Model Designer Video - CTP 2 post covers the Entity Framework's EDM Designer CTP 2 and its new support for mapping UPDATEs, INSERTs, and DELETEs of entity types to stored procedures. CTP 2 also lets you map SELECT stored procs to return primitive types and entity type collections. The final segment covers the new "Update Model from Database" feature that synchronizes the EDM to database changes.

    Added: 12/14/2007

    Christian Weyer Shows You How to Self-Host ADO.NET Data Services

    The QuickStart examples use ASP.NET/IIS to host ADO.NET Data Services (Astoria), but most developers prefer to use WCF's new self-hosting feature provided by the WebServiceHost with the WebHttpBinding class that supports Plain Old XML (POX) instead of SOAP messaging.

    Christian's Self-Hosting Your ADO.NET Data Services ("Astoria") Services post of December 11, 2007 shows you how to specify the [ServiceContract] and [OperationsContract] attributes for the IRequestHandler interface, add the required section to the app.config file for a console project, and invoke the WebServiceHost(typeof(WebDataService).Open() method.

    You can expect some concrete examples from Mike Taulty shortly.

    Added: 12/14/2007

    Reading and Writing SQL Server 2008 FileStreams Videos by Mike Taulty

    Mike posted Video: SQL 2008 and FileStream (writing data) and Video: SQL 2008 and FileStream (reading data) on December 13, 2007. As usual, the videos are brief, to the point, and capture the essence of what in this case is relatively complex subject matter. Working with FileStreams requires function calls to unmanaged code.

    Added: 12/14/2007

    Latest VB Cookbook Applies Group Joins and Aggregates to DataSets

    LINQ Cookbook, Recipe 11: Desktop Search Statistics (Doug Rothaus) of December 13, 2007 uses Windows Desktop Search's OLE DB data provider (Search.CollatorDSO.1) to fill a DataSet which LINQ to DataSets queries to deliver a generic List of items and count of each item type for Documents, E-Mail or Images.

    Added: 12/14/2007

    Marcin Dobosz Explains Dynamic Data's Custom Metadata Providers

    According to Marcin's Adding custom metadata providers in ASP.NET 3.5 Extensions Preview post of December 10, 2007, the three special metadata attributes described in the How to: Add Validation to the Data Model using Attributes online help page are for Dynamic Data's initial implementation only.

    The MVC Toolkit provides an early MVC implementation for future Dynamic Data versions that will deliver:

    • A pluggable metadata model based on providers.
    • New metadata attributes that can be declared on the properties of a special metadata "buddy" class.
    • An alternative reference provider implementation based on XML files.

    His post included brief descriptions of these features. He also notes that the initial Dynamic Release supports only LINQ to SQL as its data source; future releases also will accommodate LINQ to Entities.

    Marcin is the program manager for the ASP.NET 3.5 Extensions' Dynamic Data feature and Astoria.

    Note: The ASP.NET Dynamic Data forum is at http://forums.asp.net/1145.aspx.

    Added: 12/13/2007

    Danny Simmons: Use KnownTypes to Deserialize Polymorphic Entities

    Serializing entities (even without the ObjectContext) is a can of worms, as demonstrated by my Serializing Object Graphs Without and With References post of 11/21,2007. Danny points out in his DataContract Serialization, Entity Framework and "Known Types" post of December 12, 2007 that you must add a list of subtype names of derived types to the [ServiceKnownType("GetKnownType", GetType(ObjectContextTypeName))].

    Danny's modification to the GetKnownType helper function replaces manually typed strings with a list of ServiceKnownTypes from the ObjectItemCollection by reflection. Nice!

    Added: 12/13/2007

    David Ebbo Delivers a Dynamic Data Demo as a 00:17 Screen Cast

    David's December 12, 2007 Dynamic Data screencast is now available! post has a link to the segment, which demonstrates most of the features of the new Dynamic Data scaffolding from the ASP.NET 3.5 Extensions:

  • Creating a Dynamic Data project
  • Creating a LINQ to SQL model
  • Running the scaffolded version of a Dynamic Data project
  • Customizing data validation
  • Customizing UI presentation
  • Adding metadata to the model
  • Writing custom pages in place of the scaffolded ones

    David is a developer for the ASP.NET 3.5 Extensions' Dynamic Data feature.

    (Topic list courtesy of Marcin Dobosz, see above)

    Added: 12/13/2007

    Zlatko Michailov's eSQLBlast Program Posted on CodePlex

    Source code for Zlatko Michailov's eSQLBlast program is available for download from the ADO.NET Samples Page on CodePlex. Zlatko says the following in his eSqlBlast – The Ultimate Tool for Writing Entity SQL Queries post of December 12, 2007:

    Microsoft.Samples.Data.eSqlBlast, briefly eSqlBlast, is a suite of tools and libraries that complements Entity Framework. It aids authoring, executing, and visualizing ad-hoc Entity SQL queries against arbitrary EDM models. The tools of the eSqlBlast suite may be used interactively, from the command line, or embedded in other programs. The eSqlBlast suite also contains XSL transformation scripts for rendering CSDL and its own raw XML format.

    Added: 12/13/2007

    Eric White Continues his LINQ to OOXML Series with the WordProcessingML Class

    Eric's The WordprocessingML Class: A refinement of the approach of using LINQ to XML to access Open XML post of December 13, 2007 briefly describes the additional functionality the class brings to Office Open XML, includes a sample LINQ query and provides a link to a listing of the full WordprocessingML class.

    Added: 12/13/2007

    Julie Lerman Explains How to Use the ObjectStateManager.GetObjectStateEntries Method

    Julie's December 13, 2007 EF ObjectStateManager.GetObjectStateEntries (plural) post explains how she uses the method in conjunction with entity updates, with source code for adding a new and modifying an existing entity.

    Added: 12/13/2007

    Bill Horst Translates T-SQL Scalar and Aggregate Functions to LINQ

    In his Converting SQL to LINQ, Part 4: Functions (Bill Horst) post of December 12, 2007, Bill continues his series with brief descriptions of how VB 9.0 LINQ scalar and aggregate function syntax differs from that of T-SQL. LINQ aggregate functions commonly use group join or Group Join operators but Bill's VB LINQ example for Sum() uses a simple Aggregate ... Into expression.

    Added: 12/12/2007

    Guy Burstein Starts ASP.NET Web Data Services Series

    Guy's ADO.Net Data Services Part 1 - Building a Simple Web Data Service post of December 12, 2007 starts a series devoted to creating and consuming sample Astoria data from a blog database that you create from a script in an earlier post.

    Like Andy Conrad, Guy uses LINQ to SQL instead of the Entity Framework as the data source. I have the feeling this substitution will become universal, at least until RDBMS vendors other than Microsoft deliver EntityClient data providers.

    Julie Lerman comments on the SQL-Server-only issue in her ADO.NET DataServices and ANY IQueryable post of December 12, 2007.

    Added: 12/12/2007; Updated 12/14/2007

    Pete Weissbrod Compares LINQ to SQL to NHibernate

    Pete's company wanted to know if LINQ to SQL would be a better object/relational mapping (O/RM) tool than NHibernate, which most developers consider the "industry standard." So Pete is sharing his findings in a series of posts, the first of which is LINQ to SQL vs NHibernate Part 1: What do they have in common? of December 9, 2007. This post provides a broad-brush overview of:

    • Mapping syntax
    • Persistent object lifecycles
    • Version management
    • Adjustable fetching schemes
    • Concurrency concerns
    • Customer database objects
    • Code generators

    Pete promises to compare performance, flexibility, and usability "in the next few days."

    Added: 12/12/2007

    ASP.NET Data Services Wow Dare Obasanjo

    Dare says in his December 11, 2007 ADO.NET Data Services (Astoria) Transforms SQL Server into an Atom Store post:

    Normally, announcements related to ASP.NET would not interest me except this time [there] is an interesting item in the list of technologies being released. ...

    Wow. It looks like Astoria has quickly moved from being an experimental project to see what it would [be] like to place RESTful interfaces on top of SQL Server database to being very close to shipping a production version. ... [Emphasis added.]

    This is s[l]ick. With Astoria I can expose my relational database or even a local just an XML file using a RESTful interface that utilizes the Atom Publishing Protocol or JSON. I am somewhat amused that one of the options is placing a RESTful interface over a SOAP Web Service. My, how times have changed…

    It is pretty cool that Microsoft is the first major database vendor to bring the dream of the Atom store to fruition. I also like that one of the side effects of this is that there is now an AtomPub client library for .NET Framework.

    Dare also likes Andy Conrad's LINQ to REST implementation (see below.)

    Eric White Explains How to Use LINQ to XML with Office Open XML

    In his swansong to his current job of documenting XML technologies (mostly LINQ to XML), Eric's Using LINQ to XML with OpenXML Documents post of December 11, 2007 has provides links to the four contemporaneous posts:

    Each post contains non-trivial sample code and most have relatively simple LINQ queries.

    Eric's new job is technical evangelist for Office Open XML (OOXML).

    ASP.NET 3.5 Extensions Preview Released

    This December 10, 2007 post details my initial installation and test drive of the ASP.NET 3.5 Extensions Preview's Dynamic Data scaffolding and Data Services (Astoria).

    I expected the ASP.NET Dynamic Data feature to be derived from SubSonic based on Rob Conery's contention that SubSonic will be the "Convention-Driven Toolset for Microsoft’s New MVC Framework" for ASP.NET in a length post after joining Microsoft's ASP.NET team, but it didn't happen. Dynamic Data's default scaffolding is based on a master-page design and is similar to Polita Paulus's Blinq project, which wasn't updated for ASP.NET 3.5. The initial data source is LINQ to SQL and the LinqDataSource control; future support for LINQ to Entities is promised.

    There's hope for the SubSonic-based scaffolding, however. Rob left this comment on my ASP.NET 3.5 Extensions Preview Released post of December 10, 2007:

    >>The question here is: "What happened to the SubSonic-based "convention-driven" scaffolding?"<<

    It's coming :). Just need a week or 2 here.

    I was able to get a C# ASP.NET Data Services data source up and running by following the QuickStart instructions, but two attempts to create a source with VB failed. I'll test Web and WinForm clients later this week.

    Click here for more details and screen captures.

    Andrew Conrad Starts Series of Articles About LINQ to REST

    Astoria technical lead Andy Conrad posted on December 10, 2007 the first of a series of articles about LINQ to REST (a.k.a., LINQ to Astoria and LINQ to ASP.NET Data Services) that will cover, in his words:

      1. How to set up an Astoria Data Service which can be used for remote execution of Linq queries.
      2. Dive deep into the Astoria Client API's Linq support including a detailed description of how Linq queries are translated to URIs.
      3. How to make the Astoria Data Service updateable so the results of the Linq queries can be remotely modified and persisted.

    The first post, Linq to REST, shows you how to set up a data service based on a LINQ to SQL (not an Entity Framework) data source and a simple console client to demonstrate the Astoria client library, Microsoft.Data.WebClient.dll, that translates LINQ queries to Astoria's URI scheme.

    In conclusion, Andy promises:

    In future posts, I will explain how that worked.  What all the Linq capabilities that are supported.  And what one can do with the objects once they are materialized.

    Based on the ease of use and other benefits of LINQ to SQL as the data source for Astoria, it's my conclusion that developers who favor SQL Server will use LINQ to SQL instead of the Entity Framework for projects that aren't required to support complex inheritance models.

    ADO.NET Data Services Validation and Access Control Features

    Mike Flasko explains in his ADO.NET Data Services Dec2007 CTP - Validation and Access Control post of December 10, 2007 that Astoria resources are locked down by default.

    He also notes that Astoria depends on the Windows Communication Framework (WCF) for authentication, and then goes on to describe the ResourceContainerRights enumeration for the configuration.SetResourceContainerAccessRule method and how to add a query interceptor for ad hoc access control. Change interceptors hook into update operations, which might also require access control.

    Charlie Calvert Revisits LINQ to SQL's DataContext

    Charlie explains LINQ to SQL's approach to object/relational mapping (O/RM) and how the DataContext object works in his December 10, 2007 Understanding the DataContext post.

    This must be at least the 500th iteration of this topic by bloggers.

    Danny Simmons Explains How to Recreate an Object Graph's Associations

    In his December 8, 2007 Computing an Original Value Graph post, Danny continues his quest to recreate complete Entity Framework object graphs from information stored in the ObjectStateManager and RelationshipManager. Danny's previous Creating an original value object from the separate values stored in the ObjectStateManager of November 11, 2007 (updated 12/3/2007) and Concepts Part II: Relationships of December 2, 2007 provide the background for regenerating references to associated entities.

    Regenerating the references for entity associations requires several helper methods and a recursive SetRelationships function. Much of the complexity is due to missing foreign key values for many:1 and 1:many relationships. If your base entities include foreign key values, such as LINQ to SQL provides, you can generate references by relatively simple LINQ queries. (I appear to have lost my fight for an option to make foreign key values visible.) This is a major consideration when serializing entities to XML for transport across process boundaries.

    Danny ends with this commentary on serialization:

    One interesting related question we are debating internally is the granularity users would most use when tra[n]sporting entities with this additional information. You could imagine, for instance, serializing a single cache entry in order to transport an entity along with its state, set of modified properties and original values. At the other extreme, you might just serialize an entire object cache which would bring along an arbitrary set of entities and could be an efficient way to transport multiple entities at once (including relationships between them, etc.). In the middle somewhere is the ability to specify a graph of related entities and bring them (and their tracking information), but naturally there are a number of interesting issues that would have to be worked out to enable that scenario (like how to specify what part of the graph to serialize, etc.).

    The real issue is dealing with cyclic associations when serializing objects with many:1 and 1:many relationships, as I discussed in my Serializing Object Graphs Without and With References post of November 21, 2007 (updated 11/25/2007). The LINQ to SQL group punted by sticking with the DataContractSerializer and now has no "out-of-the box multi-tier story." Hopefully this fate won't befall Entity Framework v 1.0.

    Entity Framework Beta 2 to Beta 3 Breaking Changes

    The ADO.NET Team's Breaking Changes- Entity Framework Beta 3 post of December 6, 2007 lists five breaking changes to the Entity Data Model, two for Entity Services, one for LINQ to Entities, 12 for Object services and 2 for Tools.

    (This post was omitted from last week's list. )

  • Monday, December 10, 2007

    ASP.NET 3.5 Extensions Preview Released

    Updated 2/13/2008: See the "Data Services (Astoria Project)" topic.

    Scott Guthrie announced Sunday night in his ASP.NET 3.5 Extensions CTP Preview Released post that the extensions finally were available for download as a compact 3.64 MB ASPNetExt.exe file.

    Installation took a minute or two on my "real" Windows vista test machine but about three minutes on a virtual Vista instance. This is the first time I've encountered an "Installation is taking longer than expected" message from an installer.

    Update 12/11/2007: Setup adds Microsoft.Data.Web.dll, Microsoft.Data.Web.Design.dll, Microsoft.Data.WebClient.dll, System.Web.Extensions.dll, and System.Web.Extensions.Design.dll to the /Program Files/Reference Assemblies/Microsoft/Framework/ASP.NET 3.5 Extensions folder.

    Dynamic Data Support samples and the Microsoft AJAX Library install to a new \Program Files\Microsoft ASP.NET 3.5 Extensions folder.

    Here are links to the online Readme.htm file and QuickStart documentation.

    As mentioned in yesterday's update to the "Scott Guthrie: ASP.NET 3.5 Extensions Due on Sunday" topic of LINQ and Entity Framework Posts for 12/3/2007+, all five pieces of the preview are included in the installation:

    • ASP.NET Model-View-Controller (MVC) Add-in
    • ASP.NET AJAX Improvements
    • ASP.NET Dynamic Data Support
    • ASP.NET Silverlight Support
    • ADO.NET Data Services (Astoria) without the Silverlight client

    Dynamic Data Support

    Dynamic Data scaffolding uses LINQ to SQL as its object/relational mapper (O/RM), LinqDataSource v3.6 as the site's data source and new DynamicGridView and DynamicDetailsView controls.

    David Ebbo's Introducing the new Dynamic Data post gives a synopsis of the process for generating and customizing Dynamic Data pages.

    Here's a screen capture of the very subdued page for the Northwind Products table:

    Click above capture for a full-size (1024 x 768) image.

    The scaffolding enables creating a standardized set of Web forms with built-in navigation that's similar to the earlier (and now discontinued) Blinq project. Using LINQ to SQL as the O/RM limits v1.0 Dynamic Data sites to SQL Server as the RDBMS. David Ebbo says that support for LINQ to Entities will arrive in the future.

    The question here is: "What happened to the SubSonic-based "convention-driven" scaffolding?"

    Update 12/11/2007: The answer from Rob Conerly is in this comment to this post:

    >>The question here is: "What happened to the SubSonic-based "convention-driven" scaffolding?"<<

    It's coming :). Just need a week or 2 here.

    Model-View-Controller (MVC) Add-in

    Rob Conery, SubSonic's architect and primary developer, who's been working on the MVC UI Helpers (MVC Toolkit) for the last month, has posted two very detailed posts about MVC:

    ASP.NET MVC: Using RESTful Architecture of December 6, 2007 shows you how to "architect your MVC application using a RESTful approach, and also how you can partition out your 'logical bits' so you DRY (don’t repeat yourself)."

    ASP.NET MVC Preview: Using The MVC UI Helpers of December 5, 2007 explains how these helper methods "encapsulate UI code in the same way that Server Controls do with Web Forms."

    Note: The MVC Toolkit is a separate download that includes Dynamic Data for MVC projects and the code for Rob's MVC UI Helpers post. Get the toolkit here as an MVCToolkit.zip archive.

    Data Services (Project Astoria)

    The ADO.NET team's Mike Flasko lists the new and upgraded ASP.NET Data Services features in his ADO.NET Data Services ("Project Astoria") CTP is Released post.

    The Creating ADO.NET Data Services QuickStart instructions for ASP.NET Data Services show you how to get an Entity Framework-based data service up and running.

    Note: There is a typo and an error in the QuickStart instructions for the "Create the Data Service" topic.

    • In "When the Add New Item window appears, select SimpleDataService," replace SimpleDataService with ADO.NET Data Service.
    • The following instruction doesn't work for VB services. "In this example, the database was called Northwind so the namespace is NorthwindModel," you must replace NorthwindModel with SimpleDataService.NorthwindModel in the Imports statement to make NorthwindModel visible.
    • The VB version then fails with an "The member with identity 'NorthwindModel.Categories' does not exist in the MetadataCollection" error message written to Default.aspx.

    Update 2/13/2008: See the Fix for "Known Bug" when Creating ADO.NET Data Services with Visual Basic and a Web Application post for the workaroud to the last problem. There are a few other VB-specific problems under submission to the ADO.NET Data Services (Pre-Release) Forum.

    Following is the default Atom 1.0 list of tables from the C# version of the QuickStart example:

    And here's a capture of the first item of the Products collection:

    Click above capture for a full-size image.

    Notice that many:1 related entities have a type=entry and 1:many child collections have a type=feed. Services that return type=feed trigger IE 7's Feed template; you can read query output by a Page | View Source command.

    Update 12/12/2007: Alternatively, open IE's Tools | Internet Options | Content tab, click Settings in the Feeds section and uncheck the Turn on Feed Reading View option.

    Here's the source for the first two members of the Order_Details collections:

    Update 12/11/2007: Andy Conrad, Astoria technical lead, shows you in his LINQ to REST post how to create a data service with LINQ to SQL as the data source and query it with LINQ query expressions translated to URI syntax.

    Stay tuned for more about ASP.NET Data Services.

    Thursday, December 06, 2007

    Entity Framework Beta 3 Available for Download

    As Scott Guthrie promised last week, ASP.NET .NET 3.5 Extensions Preview to Include Entity Framework Beta 3, ADO.NET Data Services, Microsoft announced in a December 6, 2007 press release that Entity Framework Beta 3 is available for download.

    Following are the download links and problems/fixes for them:

    * You must install an undocumented VS90.KB945282 patch to VS 2008 from http://go.microsoft.com/fwlink/?LinkID=104985 after you install the runtime and before you install the Entity Framework Tools. Be patient; the patch takes a loooong time to install with the Software Update Microsoft Visual Studio - KB945282 Installation Wizard. So far, I haven't seen any regression issues (e.g., problems with previously installed Volta CTP1) from installing the patch.

    Update 12/7/2007: According to a reply by Microsoft's Tommy Williams to my Issues with Entity Framework Beta 3 Bits Released Today post in the ADO.NET (Prerelease) forum, the following two problems are fixed:

    ** It appears that the required code for the Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")  "NorthwindEFModel", "..\NorthwindEFModel\NorthwindEFModel.csproj", "{59F48ED5-9591-45A2-B2D6-EC461985CE85}" project is missing from the Entity Framework Samples solution. Also of note is the completely missing VB version of this project.

    *** As of 12/6/2007 at 13:30 the online documentation appears to be for Beta 2 mislabeled as for Beta 3. I recommend you choose Start | Programs | ADO.NET Entity Framework Tools Preview | Help Overview to open the local wd_EntityFramework.chm file until these issues are resolved.

    Additional Beta 3 Information

    Danny Simmons expands in great detail on performance and other improvements to the EF runtime in his EF Beta 3 is finally available! post.

    The 23 breaking changes between the Beta 2 and Beta 3 versions are listed in the ADO.NET Team's Breaking Changes- Entity Framework Beta 3 subsequent post.

    The ADO.NET Team's ADO.NET Entity Framework Beta 3 R[e]leased! post later the same day outlines the new features in Beta 3 and Entity Designer CTP2 covers the new EDM Designer features.

    Bonus: Brian Beckman interviews Sam Drucker, Data Programmability General Manager, about the Entity Framework in this 1:03 Channel 9 Expert to Expert: Brian Beckman and Sam Druker - Deep Entity Framework video segment released on December 5, 2007.

    Sam gives what I think is the clearest view of the value-add of the Entity Data Model in an environment where databases have an order-of-magnitude greater lifetime than their front-end applications. He also explains why the Astoria team used EF in their .NET Data Services.

    Updated Third-Party EntityClient Data Provider List

    According to the press release, the following third-party EntityClient data providers will be available within three months of the Entity Framework's RTM date:

    • Core Lab. Providing connectivity to Oracle, MySQL, PostgreSQL and SQLite databases
    • IBM. Providing connectivity to both IBM DB2 data server and Informix Dynamic Server (IDS) databases
    • MySQL AB. Providing connectivity to MySQL databases
    • Npgsql. Providing connectivity to PostgreSQL database versions 7.3+ and 8.x
    • OpenLink Software. Providing connectivity to Oracle, Informix, Ingres, Sybase, MySQL, PostgreSQL, DB2, Progress and Microsoft SQL Server databases, and any data source accessible via OpenLink ODBC or JDBC bridge drivers
    • Phoenix Software International. Providing connectivity to SQLite databases
    • Sybase. Providing connectivity to SQL Anywhere databases
    • VistaDB Software. Providing connectivity to VistaDB databases

    EntityClient data providers from these firms plan to target the RTM version in 2008:

    • DataDirect Technologies. Providing connectivity to multiple data stores including Oracle, Sybase, Microsoft SQL Server and DB2 via DataDirect Connect® for ADO.NET
    • Firebird. Providing connectivity to Firebird databases

    Update 12/7/2007: The big question: Why is Oracle missing from the preceding two provider lists?

    My IBM and Oracle to Support the ADO.NET Entity FrameworkIBM and Oracle to Support the ADO.NET Entity Framework post of June 1, 2007 (updated June 16 and 17) contained the following item: 

    Christian Shay, Product Manager in the .NET and Windows group at Oracle left this comment to my Future LINQ to SQL Support for Multiple Databases? post on May 31, 2007:

    I think Oracle is keeping their level of support secret. But, a clue has just been revealed and apparently, more will be known at TechEd. Oracle is co-presenting a talk called "ADO.NET Entity Framework: Provider Model and Integration with Third-Party Databases" Check it out: http://cshay.blogspot.com/2007_05_01_archive.html.

    Kathleen Richards' "Microsoft Releases Entity Framework Beta 3" Redmond Developer News story of December 7, 2007 quotes Entity Framework program manager Elisa Flasko regarding why Oracle isn't on the list:

    "We have been working with them, but at this point what we have are the providers that are included in the press release," Flasko said.

    Although CoreLabs, OpenLink Software, and DataDirect Technologies plan to deliver EntityClient providers, an implementation by Oracle would be more appealing to many Oracle licensees.

    Note: The SQL Server team has started the Data Platform Insider blog that primarily covers SQL Server 2008 November 2007 CTP at the moment. It's surprising that the ADO.NET Team folks didn't let their readers know about it when it launched in mid-November 2007.

    First Volta CTP Available from Microsoft Live Labs

    The first public attempt by Erik Meijer to "Democratize the Cloud" is ready as of 11:00 AM PST, December 5, 2007, for VS 2008 developers to test-drive a Community Technical Preview. You can read the details about Volta, a product of the Tesla incubator group, and download the first CTP from Microsoft Live Labs' newly minted Volta site.

    There's also a Q&A session with Erik Meijer on PressPass and a Volta forum for developers. 

    According to Erik's Democratizing the Cloud using Microsoft Live Labs Volta post today on the Lambda the Ultimate forum:

    Volta is a collection of tools that enable programmers to develop asynchronous and distributed (including but not limited to AJAX) applications by successive refactoring of normal, sequential, programs written in standard .NET languages (this CTP requires Visual Studio 2008) and deploy the resulting applications on a wide variety of target platforms (this CTP supports Internet Explorer and FireFox). Or as I sometimes say when I am trying to sound like a marketing person "Volta stretches the .NET platform to cover the Cloud" [two-part video clip.] Volta allows programmers to concentrate on the essential complexity involved in building AJAX application and have our tools take care of the gory details and accidental complexity. ...

    Volta embraces the Lean Programming principle of delaying irreversible decisions until the last possible responsible moment. In particular we want to delay decisions about distribution as long as possible. To help developers make informed decisions about the distribution a program across tiers, the Rotunda profiler from MSR is fully integrated in the Volta toolchain. By automatically injection hooks for all interesting events, Rotunda creates trace information that can be inspected using the standard Service Trace Viewer tool. [Emphasis added.]

    Updated: 12/8/2007

    Jeff Atwood quotes and analyzes the Poppendiecks' definition of the Last Responsible Moment in his October 17, 2006 post:

    Concurrent software development means starting development when only partial requirements are known and developing in short iterations that provide the feedback that causes the system to emerge. Concurrent development makes it possible to delay commitment until the last responsible moment, that is, the moment at which failing to make a decision eliminates an important alternative. If commitments are delayed beyond the last responsible moment, then decisions are made by default, which is generally not a good approach to making decisions.

    See the "Erik Meijer Compares Volta and Google Web Services for Mary Jo Foley" topic of the LINQ and Entity Framework Posts for 12/3/2007+ post for additional input from Erik.

    Volta Project Description and Sample Applications

    The Volta site provides a more detailed description:

    The Volta technology preview is a developer toolset that enables you to build multi-tier web applications by applying familiar techniques and patterns. First, design and build your application as a .NET client application, then assign the portions of the application to run on the server and the client tiers late in the development process. The compiler creates cross-browser JavaScript for the client tier, web services for the server tier, and communication, serialization, synchronization, security, and other boilerplate code to tie the tiers together.

    Developers can target either web browsers or the CLR as clients and Volta handles the complexities of tier-splitting for you.  Volta comprises tools such as end-to-end profiling to make architectural refactoring and optimization simple and quick. In effect, Volta offers a best-effort experience in multiple environments without any changes to the application.

    Here's a screen capture of the Virtual Earth sample client application:

    Click image above to display full-size capture. 

    Clicking the C# Code tab displays the C# (not JavaScript) code running in the client to perform the actions in the left-hand bulleted list.

    Background

    Following are links to previous OakLeaf posts on LINQ 2.0, Volta, Tesla, and "Democratizing the Cloud":

    There's no mention of "LINQ 2.0" or even LINQ anywhere on the live.com site. Apparently, LINQ 2.0 will go its own way independently of Volta as the next version of LINQ.

    Limitations and Comments

    According to the Volta Known Issues and Limitations page:

    One of the benefits of Volta compiling to MSIL before the destination runtime, rather than source-to-source translation, is that developers can use multiple .NET programming languages to build Volta applications and controls, including C# and Visual Basic. However, currently you will encounter several limitations when using Visual Basic, including:

    • Late binding is not supported.
    • Services from My (such as User, Computer, etc.) are not supported.

    The following are also unsupported unless explicitly specified otherwise:

    • Conversion functions. For example, the Cint conversion function works only if the underlying type supports the conversion.
    • Helpers and VB6 legacy. For example, the Beep method is unsupported.

    So VB again is a second-class citizen, even in project intended to "democratize" a technology.

    According to a forum message, you can't use Volta with VS 2008 Express editions because they don't allow loading the extensions that are required to run Volta.

    Expect to hear more about Volta after I download the bits and give it a test drive.

    Moved: 12/6/2007 from LINQ and Entity Framework Posts for 12/3/2007+

    Technorati Tags: , , ,

    Tuesday, December 04, 2007

    LINQ to XSD Redux and LINQ to Stored XML Coming

    LINQ to XSD was a technology spearheaded by Ralf Lämmel while he was a member of Microsoft's Data Programmability/XML Team. He released an alpha version 0.1 for the LINQ to XML CTPs and 0.2 for the Orcas Beta 1 drop. No LINQ to XSD alpha appeared for Orcas Beta 2, probably because Dr. Lämmel returned in July 2007 to Germany to assume a full professorship in the new University of Koblenz-Landau's Computer Science Department.

    Updated January 14, 2007: See below.

    No one at Microsoft responded to my requests for an update to LINQ to XSD's status, including my following post of November 17, 2007 to the LINQ Project General Forum:

    Ralf Lämmel updated his LINQ to XSD implementation that enables strongly-typed LINQ to XML queries from the November 2006 Preview Alpha 0.1 for the May 2006 LINQ CTP to Preview Alpha 0.2 for Orcas Beta 1 on June 5, 2007. Dr. Lämmel then returned to Germany to assume a full professorship in the Department of Computer Sciences of the University of Koblenz (Germany).

    There’s been no word from the XML Team that’s responsible for LINQ to XML about an update to LINQ to XSD for the final VS 2008 bits. Hopefully, this very useful LINQ implementation won’t disappear as a result of attention attrition.

    Today's LINQ to XSD Story

    Out of the blue on December 5, 2007 comes Microsoft's Shyam Pather with his LINQ to XML: Visual Studio 2008, Silverlight, and Beyond presentation at the XML 2007 conference in Boston. Following the usual LINQ to XML in VB 9.0 marketing hype in the abstract, Shyam says:

    We will also discuss incubation efforts for a post-Visual Studio 2008 technology, LINQ to XSD, which provides .NET developers with support for typed XML programming. LINQ to XSD contributes to the LINQ project (.NET Language Integrated Query); in particular, LINQ to XSD enhances the previously mentioned LINQ to XML technology that is expected to release in Visual Studio 2008. [Emphasis added.]

    You can download the PowerPoint slides for the session here.

    Shyam previously participated in the Microsoft-sponsored Interop Round Table & Happy Hour – Development Discussion on Interop and XML, which started at 4:00 PM on December 4, 2007. Douglas Crockford (Yahoo!), Miguel de Icaza (Novell Inc.), Mattew Weier O’Phinney (Zend), Vijay Rajagopalan (Microsoft), and Craig Kitterman (Microsoft) also participated. Vijay's presenting Document Interop: Ecma Office Open XML and OASIS ODF, Enterprise Interop: Identity and XML, Web Interop: Ajax with XML and JSON (with Crockford and O'Phinney).

    I wonder why the XML Team and others at Microsoft had nothing to say in its blog about the apparent resurrection of LINQ to XSD. Are these "incubation efforts" secret? A "breaking news" story?

    Update 1/14/2007: Hartmut Wilms reviewed Shayam's XML 2007 presentation in this December 5, 2007 InfoQ article: Post-VS 2008-Technology: LINQ to XSD and LINQ to Stored XML.

    Background

    Ralf posted a series of four articles on typed XML programming in mid- to late-2006:

    And released the LINQ to XSD Preview Alpha 0.1 version for the and a LINQ to XSD Overview whitepaper with the last post. Following are my posts after the initial Preview Alpha 0.1 version:

    Update 12/5/2007: VB MVP Bill McCarthy posted an interesting suggestion in his LINQ to XSD --> VB can do better! post of December 5, 2007 regarding implementing LINQ to XSD with a schema as a dynamic interface. Ralf discussed VB 9.0 dynamic interface implementation in his Generalized vs. dynamic interfaces post of December 23, 2006:

    For instance, dynamic interfaces of some form or another would allow us to carry out XML-data binding very much in the LINQ to XSD manner, but without incurring the cost of extra objects for typed views.

    VB 9.0 introduced dynamic interfaces, which Erik Meijer calls "Strong Duck Typing." You'll find an example of a simple dynamic interface implementation as part 11 of the "Overview of Visual Basic 9.0" XML 2005 conference session by Erik, Amanda Silver, and Paul Vick.

    Stealth Topic: LINQ Queries Against the SQL Server 2005+ XML Data Source

    Missing from the abstract is the topic that many forum participants have asked about: Queries against SQL Server 2005 and later's xml datatype.

    Slide 27 introduces Future Work: LINQ to Stored XML whose goal is to "provide strongly-typed LINQ experience over data in XML database columns," which requires "[m]apping from XML schema to classes" and "[q]uery translation from LINQ expressions to [a] server XQuery expression."

    Slides 28, 29 and 30 use AdventureWork's Resume table as the data source to:

    • Filter and Project on XML Scalar Attributes
    • Enumerate on Collection Type

    Unfortunately, there's no word on when we might expect another alpha or beta of LINQ to SQL for Visual Studio 2008 or an early preview of LINQ to Stored XML.