Showing posts with label Jasper. Show all posts
Showing posts with label Jasper. Show all posts

Saturday, June 14, 2008

ASP.NET Dynamic Data: Scaffold a Custom Administrative Web Site with a LINQ to SQL Data Model in Less than Five Minutes

This screen capture sequence illustrates the “Use the Wizard to Generate Custom Pages” topic of the Scaffold Web Apps with ASP.NET Dynamic Data cover story for the September 2008 issue of Visual Studio Magazine. The topic describes how to create a fully-functioning file-system Web site from the Northwind sample database.

Step 1: Launch Visual Studio 2008 or Web Developer Express SP1, start a new file-system Web site and select the Dynamic Data Website Wizard (Preview) template.

Step 2: Accept the Generate a New Data Model from This Database option and select a connection to an SQL Server instance with the Northwind sample database installed.

Step 3: Select the only the original Northwind tables to install; omit the Regions and Territories tables. (The May 23, 2008 Dynamic Data preview was limited to LINQ to SQL as the data model. If your version of this dialog has a Data Context Namespace text box, leave it empty.)

Step 4: Scaffold all eight EntitySets for your project with List, Details, Edit and Insert pages.

Step 5: Accept the default customization options. You can remove features that use DetailsView or FormView controls or elect to edit or insert pages inline with GridView or ListView controls.

Step 6: Click Edit to open the Edit Fields dialog. Clear columns for properties of the selected entity that you don’t want to appear in the GridView or ListView control. (This dialog was not fully cooked in the May 23, 2008 release on which this post is based.) Click OK and then click Finish.

 

Step 7: Generating the scaffolding code will add several files to existing project folders. Mark the Apply to All Items check box and click Yes to avoid repeated appearances of the Merge folders message box.

Step 8: Review and optionally rearrange the singularized EntityType widgets. Notice the addition of a prebuilt NorthwindDataContextPartialClass file and addition of a CustomPages subfolder for each EntitySet. (Click image for an 1024 x 768 screen capture.)

Step 9: Press F5 to build and run the project, clicking OK to dismiss the Debugging Not Enabled message box.

Step 10: Notice the insertion of the Web site name after the Domain:Port name and number for the default and other pages.

Step 11: Click Products to display the Products ListView. Notice that a column for ProductID is missing and that Category and Supplier columns are out of sequence when compared with the original sequence of entity properties. (Click image for an 1152 x 864 screen capture.)

Appearance After Formatting with CSS and Minor Heading Changes

Following are customized versions of the forms shown in steps 10 and 11 as well as a Supplier details page with 11-point Calibri substituted for the approximately 8.5-point (76%) default Tahoma and Trebuchet MS fonts as well as color saturation increased.

Figure 12: /DynamicDataWebSite/Default.aspx

Figure 13: /DynamicDataWebSite/Products/List.aspx (Click for 1172 x 864 pixel version). Notice that the DynamicFilter dropdown lists are missing from Wizard-generated ListView pages.

Figure 14: /DynamicDataWebSite/Suppliers/Details.aspx$SupplierID=1

Sample code for the project, which includes customization by manipulating table and field metadata, will be available when the article publishes.

ASP.NET Dynamic Data: Generate a Dynamic Administrative Web App from an Entity Data Model in Less than Five Minutes

This screen capture sequence illustrates the “Generate a Dynamic-Page Web App” topic of the Scaffold Web Apps with ASP.NET Dynamic Data cover story for the September 2008 issue of Visual Studio Magazine. The topic describes how to create a fully-functioning ASP.NET Web Application from the Northwind sample database.

Step 1. Launch Visual Studio 2008 or Web Developer Express SP1, and select the Dynamic Data Entities Web Application template to use an Entity Data Model as the data access layer (DAL) for your project. (The Dynamic Data Web Site file-system project uses LINQ to SQL as its DAL.)

Step 2: Add an ADO.NET Entity Data Model DAL and give the model a descriptive name.

Step 3: Accept the default Generate from Database option in the first Wizard dialog.

 

Step 4: Select a connection to an SQL Server 2005 or 2008 instance of the Northwind sample database. (The computer name appears when localhost\SQLEXPRESS is specified as the Data Source.)

 

Step 5: Select the eight tables from the original Access version of the database and click Finish.

Step 6: After a few seconds the Entity Framework’s graphic object/relational mapping (O/RM) designer appears with the Model browser in the right pane. Rearranging the entity widgets and singularizing EntityType names is optional. (Click the image to open a full-size (1024 x 756) capture.)

Step 7: Open the Global.asax settings file and change the model name to NorthwindModel.NorthwindEntities and change ScaffoldAllTables from false to true. (Click the image to open a full-size (1024 x 756) capture.)

Step 8: Press F5 to compile and run the Web app with the ASP.NET Development Server (Cassini). Click OK to enable debugging.

Step 9: This subdued page opens to display a DynamicGridView of EntitySets. (The UI designers appear to have forgotten that the data source is an ObjectContext for EntitySets, not a relational table, and possibly are color blind.)

Step 10: Click the Products link to open the Products EntitySet in a DynamicGridView with three DynamicFilters for display by Discontinued state, Category and Supplier. Clicking a Category or Supplier link opens a DynamicDetailsView; clicking Order_Details opens a DynamicGridView of all Order_Detail entities that include the selected Product.

The three dropdown lists above the grid are DynamicFilter controls that enable filtering by Discontinued (Boolean) status (All, true, false), Category, Supplier or any combination of the three.

(Click the image to open a full-size (1152 x 864) capture.)

Step 11: Click a supplier link, such as Exotic Liquids, to display a DetailsView of the Supplier entity.

Optional Step 12: Singularize EntityType and navigation property (endpoint) names to correspond with association multiplicity. (Click the image to open a full-size capture.)

Appearance After Formatting with CSS and Minor Heading Changes

Following are customized versions of the forms shown in steps 9, 10 and 11 with 11-point Calibri substituted for the approximately 8.5-point (76%) default Tahoma and Trebuchet MS fonts as well as color saturation increased.

Figure 13: Default.aspx

Figure 14: /Products/List.aspx (Click for 1172 x 864 pixel version)

Figure 15: /Suppliers/Details.aspx$SupplierID=1

Sample code for the project, which includes customization by manipulating table and field metadata, will be available when the article publishes.

Tuesday, November 06, 2007

LINQ and Entity Framework Posts for 11/5/2007+

Note: This compendium is updated daily or more often, depending on availability of articles. (Updated November 6, 7, 8, 9, 10, and 11, 2007)

Rick Strahl Posts Sample Code for His DevConnections LINQ Presentation

Rick's My DevConnection Fall '07 Session Slides and Sample Links post of November 10, 2007 includes a link to the source code for his "Building a LINQ-Based Business Layer for ASP.NET Applications" session example, which he describes as follows:

This session's sample provides a small business framework wrapper for LINQ to SQL (discussed here) as well as a sample application that uses the business framework for all of its business logic and LINQ to SQL for all data access. The sample is a small time tracking application that allows punching in and out, viewing of entries, and a basic time report, as well as security and a few other related features.

The preceding quote's link is to Rick's A simple Business Object wrapper for LINQ to SQL post of September 27, 2007, which provides a detailed architectural description, class diagram, and some explanation of coding techniques. The sample code runs under VS 2008 Beta 2; Rick promises and update for the RTM version.

SubSonic will be the "Convention-Driven Toolset for Microsoft’s New MVC Framework" for ASP.NET

From the "How Did I Miss This?" department: Kauai-based developer Rob Conery, ASP.NET MVP and creator of the SubSonic open-source object-relational mapping (O/RM) tool and data abstraction layer (DAL) combined with Web page scaffolding features, goes to work for Microsoft on Monday, November 12, 2007. He'll be working to "build out SubSonic a little more … in a fulltime capacity with [Microsoft]."

John Galloway suggested more than a year ago (on August 30, 2006 to be specific) that Microsoft should ship SubSonic (formerly called ActionPack) with Atlas. According to his post, which provides examples of SubSonic's scaffolding and LINQ-like query language, John likes SubSonic "a lot better than MonoRail."

The upshot is that the ASP.NET team is adopting an open-source (Mozilla Public License 1.1) O/RM instead of LINQ to SQL or the Entity Framework as the Controller's DAL. Scott Guthrie's decision to adopt SubSonic might be responsible for the apparent demise of Project Jasper (see Has Project Jasper Been Swallowed by a Black Hole? of November 1, 2007).

For more details see SubSonic will be the "Convention-Driven Toolset for Microsoft’s New MVC Framework" for ASP.NET of November 11/2007.

Added: 11/10/2007 Updated: 11/11/2007

Mike Taulty's Tech*Ed Developers 2007 LINQ Presentation Follow-Ups

These three November 10, 2007 posts supplement Mike's three LINQ-related presentations in Barcelona (see Tech*Ed Developers 2007 to Include 10 LINQ-Related Presentations):

TechEd Europe - Follow Up 1. In LINQ, "Where" == "AndWhere" offers samples of cascaded queries with mutually exclusive Where clauses that return an empty sequence. It's a mystery to me why the obvious result raised a question. However, Mike does make the point that IEnumerable implementations of LINQ queries don't support a direct equivalent of an SQL WHERE Region = 'CA' OR Region = 'OR' [OR Region = 'WA'] clause, but LINQ to SQL IQueryable implementations do.

Mike suggests Union queries for uniformity between LINQ to Objects and LINQ to SQL syntax. However, I recommend abandoning uniformity and using the Contains extension method with LINQ to Objects:

Dim strStates As String() = New String() {"CA", "OR", "WA"}
Dim States = From St In strStates Select St
Dim WestCoastCustomers = _
    
CustomerList.Where(Function(c) States.Contains(c.Region))

What would really be nice is OrWhere() as a Standard Query Operator.

TechEd Europe - Follow Up 2. Serializing Expressions discusses a question about a LINQ to SQL architecture that "serializes this LINQ query over the network to a remote middle-tier server and then that server executes the query before serializing the result-sets back to the client."

As Mike notes:

Both LINQ to SQL and LINQ to Entities will allow you to execute a string-based query and get back an object-based result-set and that's the way I'd go if I needed this kind of functionality.

But why send a LINQ string? LINQ is all about replacing brittle query strings with strongly typed, compiler-checked LINQ queries in source code. Sending an SQL statement in a parameterized query string is simpler, faster, and more foolproof. TechEd Developer 2007 was held in Barcelona, best known for Catalan architect Antoni Gaudí's Sagrada Família towers; perhaps Gaudí's fantastically intricate designs influenced the questioner's software design.

TechEd Europe. Follow Up 3 contains the following links:

Beth Massi Interviews Bill Horst on Type Inference in VB 9.0

The title of Beth's Channel 9 Interview: Type Inference in Visual Basic with Bill Horst (Beth Massi) post of 11/8/2007 says it all. The direct link to the 19:39 video clip over a screen cam capture is here.

Added: 11/9/2007

Entity Framework FAQ from Danny Simmons

Danny Simmons posted Entity Framework FAQ on November 8, 2007 at about 3 am from his Las Vegas hotel room. (He's attending DevConnections 2007 but not presenting.)

The FAQ currently has an Introduction and 19 topics ranging from Architecture/Patters to Serialization. Danny pasted the content from his and the ADO.NET Team's previous blog posts and answers to questions in the ADO.NET (Prerelease) forum, a.k.a., the Entity Framework forum.

Added: 11/8/2007

MIX 08 Sessions on ADO.NET Data Services and the Sync Framework

MIX 08 (a.k.a. "The Next Web") will be held in the Venetian Hotel, Las Vegas, March 5 - 7, 2008. Here are two of the first 21 sessions listed that relate to LINQ and the Entity Framework:

REST Easy with the ADO.NET Data Services Framework
Speaker: Mike Flasko
Audience: Technical
Session Type: Breakout

Learn how to create and interact with the ADO.NET data services framework (codename "Astoria") from JavaScript, .NET, and Microsoft Silverlight.

Real World Implementations Using Sync Services for ADO.NET
Speaker: Philip Vaughn
Audience: Technical
Session Type: Breakout

See best practices for building multi-tier applications that synchronize data between Microsoft SQL Server 2008 and thousands of clients using SQL CE to provide an offline experience.

This looks to me to be more evidence of the link between Astoria and the Sync Framework, except that the latter presentation appears (at the moment) to be limited to the original member of the Sync Framework.

Added: 11/8/2007

Beth Massi's Visual Studio Tip of the Day RSS Reader

Beth's Visual Studio Tip of the Day Browser post of November 7, 2007 demonstrates a special-purpose feed reader that uses a LINQ to XML query to parse the RSS feed from Sara Ford's blog and display a list of tips of the day ("Did you know ... ?" items) in a DataGridView and show the body of the selected tip in a text box. The complete app is available to download.

Added: 11/8/2007

The VB Team: Compiled LINQ to SQL Queries Redux

Back in July 2007, Rico Mariani (then Microsoft performance czar, now Chief Architect of Visual Studio) wrote a five-part series named DLinq (Linq to SQL) Performance Part N. The series ended with Rico claiming that he achieved 93% of the performance of the underlying SqlClient/SqlDataReader data provider with compiled LINQ to SQL query expressions that exaggerate LINQ overhead. I wasn't able to duplicate his results at the time because he had VS 2008 Beta 2 and I didn't. It was clear, however, that compiling the query gave a significant improvement in execution speed.

The VB Team's Doug Rothaus posted LINQ Cookbook, Recipe 10: Pre-compiling Queries for Performance on November 7, 2007. Doug's test harness uses a DataGrid view to display orders for a selected Northwind customer. My test harness that I described in Rico Mariani's DLinq Performance Tips (Part 2) and Compiled Queries executed the compiled and uncompiled versions of query similar to the one Rico used 500 times to obtain what I believe is a more accurate timing method. My Rico Mariani's DLinq (LINQ to SQL) Performance Tips (Round 3) has links to Rico's later posts. My posts include tabular timing data to compare performance. I never came close to 93% of the performance of the SqlClient/SqlDataReader combination.

Added: 11/7/2007

Julie Lerman: Astoria to Become ADO.NET Data Services

Julie's November 6, 2007 Astoria - what's coming after the prototype post from DevConnections 2007 (Las Vegas) reports on Mike Flasko's VDM303: Project Astoria: Data Services for the Web presentation.

Aside from the name change, here are the changes since Pablo Castro's Astoria data sources and system layering post of September 27, 2007:

  • Data will be formatted as either JSON or ATOM. Plain old XML (XML) is out, as is Web3S. I expressed my disdain for Web3S in Deciding Astoria's Final URI Addressing Scheme of September 23, 2007. However, I think abandoning POX is a serious mistake, expecially when you consider that a future Silverlight version is scheduled to get LINQ for XML.
  • LINQ to Astoria will translate LINQ query expressions to URIs that will correspond to the final URI addressing scheme, which presumably won't include Web3S syntax.

Hopefully, the Astoria team will change their minds on abandoning POX as a wire format. Dare Obasanjo's Why GData/APP Fails as a General Purpose Editing Protocol for the Web post of June 8, 2007 and One Protocol to Rule Them All and in the Darkness Bind Them article of October 9, 2007 explains why the Atom Publishing Protocol (RFC 5023) "is unsuitable as the data access protocol for a large class of online services." 

Added: 11/7/2007

Anders Norås: Quaere Offers LINQ-Like Deferred Execution

Anders' Lexical Closures, Deferred Execution and Kicker Methods post of November 6, 2007, explains that Quaere ("LINQ for Java") does, indeed, offer deferred execution. Quaere uses the iterator method on Java's Iterable interface as its "kicker method."

The term kicker method comes from Chris Wanstrath’s Ambition project (a.k.a. "LINQ for Ruby").

Added: 11/7/2007

Dinesh Kulkarni on Enums in LINQ to SQL

Dinesh Kulkarni proves that LINQ to SQL supports enums in his Less known LINQ to SQL features 1: how to map an enum post of 11/5/2007. His example replaces the Northwind Shipper entity with:

public enum ShippingCompany {
   Undefined,
   FedEx,
   UPS,
   DHL
}

and provides a pair of classes that demonstrate its use with the Orders.ShipVia property as a ShippingCompany or Nullable<int> (int?) type that LINQ queries.

Added: 11/6/2007

Off-Topic: Microsoft Opens the Sync Framework's Kimono

I've written several posts and a couple of Visual Studio Magazine articles about Sync Services for ADO.NET, SQL Server Compact Edition (SSCE), and related topics, so I've recapped Monday's news on these and related topics in Microsoft Releases Sync Framework CTP1 of November 5, 2007.

Added: 11/6/2007

Update 11/8/2007: This item might not be as off-topic as I initially believed. Mary Jo Foley mentioned in her November  5, 2007 More details emerge on Microsoft’s online-offline sync platform article:

Astoria supports the Atom Publishing Protocol (APP) as a serialization format and the Sync Framework supports Ray Ozzie's Simple Sharing Extensions (SSE) for Atom and RSS. This means that SSE-enabled Astoria data sources could participate in bi-directional, peer-to-peer synchronization operations.

Update 11/9/2007: Steve Lasker posted in his November 7, 2007 Presentations & Demos from Tech Ed Barcelona 07 post links to the slide decks and demo code for his SQL Server CE and Sync Services presentations. The demo code is for a post-Beta 2 release of VS 2008, but Steve says "you can open the files in B[eta] 2."

Update 11/14/2007: Rafik Robeal points to a Channel9 Milind Lele interview, Offline Data Synchronization Services in Visual Studio 2008, by Beth Massi that includes a demo of the Sync Services designer.

Saturday, September 15, 2007

LINQ and Entity Framework Posts for 9/14/2007+

Changes in Store by RTM for LINQ to SQL's WinForm Databinding with Stored Procedures

My Upgrade to LINQ to SQL's WinForm Databinding with Stored Procedures Scheduled for RTM of September 19, 2007 describes the change from the ISingleResult<T> to the DataQuery<TEntity> type returned to the DataContext object by stored procedures that retrieve data. This means that populating DataContexts with stored procs will be closer to on par with dynamic SQL when Microsoft releases Visual Studio 2008. You'll probably hear more about this change from Dinesh Kulkarni in the near future. In the meantime, I'm anxious to hear from Scott Guthrie how the change will affect the LinqDataSource.

You can expect updates to (or a rewrite of) this and my earlier Problems Using Stored Procedures for LINQ to SQL Data Retrieval post shortly. The first update to this post, an added "DataQuery<T> and Table<TEntity> vs. ISingleResult<T> and List<T> Collections" section, is ready now. (Update 9/19/2007 17:00 PDT.)

Beth Massi and Charlie Calvert Talk VB 9.0 and C# 3.0 on .NET Rocks!

Carl Franklin and Richard Campbell interview Beth MassiThe Visual Basic Team's evangelist extradinoire, and Charlie Calvert of the C# Community in Charlie Calvert and Beth Massi on VB.NET, Orcas, and the FoxPro Knitting Guild, show #274. (Update #1 9/20/2007.)

Scott Guthrie on Using C#'s (New?) null Coalescing (??) Operator with LINQ to XML

Scott Guthrie's 9/19/2007 The C# ?? null coalescing operator (and using it with LINQ) post describes how to prevent exceptions in apps that use LINQ to XML when they encounter a null value type in an explicitly-typed XML element.

The original title of the post was "The New C# ?? null coalescing operator (and using it with LINQ)" and Scott originally started began this post with this sentence:

One of the subtle (but cool) new language features in the VS 2008 version of C# is the ?? "null coalescing" operator. [Emphasis added]

By the time I got around to adding this item, someone appeared to have let Scott know that the ?? operator arrived with VS 2005 in C# 2.0 and the underlined words were excised. Here's feed-squirrel.com's copy of the original post.

VBA has the Nz (null-to-zero) function (Nz(variant, [valueifnull]) to return 0 or a string when a Variant variable contained Nothing. Nz was very useful to replace holes in crosstab queries caused by lack of data for a cell. As I recall, an early version wasn't safe for scripting but was subsequently fixed. VB 6 didn't support this function and it's missing from VB.NET. (Update #1 9/20/2007.)

Tim Anderson posted on 9/19/2007 an interview with Scott, Scott Guthrie on .NET futures, conducted at the MIX07 UK conference held in London on September 11-12, 2007. Tim's September 11, 2007 Silverlight at Mix07 UK post mentions in his "Web service support and LINQ" section:

Silverlight will support JSON, WCF and SOAP. It will also include LINQ, with the possibility of creating custom LINQ data providers - Guthrie mentioned possibilities like a LINQ provider for Amazon’s S3 service.

Mike Tulty Repeats Disconnected Concurrency Tests with the Entity Framework and WCF

Following up on his Disconnected LINQ to SQL post of September 14, 2007, which tested optimistic concurrency management with LINQ to SQL in a Windows Communication Framework (WCF environment), his September 19, 2007 Disconnected LINQ to Entities post repeats the process with the Entity Framework (EF).

Mike finds that the EF complicates optimistic concurrency management (OCM) by:

1. Requiring invocation of the SetModifiedProperty("PropertyName") method on each property when the service doesn't save original values supplied by the client. (Julie Lerman reported this issue previously in her Exploring EntityKeys, Web Services and Serialization a little further post of September 2, 2007.)

2. Looping "around the properties of the entity, use reflection to compare the original and current value [using reflection]. If the values differ we copy the property value from the 'new' entity to the 'original' entity" the service saves original values supplied by the client.

It seems to me that, unlike LINQ to SQL, EF isn't very OCM-friendly. No wonder EF disables optimistic concurrency by default and it must be turned on explicitly, as Mike also mentions in his Entity Framework - Object Services Level. Concurrency. post of August 27, 2007.(Update 9/19/2007.)

Sort the Whole Resultset, Not Just the Page, When Using the LinqDataSource's Server-Side Paging Feature

After I got my ASP.NET/LinqDataSource/GridView test harness paging correctly with stored procedures for the primary LINQ to SQL resultset, EntityRefs and EntitySets—with some assistance from Matt Warren—it became clear that I had more work to do to make sorting work properly. Dynamic ORDER BY Clauses for ASP.NET Server-Side Paging with Stored Procedures of 9/18/2007 is a T-SQL-filled, illustrated chronicle of what's necessary to emulate with a stored procedure the server-side paging and sorting features of dynamic T-SQL. It's not pretty, but the test harness is finished. Now I can get back to finishing the WinForm stored procedure test harness. (Update 9/18/2007.)

Dare Obasanjo Analyzes Proposed Changes to Astoria Data Formats

Dare's Microsoft REST APIs: Astoria = Web3S + Atom - RDF of 9/18/2007 analyzes how Microsoft's Web3S (Web Structured, Schema’d & Searchable) specification fits into the RESTful protocol picture in general and the Astoria Web service in particular. The article's title derives from Pablo Castro's Astoria Design: payload formats post of 9/7/2007 , which announced support for a POX (plain old XML) format would be dropped in favor of Web3S, the APP (Atom Publishing Protocol) and JSON (JavaScript Object Notation) formats would remain, and RDF would be abandoned.

Dare includes links to his two prior posts about Astoria—Google Base Data API vs. Astoria: Two Approaches to SQL-like Queries in a RESTful Protocol—and Web3S—Web3S: A RESTful Protocol for Accessing Windows Live Services. If you're interested in an early, independent review of Astoria, check out Leonard Richardson's June 1, 2007 How's My Driving? #1: Microsoft Astoria post.

Dare concludes his post with this question:

For some reason, I'm not surprised about this decision. I do wonder if dropping RDF will actually bring to light some closet RDF supporters who'd love to see supported in Astoria?

A Google blog search on "Microsoft Astoria RDF" for the past month returned 288 hits but few complained about the demise of RDF as an astoria data format. Mike Bergman's Astoria is Whistling Past the Graveyard to Irrelevance post is one of the few. (Update 9/20/2007.)

Astoria Bits Updated for VS 2008 and Entity Framework Beta 2

Pablo Castro's Astoria CTP Refresh for Visual Studio 2008 Beta 2! post of September 17, 2007 announces updated (not upgraded) release that's compatible with Visual Studio 2008 Beta 2, Entity Framework Beta 2 and the EDM Tools August CTP. According to Pablo Castro, the Microsoft Codename "Astoria" - Sept 2007 Community Technology Preview offers no new features other than those required for compatibility with current beta and CTP bits.

Notice the the "Project" prefix has been dropped from the download headline as the result of Astoria emerging from the incubation project cocoon. Strangely, there have been only 59 posts in the Project Codename: Astoria forum since it opened on May 3, 2007.

So far, the Project Jasper team hasn't announced plans for a release compatible with VS 2008 Beta 2 and EF/EDM Tools Beta 2/August CTP. Andrew Conrad said in a September 13, 2007 Jasper using IronPython and VS 2008 August SDK post to the Project Codename: Jasper forum:

It is actually a bit more work to get Jasper working on Beta2 because of a number of breaking changes to the underlying ADO.Net Entity Framework from Beta 1 to Beta 2. As soon as I have a update with some solid plans, I will make it public.

We actually would love to get the community involved more with Project Jasper. Right now we are very interested in any/ all feedback folks might have.  We are in the middle of the planning process trying to figure out what to do in this space going forward – so feedback is invaluable.

Andy would be more likely "to get the community involved more with Project Jasper" if the team updated their bits to Beta 2. The forum has received a total of only 4 posts since it opened on May 2, 2007. (Update 9/18/2007.)

LINQ and WCF MSDN "Masterclass" Stealth Webcasts

Mike Benkovich, a Microsoft developer evangelist stationed in Minneapolis is 75% of the way through a series of four "Framework Masterclass" presentations on LINQ: 

He also has four Windows Communication Foundation presentations scheduled: Framework Masterclass:

I'm surprised that there hasn't been more publicity for his LiveMeeting presentations, all of which are about an hour in length. Mike posts the code from his presentations on his MSDN BenkoBlog.

Julie Lerman on Heterogeneous Joins with LINQ

Using LINQ to query Outlook emails joined with SQL data of September 16, 2007 matches simulated email messages from fictitious AdventureWorks customers and assigns them to the appropriate sales representative. In an excellent example of query composability, she defines Selectemails and contacts from Outlook folders and custSalesPerson from the AWCustomers object and performs a three-way Join to generate a "SenderName from CompanyName: Subject [for] SalesPerson" message.

An interesting alternative to the more common LINQ to XML joined with LINQ to SQL objects demo. (Update 9/17/2007.)

Danny Simmons Simulates a Multi-User Dungeon with Entity Framework

Danny's Concepts Part I: Getting an entity model up and running of September 15, 2007 describes an operational Multi-User Dungeon (MUD) game that he plans to use in "a series of blog posts I'd like to write explaining various Entity Framework (EF) concepts, particularly those related directly to writing code using the framework." The first episode includes a simplified Entity Data Model (EDM) diagram and offers links to its CSDL, MSL, and SSDL files. The CSDL file describes the scalar properties of Actor, Item, Room and Exit entities.

Danny discusses the following three EF concepts in depth:

  1. Storing your metadata in resource files. I've always considered CSDL, MSL, and SSDL files to be free-standing so they can be edited without recompiling the application, similar to app.config files for connection strings. However, I suppose there is benefit to being able to deploy your client app as an Application.exe and app.config file pair.
  2. Connection strings. If you accept the default connection string name in the EDM Designer, its codegen creates a parameterless constructor (ctor) for you. (LINQ to SQL creates a parameterless ctor, too, but it seems to disappear if you edit the construction string. The LinqDataSource needs a parameterless ctor. I'm checking further on this.)
  3. Context creation and lifetimes. Danny's client is a WinForms app and assumes long-lived ObjectContexts. He also plans to explore Web services and Web site apps. Based on the problems I've encountered to date with stored procedures for LINQ to SQL data retrieval (see below), I'm sure he'll use dynamic SQL.

He concludes with sample code for console projects to:

Consolidate connection string building, but also creating a common, static entry point to the context, and automatically maintaining a separate context for each thread by putting the context into thread-local storage [and] prints out a list of all the rooms and items in the DPMud database but does so from two threads running concurrently.

Sounds to me like an interesting series. (Update 9/17/2007.)

Update 9/20/2007: Danny notes that storing metadata in resource files causes problems with Visual Studio's unit testing feature in his 9/19/2007 More about embedding metadata in resources... post. The problem arises because VS's unit testing feature uses unmanaged code!

Update: 1-1/2 Problems with Stored Procedures for LINQ to SQL Data Retrieval Now Solved

Many DBAs will require developers to use (DBA-approved) stored procedures to retrieve persisted entities from—as well as to persist them to—relational tables. There's been little in the way of Microsoft documentation or blog posts on how to use stored procedures for entity retrieval other than Scott Guthrie's LINQ to SQL (Part 6 - Retrieving Data Using Stored Procedures) post of August 16, 2007. Using the ASP.NET LinqDataSource control complicates the data retrieval issue with stored procedures for server-side paging of databound GridView and other grid-like controls. Stored procedures also interfere with populating entity associations.

My Problems Using Stored Procedures for LINQ to SQL Data Retrieval (initial of September 8, 2007, updated 9/14/2007 and 9/15/2007) pointed out the problems with server-side paging by handling the LinqDataSource's Selecting event and lazy-loading or eager-loading entity associations. The updated post shows how to solve the problem with inability to display page 2 or higher with a paging stored procedure (set the AutoPage property value to False.)

Input from Matt Warren showed how to override EntityNameLoad methods to substitute stored procedures for dynamic T-SQL for populating 1:many (1:n) associations, which is half the problem. However, you must force eager loading by using LoadWith expressions to invoke the overridden method. There doesn't appear to be a way to lazy-load 1:n associations, so this approach solves only 1/4 of the problem.

Matt posted this comment on 9/17/2007:

Using stored procedures to load associations does actually work with lazy loading. You don't need to use LoadWith.

Update 9/17/2007: Matt's right, as usual, so I changed the heading from 1-1/4 to 1-1/2 of the problems solved. There must have been cockpit error with my ASP.NET test harness that indicated my overriding function wasn't being invoked when performing a count of total Order_Details for the 10 displayed rows. The EntityNameLoad methods for populating 1:many (1:n) associations do work as expected.

There are still no docs or sample code for eager-loading or lazy-loading many:1 (m:1) associations, which is the remaining half of the problem.

Update 9/15/2007: Julie Lerman comments in her LINQ to SQL and stored procedures post about my "obsessive persistence" in tracking down these issues.

Enable LINQ to Query Non-Generic Collections

Fabrice Marguerie's Querying non-generic collections with LINQ to Objects post of 9/15/2007 shows you how to use the LINQ Cast<T> operator to enable use of other Standard Query Operators with ArrayList or other non-generic collections.

Installing the Project Jasper May 2007 CTP Permanently Clobbers the EDM Designer

Running the installer that you download from the Jasper : MIX 2007 CTP page after installing the EF Tools August 2007 CTP causes VS 2008 to be unable to load the EDM Designer bits (Microsoft.Data.Entity.Design.Package.MicrosoftDataEntityDesignPackage, Microsoft.Data.Entity.Design.Package, Version 1.0.0.0 ... .)

Uninstalling Jasper CTP and removing and reinstalling the tools doesn't solve the problem. I posted a question about this problem in the ADO.NET Orcas forum.

Microsoft's Jeff Derstadt said in answer to my question:

The Jasper CTP is not supported for VS 2008 Beta 2. The installer included a patch for an earlier VS 2008 CTP where the EDM tools would not work properly. You will likely need to reinstall VS 2008 Beta 2 to remove this patch.

Andy Conrad in a reply to my comment asking if he had tried it said:

Just to be clear - the sample works with Jasper running over Beta 1 of Orcas.  The problem exists when installing Jasper over Entity Framework Beta 2.  We are currently investigating a solution for this.

Uninstalling and reinstalling VS 2008 Beta 2 solved the problem.

I wonder how many folks are running Orcas Beta 1.

[Repeated from the last update to LINQ and Entity Framework Posts for 9/7/2008+ because of its importance.]

Mapping Stored Procedures to the Entity Data Model

Mike Dodaro, the ADO.NET team's programmer-writer, posted How to Map Stored Procedures using the ADO.NET Entity Framework on September 14, 2007. This article shows how to manually modify the SSDL, CSDL and MSL sections of the *.edmx file to accommodate stored procedures for entity data retrieval. His example uses the SalesOrderDetail table of the AdventureWorks Sales Model, which is an Entity Data Model (EDM) implementation based on the AdventureWorks sample database.

Hopefully, Mike will provide more insight into code for populating association/navigation entity properties with stored procedures.

SqlDependency Notifications from LINQ to SQL-Generated Queries

Ryan Dunn, co-author of the The .NET Developers Guide to Directory Services Programming, provides sample code to enable LINQ to SQL to participate with SQL Notification Services in his September 14, 2007 Using SQLDependency objects with LINQ post. His code creates a SQL dependency context, which Ryan says is very similar to a transaction context. Mike Pizzo, who pointed out the approach to Ryan, can probably provide more implementation details.

Update 9/15/2007: Julie Lerman provides more implementation information about the CallContext class in her Query Notifications and LINQ to SQL - Well I'll be, you *can* do it (with caveats) post.

Frans Bouma Continues LINQ to LLBLGen Pro Series

Frans Bouma, the developer of the LLBLGen Pro commercial O/R mapping tool and principal antagonist of LINQ to SQL, has started a project to adapt LINQ to LLBLGen Pro (or vice versa). His first posts are here:

  1. Developing Linq to LLBLGen Pro, Day 0 (September 11, 2007)
  2. Developing Linq to LLBLGen Pro, Day 1 (September 12, 2007)
  3. Developing Linq to LLBLGen Pro, Day 2 (September 14, 2007)
  4. Developing Linq to LLBLGen Pro, day 3 (September 19, 2007)

Thomas Wagner likens Frans' new series to A diary of LINQ pain.

Be sure to read the comments to the first post.

[Continued from LINQ and Entity Framework Posts for 9/7/2008+ ]

Julie Lerman and Entities in Web Pages

Julie's Entities, Viewstate and postback post of September 14, 2007 analyzes binary serialization and deserialization of entities to and from the ViewState object. She notes that managing optimistic concurrency is up to you because, as Mike notes in his LINQ to SQL analysis below, the ...Context object (DataContext or ObjectContext) holds the original values.

She also points to her Serializing entities for updates across web services thread in the ADO.NET Orcas form. The thread contains detailed responses from Danny Simmons that sound remarkably like those from Matt Warren about the corresponding issues with LINQ to SQL.

Mike Taulty Tackles Concurrency Issues with LINQ to SQL and WCF

Mike's Disconnected LINQ to SQL post of September 14, 2007 dissects managing optimistic concurrency with LINQ to SQL. His two code examples assume that LINQ to SQL's DataContext resides in a Windows Communication Foundation (WCF) physical tier that processes create, retrieve, update and delete (CRUD) operations with BasicHttpBinding (SOAP 1.1 transport) to a proxy client. One example does CUD operations with no concurrency checks; the other implements optimistic concurrency with new and original values stored on the server. He provides full SQL Server Profiler traces on the service side.

The LINQ to SQL team promised a sample implementation similar to this some time ago but haven't delivered so far.

Mike cites Rick Strahl's LINQ to SQL and Disconnected Entities Follow-up post of August 15, 2007 as a source of information on managing concurrency with detached entities, that is entities with no associated DataContext. I prefer the term detached, because LINQ to SQL's is a disconnected technology; the DataContext maintains data state between successive connections to SQL Server.

XML Schema Inference Add-In for VB 9.0

The VB Team announced on September 14, 2007 a new schema inference tool add-in for Visual Basic 9.0. The tool is especially important for users of VB's LINQ to XML literal XML feature, because you can add XML schema sets to a project in three ways:

  1. Specify an XML file location
  2. Specify an URL on the web that returns XML
  3. Paste or type an XML document directly

Adding a schema to your XML document enables IntelliSense.

Scott Hanselman gives the add-in a rave review in his same-day Clever: XML To Schema InferenceWizard For Visual Studio 2008 post. For an early look as Microsoft's Schema Inference Engine, see my November 11, 2002 "Generate XSD Schemas by Inference" article for the long-departed XML & Web Services magazine.

Note: I'm still waiting for Ralf Lammel's successor to update LINQ to XSD to the Beta 2 LINQ implementation. Ralf has accepted a full professorship at the University of Koblenz and I wish him the best of luck in his new position. Ralf's last post with a LINQ tie-in was his More than a revision on “MapReduce revisited” of April 11, 2007, which include a C# 3.0, LINQ-style abstraction for MapReduce computations. 

A Compendium of Julie Lerman's Entity Framework Beta 2 Posts

Mike Taulty's Entity Framework Posts item of September 13, 2007 has links to all 13 of Julie Lerman's posts about Entity Framework Beta 2 and EDM Designer August 2007 CTP. Links to these articles also appear in previous OakLeaf posts, but having all links in one place is handy. Mike says her posts are "great stuff" and I agree.

First Appearance of LINQ for Java Clone

Anders Norås introduced Quaere, a.k.a language-integrated queries for Java, on September 10, 2007 at the JavaZone conference in Oslo, Norway, according to his Introducing Quaere - Language integrated queryies for Java post the next day. A snapshot of the source code for Quaere's first implementation, Quaere for Objects, is available as Quaere Snapshot.zip at http://andersnoras.com/files/folders/code/entry281.aspx.

Later posts explain the derivation of Quarere (9/12/2007, the Latin root of the English word query, imperative form of quaerere - to question or ask), Answering questions about Quaere (9/13/2007) and Solving Puzzles with Quaere (9/14/2007). The last post uses Quaere to solve the same puzzle Microsoft's Luke Hoban solved with LINQ in his Using LINQ to solve puzzles post.

Friday, May 11, 2007

Using the Entity Framework with IronPython 1.1 in Project Jasper

Andrew Conrad's A walk through the Jasper API with IronPython - Part 1 post shows you how to get Project Jasper running with IronPython 1.1. I'm far from a Python expert, so I thought I'd give Andrew's step-by-step instructions a test drive. Here's what I did:

Setup

  1. Downloaded Jasper: MIX 2007 CTP release (MicrosoftJasperCTP.msi, 14.0 MB) and installed it on my test machine that runs the prerequisite Orcas Beta 1 and an SQL Express instance with the Northwind sample database installed.
  2. Downloaded the IronPython 1.1 runtime binary from CodePlex (IronPython-1.1-Bin.zip, 973 KB) and expanded it to my \Program Files folder with the Use Folder Names checkbox marked. Installing IronPython 1.1 adds an ...\IronPython-1.1 folder with \Doc, \Lib, and \Tutorial folders.
  3. Ran ipy.exe -X:TabCompletion from a command prompt to open the interactive console. (There's also an ipyw.exe that runs IronPython without a console.)
  4. Changed ipy.exe's default background color to R=222, G=112 and B=8 and text color to R=245, G=222, and B=179 to match my blog colors.

Obtaining a DynamicContext

  1. Typed clr.AddReferenceToFileAndPath("C:\\Program Files\\Microsoft Codename Jasper CTP\\Binaries\\Microsoft.Jasper.CTP.dll") to add the Jasper reference.
  2. Typed the Microsoft.Jasper import * directive.
  3. Typed connString = "Provider='System.Data.SqlClient';Provider Connection String='Initial Catalog=Northwind;Data Source=.\SQLEXPRESS;Integrated Security=SSPI';Generate Default EDM=True" to create the connectionString variable.
  4. Typed nw = DynamicContext.CreateDynamicContext(connString) to create a DynamicContext object for the Northwind sample database. It took about 13 seconds to generate the default Entity Data Model (EDM) for the Northwind tables and associations. This is about half the approximately 30 seconds it took to in Sam Drucker and Shyam Pather's DEV18 - Rapidly Building Data Driven Web Pages with Dynamic ADO.NET MIX07 video (19:17 to 19:47).

Note: All instructions must be entered at the console's >>> prompt as a single line of text. The complete connection string doesn't appear in Andy's post (even in 1280 x 960 resolution) and needs to be changed if you're running SQL Server Express.

At this point, I was ready to exercise the DynamicContext object:

Spelunking the DynamicContext Object

To prove that the ObjectContext's entity sets were collections of the Query type, I typed print type[nw.Products], which returned Query. I then went on to test a few more of Andy's examples. I noticed a brief delay when assigning a new Query collection member to a variable with statements such as product = nw.Products[0] or category = product.Category. Associations are navigable as shown in the last two queries.

Querying with Entity SQL

Entity SQL (eSQL) is the second approach to querying objects exposed by DynamicContext:

If IntelliSense was enabled in the console, as implied in Andy's post, it didn't work for me.

Supporting LINQ in Jasper

LINQ is Jasper's third query technology. Unfortunately, Jasper doesn't support LINQ to Entities currently. In response to a question in the Project Codename: Jasper forum, Carl Perry said the following:

We do support LINQ in this CTP release of Jasper, however only LINQ to Objects is supported.  While we were working on this CTP we did work to have our dynamically generated classes and collections support LINQ;  essentially providing the ability to translate LINQ queries to the backend query language.  This support is available to in the Entity Framework in the form of LINQ to Entities.  Unfortunately, due to limitations in VB.NET 9.0 and Iron Python 1.1, we were unable to support translation of these LINQ queries to appropriate backend query language.  Supporting LINQ in our dynamic languages (VB.NET, Iron Python, Iron Ruby, etc) is extremely important and we are currently working with teams across the company to get this working. [Minor corrections made.]

Andy Conrad further clarifies the LINQ support situation in response to a Jasper forum rant against VB:

I would suggest that folks give VB a chance occasionally. IMHO, particularly with the new features coming on line in VB9 (lambda expressions, LINQ) and beyond (true dynamism) I think VB is becoming a very compelling dynamic language. And based on constantly switching between languages while working on Jasper, between Python, Ruby, and VB – I can’t say I can pick one over the others.

That said, the DLR will initially support four different .NET languages (IronRuby, IronPython, VBX, and managed Javascript) and we are designing the Jasper framework to work in all, so the developer will be free to pick their dynamic language of choice.

A couple of clarifications – Linq is supported by IronPython 2.0 but not IronPython 1.1. Since the initial CTP of Project Jasper is not integrated with the DLR, we only support VB 9 and Iron Python 1.1 – and only the former supports Linq.

Also, Project Jasper CTP is built on top of .NET framework 3.5 Beta 1 (Orcas release). We could have built it over .NET framework 2.0, but we wanted Linq support. As I said before, as on the next CTP release Jasper will be built over the DLR which is targeted as a post Orcas release.

The Project Jasper CTP download includes VB and IronPython 1.1 samples in the \Program Files\Microsoft Code Name Jasper\Samples folder. If you're running Vista, you must move the samples outside the \Program Files folder.

Update 5/12/2007: Andy Conrad's Some comments about comments and other ramblings about Project Jasper post of May 11, 2007 explores developers' unease with frameworks and scaffolding that substitute built-in processes for programmer-authored code. (I find myself a bit uncomfortable not having direct control of the database connection when using DataContext or DynamicContext objects.) However, this perceived lack of developer control certainly hasn't impeded widespread adoption of Ruby on Rails and ActiveRecord for projects similar to those that Jasper appears to target.

Andy links to a secretGeek post that takes Microsoft to task for 1) not recognizing the contributions of others to dynamic languages and the convention over configuration concept (specifically David Heinemeier Hansson, the original developer of Ruby on Rails, and 2) limiting Jasper to SQL Server 2005 databases only.

Credit Where Credit is Due

I don't fault Microsoft for not thanking Hansson by name any more than I'd complain that download pages for SQL Server 2005 don't include "thanks to Dr. E. F. Codd for his contributions to relational database theory and design." (It's clear to me that Blinq was inspired by Ruby on Rails scaffolding, and I inferred this in my June 2006 Generate Data-Based Web Sites With Blinq post and Visual Studio Magazine article about Polita Paulus's original Bling implementation. Blinq was based on LINQ to SQL, not the Entity Data Model.)

RDBMS Xenophobia in Project Jasper and Related Technologies

I do agree with secretGeek and the post's commenters that restricting Jasper to SQL Server is a bad idea, just as bad as—or worse than—doing the same to LINQ to SQL (see my Future LINQ to SQL Support for Multiple Databases? post of April 19, 2007). Microsoft touts the Entity Framework as accommodating databases other than SQL Server 200x if the RDBMS vendor is willing to invest in writing an EntityClient data provider. In a 4/21/2007 update to that post I noted that Microsoft held an on-campus seminar to aid other RDBMS vendors in extending their .NET data providers with EntityClient features. IBM, for one, says it intends to support LINQ, presumably via the Entity Framework.

If Microsoft intends to live up to its commitment that a primary feature of the Entity Framework is "The ability to query relational stores other than the Microsoft SQL Server family of products" it behooves the ADO.NET team to extend this capability to Entity Framework derivatives, such as Jasper and Astoria (which also has an SQL Server 2005 requirement for the toolkit). Microsoft must clarify that the SQL Server 2005-only limitation applies only to the early "incubator project" releases and not to the final release, if there is one. Failing that is "crying wolf"—no developer or RDBMS vendor will believe that the Entity Framework will be RDBMS-agnostic when Microsoft says Katmai will deliver the Entity Data Platform

Update 5/22/2007: Andy's response to my comment in his Some comments about comments and other ramblings about Project Jasper post clarifies that Astoria's and Jasper's SQL Server-only restriction is a temporary expedient to get the samples "out the door." Here's the part of the response relating to database agnosticism:

Jasper being a Sql Server only framework is just a limitation of the first CTP.  If you look at the Jasper download package, we install private copies of System.Data.dll and System.Data.Entity.dll (renamed for the CTP) because we required some Entity Framework functionality not available in the Beta 1 Orcas down load. As a result, because of the ADO.net provider factory design and the fact we didn’t want to mess with config files – we decided to hard code Sql Client as the only provider for the initial CTP. This was a hard decision, but we wanted to get the preview out the door.  And since Sql Express is free – we could at least give folks a chance to play around with Jasper.  In house we actually have had Jasper working over some of the non-Sql Server Entity Framework providers and even over Access and DataSets. Non-Sql Server provider support is very high on our list for CTP2.

Also of note, Katmai (next version of Sql Server) for the Entity Framework is a ship vehicle not a restriction on what providers are supported. Astoria and Jasper are currently very early in the product cycle (still in incubation) but I don’t see any reason why these technologies would only support Sql Server. [Emphasis added.]

Hopefully, Katmai won't be the only ship vehicle for the Entity Framework.

Thursday, May 03, 2007

MIX07 Session Videos with LINQ, EF, or VB[x] Hooks - Part 2

The MIX07 team released this morning an update to yesterday's RSS feed for MIX07 Session Feeds that's the subject of MIX07 Session Videos with LINQ, Entity Framework, or VB[x] Hooks [Part 1].

The video for the Sam Druker and Shyam Pather "Jasper" session is available for viewing or dowload at the following link:

DEV18 - Rapidly Building Data Driven Web Pages with Dynamic ADO.NET

Speakers: Samuel Druker - Microsoft, Shyam Pather - Microsoft Audience: Developer

Come learn about how new technologies from Microsoft bring together the concepts of dynamic languages and ADO.NET and allow you to quickly develop data driven Web pages using ASP.NET dynamic data controls, scalable to even the most complex databases.

Following is the link for Pablo Castro's "Astoria" session video:

XD006 - Accessing Data Services in the Cloud Speaker: Pablo Castro - Microsoft Audiences: Designer, Developer

Come learn about new Microsoft technologies that enable you to make your data available over the Web through a simple REST interface and using open formats such as plain XML, JSON or even RDF. We also discuss the underlying entity framework that makes it easy to model, publish, and program against your data over the Web.

Alex Barnett's Microsoft Codename "Astoria": Data Services for the Web provides a basic description of Astoria and its URI syntax, including its more popular operators. He's also posted an interview with Pablo on YouTube and some pithy quotes from industry luminaries about Astoria. (Alex was working on Astoria when he left Microsoft in 2006.)

And here's the Aaron Dunnington and Tim Scudder session video:

DEV16 - Deep Dive on Data Driven Experiences Speakers: Aaron Dunnington - Microsoft, Tim Scudder - Microsoft Audience: Developer

Come learn how technologies like Silverlight, Language INtegrated Query (LINQ), and SQL Server 2005 can help developers build impactful, dynamic applications that reach the broadest possible audience.

Aaron and Tim have created Socializer, a Silverlight UI that demonstrates:

  • The Silverlight 1.1 Alpha client
  • LINQ to Objects in Silverlight 1.1
  • LINQ to XML in future Silverlight CTPs
  • Semantic Web
  • XML, RDF (FOAF)
  • Data binding, querying, and aggregation
  • A socially-aware rich Internet application (RIA) that includes personal content aggregated from MySpace, de.licio.us, and Flickr.

You can run the Socializer client from this link on the Silverlight Community site (requires installing the Silverlight 1.1 Alpha, which might require a reboot) and download the Socializer source. You also can run the Silverlight Airlines flight booking client that Scott Guthrie demoed during the keynote and download its source code.

I'll add more text and a few screen captures later today.

Monday, April 30, 2007

"Jasper" to Deliver Dynamic ADO.NET 3.0

During Monday morning's MIX07 keynote, Andrew Conrad spilled the beans about the project he's been working on for the past few months: "Project Jasper." Also known as Dynamic ADO.NET, here's the official description of this new data-access technology from Andrew's blog post:

Microsoft Codename “Jasper” is a set of components aimed at fulfilling the need for a rapid and iterative development experience for data. With Jasper, you are able to just point at a database and immediately begin coding against its data using intuitive, domain-specific data classes. No configuration and no source code generation are required. Jasper works with existing application frameworks (including ASP.NET, WinForms, and WPF) and existing, real-world databases.

Jasper provides a programming interface to your data that is well-suited to rapid development. Jasper provides two main services:

  • Data Access: query and update facilities for reading and writing data, exposed via an Object-Relational (O/R) API.
  • Data Binding: presentation of data in controls that form the visual user interface of the application.

And here's a second description from the download page for the MIX07 Community Technical Preview (CTP):

Jasper leverages the power of dynamic languages and the concept of convention over configuration to provide a programming surface for data that enables rapid development of data-bound applications. While most other rapid data access frameworks are only capable of working against simple databases, Jasper can scale to almost any database, regardless of size or complexity. This is possible because Jasper takes advantage of the ADO.NET Entity Framework’s significant investments in mapping and conceptual data modeling. [Emphasis added.]

Jasper's dependence on the ADO.NET Entity Framework (EF) is significant, considering Saturday's announcement that Orcas has dropped the EF from the RTM, after an earlier postponement of the Entity Data Model (EDM) Designer.

According to Andrew:

For CTP release, we are specifically targeting Visual Basic 9 (Orcas version of VB.NET) and Iron Python 1.1. In other words, these are the languages we did a bulk of our testing for the CTP release. The reality is any CLR language that supports late binding can be used with the Jasper framework

I plan to give the MIX07 CTP a workout this week and will add links to reports of my results here.

Update 4/30/2007 14:17 PM: The ADO.NET Team posted Project Codename "Jasper" - Announced at Mix 07 which describes Jasper as an "ADO.NET incubation project for building quick, clean and iterative applications." The post says:

Using “Jasper”, developers start with a connection string and can immediately begin programming the core of an application. “Jasper” uses a set of new technologies to make this happen:

  • Dynamic generation of data classes so there is no configuration or design time code-gen to carry around.
  • Rich query and O/R capabilities because “Jasper” is built on top of the Entity Framework.
  • Auto-binding capabilities for ASP.NET, WinForms, and WPF to make binding data to a UI simple and automatic.

Carl Perry offers additional details about Jasper in his Announcing Project Jasper - A RAD vision for the Entity Framework post.

Shyam Pather adds his interpretation of Jasper and excerpts from the Jasper Technical Overview in Microsoft Codename "Jasper" CTP Released!

Note: Andrew also mentioned that the Dynamic Language Runtime (DLR) will be announced at MIX07.

Update 5/2/2007: The video for the Sam Druker and Shyam Pather "Jasper" presentation is available for viewing or download at the following link:

DEV18 - Rapidly Building Data Driven Web Pages with Dynamic ADO.NET

Speakers: Samuel Druker - Microsoft, Shyam Pather - Microsoft
Audience: Developer

Come learn about how new technologies from Microsoft bring together the concepts of dynamic languages and ADO.NET and allow you to quickly develop data driven Web pages using ASP.NET dynamic data controls, scalable to even the most complex databases.

For more information on the DLR, listen to Jon Udell's podcast: A conversation with John Lam about the dynamic language runtime, Silverlight, and Ruby.

Update 5/5/2007: Andrew Conrad's Jasper and C# post asks "Is Jasper usable from C#?"

The short answer is – We designed Jasper specifically for CLR languages with late-bound facilities such as VB and IronPython.  C# doesn’t currently support late-bound calls and hence the answer would be no though some aspects of Jasper may still be applicable.

He then goes into an explanation of how C# might be used. The real question is "Why would anyone want to use C# in a dynamic, late-bound environment?" Andrew then moots the issue with:

[W]e are actively working on moving Jasper over to the dynamic language runtime - the freshly announced .Net addition to the runtime designed to extent the CLR for dynamic typed CLR languages (VBX, IronPython, IronRuby).  Based on early analysis it is a strong possibility that we move away from the base class mechanism and support a more dynamic model where data class types (or even specific instances!) can be modified at runtime to allow the user to add their own business logic.

Update 5/8/2007: Andrew Conrad reports that Channel 9 has posted a pre-MIX07 interview with the Jasper team:

Project Jasper is geared toward iterative and agile development. You can start interacting with the data in your database without having to create mapping files or define classes. You can build user interfaces by naming controls according to your model without worrying about binding code. In this interview Shyam Pather, Carl Perry, Andrew Conrad and Jeff Derstadt, go deep whiteboarding and demoing Jasper.