Showing posts with label Blinq. Show all posts
Showing posts with label Blinq. Show all posts

Saturday, June 14, 2008

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.

Thursday, November 29, 2007

ASP.NET .NET 3.5 Extensions Preview to Include Entity Framework Beta 3, ADO.NET Data Services

Scott Guthrie's .NET Web Product Roadmap (ASP.NET, Silverlight, IIS7) post of November 29, 2007 states that Entity Framework Beta 3 (presumably with EDM Designer CTP 2) and a VS 2008 RTM-compliant preview of ADO.NET Data Services (formerly Project Astoria) will debut next week in conjunction with the newly-named ASP.NET 3.5 Extensions Release. Scott says, in part:

  • ADO.NET Data Services: In parallel with the ASP.NET Extensions release we will also be releasing the ADO.NET Entity Framework.  This provides a new modeling framework that enables developers to define a conceptual model of a database schema that closely aligns to a real world view of the information.  We will also be shipping a new set of data services (codename "Astoria") that make it easy to expose REST based API endpoints from within your ASP.NET applications.

"In parallel with" and "also be shipping" don't necessarily mean "with the other pieces next week." Microsoft representatives wouldn't confirm to me that Entity Framework (EF) Beta 3, EDM Designer CTP 2, and the ADO.NET Data Services will release next week. I'll update this post when the actual release data is public.

Update 12/7/2007: Microsoft released EF Beta 3 and EDM Designer CTP 2 on 12/6/2007, as reported in Entity Framework Beta 3 Available for Download of that date. Still no word on the Astoria release date other than "almost here." See the "ADO.NET Data  Services CTP1 'Almost Here' with LINQ to Astoria, New Wire Formats, and Increased Security" topic in LINQ and Entity Framework Posts for 12/3/2007+.

Note: Joe Wilcox says "'Astoria' will be included in next week's ASP.NET 3.5 Extensions preview release. Astoria is Microsoft's incubation project for exposing data as a service" in his Microsoft Updates Web Developer Roadmap post of November 29, 2007.

As "Something to watch," Joe adds:

Microsoft's data model emphasis, which is more than just about rich Internet applications delivery. The emphasis directionally reveals something about Microsoft's forthcoming Web services platform. Data-driven may not be a new concept, but Microsoft is positioning for a leap frog over competitors. That's topic for another post. :)

Other Elements of the ASP.NET .NET 3.5 Extensions Preview

Scott's post also states that the extensions release will include:

  • ASP.NET MVC: This model view controller (MVC) framework for ASP.NET provides a structured model that enables a clear separation of concerns within web applications, and makes it easier to unit test your code and support a TDD workflow.  It also helps provide more control over the URLs you publish in your applications, and more control over the HTML that is emitted from them.  You can learn more about it from Part 1 of my ASP.NET MVC Tutorial series.  I'm hoping to find time this weekend to write and post Part 2 of the series. [Read more about the MVC Framework here.]
  • ASP.NET AJAX Improvements: New ASP.NET AJAX features in the ASP.NET 3.5 Extensions release will include better browser history support (back/forward button integration, and server-side history management support via a new <asp:history> server control), improved AJAX content linking support with permalinks, and additional JavaScript library improvements.
  • ASP.NET Dynamic Data Support: The ASP.NET 3.5 Extensions release will deliver new features that enable faster creation of data driven web sites.  It provides a rich scaffolding framework, and enables rapid data driven site development using both ASP.NET WebForms and ASP.NET MVC.
  • ASP.NET Silverlight Support: With the ASP.NET 3.5 Extensions release we'll deliver support for easily integrating Silverlight within your ASP.NET applications.  Included will be new controls that make it easy to integrate Silverlight video/media and interactive content within your sites.

Update 11/30/2007: Rick Strahl's What's Ailing ASP.NET Web Forms essay provides the view of the current state of ASP.NET and a look at the future of ASP.NET MVC. It's written by an independent Web developer with many years of ASP and ASP.NET experience.

ASP.NET Dynamic Data Support

"Dynamic Data Support" sounds to me like Rob Conery's open-source SubSonic data access layer and Web page generator that I described in my SubSonic will be the "Convention-Driven Toolset for Microsoft’s New MVC Framework" for ASP.NET post of November 11, 2007 (updated 11/13, 11/18, and 11/29/2007.)

Rob's working at Microsoft (but living on Kaua'i) and still maintaining his Weke Road personal blog. My post's "SubSonic's Continuing Open-Source Status" section described Rob's and Microsoft's commitment to continuing development of SubSonic as an open-source project.

The "Moving Forward with .NET 3.5" topic of Rob's State Of SubSonic, November 2007 post of November 28, 2007 says:

We’re shelving the query tool update that we’ve been planning. In fact we’re shelving any further feature change/innovation in favor of moving forward with .NET 3.5.

There are soooo many language enhancements to .NET 3.5 that we have a chance to refactor and trim our feature set really nicely. For instance, our entire Sugar library can be redone as extension methods - which is what they should be.

In addition, as many know, we have a lot of love coming for the new MVC framework.

It doesn’t make sense to rev two branched versions of SubSonic that run on a different platform, so the next major version will be a version rev to 3.0, and will work on .NET 3.5 only.

This doesn’t mean we won’t support/fix/tweak/patch 2.0 - we’ll always try to make it better. But in terms of features, it’s pretty much set.

With regard to incorporating LINQ in the query tool and meshing with the MVC Framework, the "New Features for [SubSonic] 3.0" topic says:

Eric and I have been talking a lot about the query tool and how to make it work with LINQ. I think we have a nice scheme planned, so expect to see a new query tool as we’ve discussed in the past.

We’re going to throw all kinds of love at the new MVC toolset. All Kinds. It’ll be magic. And we’ll cook up some nice reference apps for you to play with. More on that later (when I figure out just what features I’ll be working on in the MVC toolset.

Judging from this post, if Dynamic Data Support is based on SubSonic and the preview arrives next week, it would probably be an unmodified or slightly modified version of SubSonic 2.0. When the bits arrive next week, I'll update this and the 11/11/2007 post.

Silverlight 1.1 Becomes Silverlight 2.0

According to Scott, the next public Silverlight preview will include major upgrades to the WPF UI framework, add a "rich set of controls," including a DataGrid, provide REST, POX, RSS, and WS-* (plus, presumably ATOM Pub), and include LINQ to XML support. The number and significance of new features warrants a full version upgrade, so Silverlight 1.1 will become Silverlight 2.0.

Microsoft plans a Silverlight 2.0 beta version for 2008Q1 with a GoLive license. VS 2008 Express Edition users will be glad to hear that the Silverlight toolset for VS 2008 will work with the free editions. (VS 2008 Professional Edition is required for the just-released Silverlight 1.1 tools.)

Sunday, November 11, 2007

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

Not the Entity Framework, not LINQ to SQL, but (gasp!!!) open-source SubSonic will deliver the default data abstraction and persistence layer and scaffolding for the forthcoming Model-View-Controller (MVC) add-on to ASP.NET 3.5. SubSonic's creator, Rob Conery, will start work at Microsoft next Monday, November 12, 2007, to assist with integration chores and evangelize ASP.NET developers. I missed Rob's October 26, 2007 Microsoft, SubSonic, and Me post, which announced that he was going to work for Shawn Burke, one of Scott Guthrie's direct reports in the Developer Division.

Updated 11/13/2007 and 11/18/2007: See below.

Scott announced the MVC add-on in his ASP.NET MVC Framework post of October 14, 2007. The MVC pattern for connecting the UI (View) to  business logic (Controller) and data (Model) originated in Smalltalk projects more than 30 years ago. Scott says the following about the advantages of the MVC pattern:

One of the benefits of using a MVC methodology is that it helps enforce a clean separation of concerns between the models, views and controllers within an application.  Maintaining a clean separation of concerns makes the testing of applications much easier, since the contract between different application components are more clearly defined and articulated. [Link added.]

The MVC pattern can also help enable red/green test driven development (TDD) - where you implement automated unit tests, which define and verify the requirements of new code, first before you actually write the code itself.

However Scott's post didn't mention how ASP.NET's MVC Framework will implement the persistence layer for the Model's business objects. In a comment, Scott says only that:

The ASP.NET MVC framework will work with any data provider.  LINQ to SQL and LINQ to Entities are both definitely fully supported (my sample at the alt.net conference was actually done with LINQ to SQL).

Update 11/13/2007: Scott Guthrie provides a very detailed demonstration and tutorial for the upcoming MVC Framework in his ASP.NET MVC Framework (Part 1) post of 11/13/2007 (3:45 AM!) LINQ to SQL provides the data access and persistence layers. I estimate the length of Scott's post to be at least 15 feet.

The problem with LINQ to SQL in a Test-Driven Development (TDD) environment is the difficulty of mocking persistent objects with in-memory objects. That's because there's no memory-based DataContext object you can easily substitute for the DataContext that's bound to the SQL Server 200x instance. The "mini connectionless DataContext" that was promised but not delivered for multi-tier use of LINQ to SQL might have served this purpose. (See the "Emulating the Phantom Mini Connectionless DataContext" section of my LINQ to SQL Has No "Out-of-the-Box Multi-Tier Story!" from October 18.)

Note: Ian Cooper says:

LINQ to SQL is usable with a TDD/DDD approach to development. Indeed the ability to swap between LINQ to Objects and LINQ to SQL promises to make much more of the code easily testable via unit tests than before. [Emphasis added.]

The preceding is quoted from Ian Cooper Takes on DDD, TDD and PI with LINQ to SQL of June 11, 2007. Ian's Being Ignorant with LINQ to SQL post of June 10, 2007, provides sample code for swapping tests of LINQ entity retrieval queries, but data retrieval is only a small part of the DataContext's feature set.

Update 11/13/2007: Frans Bouma added a comment about difficulties with mocking LINQ to SQL, particulary when you use GroupJoin.

An additional impediment with LINQ to SQL as an MVC data provider is that it's connected at the hip to SQL Server 200x and Compact Edition (SSCE), and Microsoft has no plans to extend it's reach to competitive RDBMSs. Oracle and IBM are working on EntityClient data providers for the Entity Data Model (EDM), but no one knows when Entity Framework (EF) or the alternative providers will be ready for prime time. It's equally uncertain whether mocking the EDM's heavier weight ObjectContext will be practical.

SubSonic, Scaffolding, LINQ, Migrations and the MVC Pattern

SubSonic is an open-source data abstraction layer (DAL), object/relational-mapping (O/RM) tool, and scaffolding environment that's provided under a commerce-friendly Mozilla Public License (MPL) Version 1.1. Its Scaffold server control requires only a single instruction, such as

<cc1:Scaffold ID="Customers1" runat="server" TableName="Customers"></cc1:Scaffold> 

to autogenerate fully operational GridView and details view pages for a site. Jon Galloway's October 30, 2006 Microsoft should ship SubSonic (formerly called ActionPack) with Atlas post offers a detailed review of SubSonic's capabilities by an expert third party.

SubSonic's default scaffolding closely resembles that of the ASP.NET Team's now-abandoned Blinq project and it's DAL shares "convention over configuration" terminology with Ruby on Rails (RoR) and Project Jasper, which appeared to have fallen into a black hole but now just seems to be in limbo.

Rob's SubSonic: Migrate Me post of October 3, 2007 says SubSonic will incorporate migrations (also a RoR feature) "as part of our next major release, which will also include our REST Handler and our new query tool - so it will be a few months until we can get this all tightened up." According to Rob, his "job will be to build out SubSonic as the 'sweetness' on top of ASP.NET and (more notably) the new MVC platform. SubSonic will be the convention-driven toolset for Microsoft’s new MVC framework." Presumably, this means Rob will be working full-time on the "next major release."

The new query tool presumably will substitute strongly typed, compiler-checked constructs, such as the following from Jon Galloway's post:

Query qry = new Query(Product.Table);
qry.Top = "10";
qry.OrderBy = OrderBy.Desc(Product.Columns.UnitPrice);

for the string column names in the current version. SubSonic's new query syntax appears sufficiently similar to LINQ as to make practical substitution of LINQ to SQL's expression tree for SubSonic's query processor. Limiting the persistence database to SQL Server won't please the vast majority of developers.

In his LINQ: How To Use LINQ To Query Just About Anything post of July 2, 2007, Rob says:

Recently I have been asked by a client to use LINQ for some interesting stuff (which I’ll blog about later), and one of the things I needed to do was to use it to query a REST service. Step 1 was to query Amazon (since there is an existing sample out there on how to do this), and I just wrapped up that part of it and thought I would share with you how I dove nose-first into refactoring the existing sample to work with .NET 3.5, and also some of the neat stuff I learned along the way.

Since Rob has been working for Shawn Burke's ASP.NET team "(on contract) for the past 8 months or so," it's probably a safe assumption that "a client" in the preceding quote is Microsoft. Although Rob says in the same post, "I have no plans with SubSonic and LINQ," it's reasonable to expect a definitive "LINQ to SubSonic" implementation in in the "next major release."

SubSonic shares the ActiveRecord model with RoR. Migrations are a shortened RoR term for ActiveRecordMigrations, which manage versioning of the project's underlying database schema. SubSonic's "next major release" undoubtedly will add the SubSonic MVC App template to My Templates, as shown in the video described in Rob's SubSonic: MVC Preview Video post of November 5, 2007. The eight-minute Silverlight segment includes previews of:

  • Migrations
  • MVC scaffold generation
  • Core site design (upgrades)

but no narrative on the audio track.

Rob's also tasked with "creating webcasts and writing up tutorials for MVC/ASP/SubSonic." I enjoyed the music behind the preview video, but conventional narration is probably the better approach as new SubSonic's RTM approaches.

SubSonic's Continuing Open-Source Status

Both Rob and Shawn emphasize that SubSonic will remain an open-source project under the MPL 1.1 license. Rob says:

I think it’s worth pointing out that SubSonic hasn’t been “bought”. Some might smell a conspiracy here, but I’ll leave that to the X-Files and Cap’n Crunch crowd to drum up all the evil reasons why the mothership has “beamed me up”. SubSonic will remain under the same MPL 1.1 license it always has, and will remain as completely Open Source as it always has - nothing will change at all. I’m just getting paid, essentially, to work on it :).

and Shawn goes on with:

To be clear Microsoft did NOT buy, annex, co-opt, or otherwise take over SubSonic.  SubSonic is still what it is, and a big part of Rob's job is going to be to make sure it continues to grow and provide a great platform for building data-centric apps.  Rob still has complete authority over SubSonic, it's his baby.  He'll also be pitching in to help find ways to deliver value for ASP.NET in general.

Jon Galloway explains:

[SubSonic]'s licensed under the Mozilla Public License, which is pretty simple - you can use, redistribute, and even sell software using MPL'd code, but if you modify the MPL'd code you have to publish your changes.

So it seems practical to me for the ASP.NET team to package SubSonic's "next major version" with the ASP.NET MVC Framework, as Jon recommended more than a year ago.

P.S. Rob won't be leaving Kaua'i, as he mentions in a comment. "[B]ut it’s only by virtue of the fact that there’s a dev center in Honolulu, that I’ll be flying to Redmond often, and that I wouldn’t mention it on my blog … oops."

Update 11/18/2007: Hamilton Verissimo, aka hammett, founder of the Castle Project wrote a MS MVC and the MVC Team post on November 18, 2007 about his trip to Redmond to review progress on the ASP.NET MVC Framework. Hammett concluded:

Right now, though, for folks with lot of expectations, the CTP might be a turn off. That’s because what you’re going to see is a very small framework, with a lot to be done to be useful. As they say, the CTP is mainly for feedback. I’m sure Milestone 2 would be something great, though.

And what happens to MonoRail? - you may ask. I’m not sure. I was really adamant that they should try to support all things that MonoRail support, but I’m not sure they are going for that. MonoRail 2.0 is pending their implementation. If the final MS MVC rocks, and provides so many things, I’d vote for forget the MR 2. If the final MS MVC has clearly something lacking, MR 2 could reuse the infrastructure and provide some nice extensions.

 

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.

Thursday, August 03, 2006

Reports from the Lang.NET 2006 Symposium

As mentioned in this earlier OakLeaf post, the Lang.NET 2006 Programming Languages and Compilers Symposium was held on July 31 through August 2, 2006 at the Microsoft Redmond campus. The organizers describe the symposium as a "forum for discussion on programming languages, managed execution environments, compilers, multi-language libraries, and integrated development environments. The event followed July's O'Reilly Open Source Convention (OSCON) in Portland, Oregon. Jason Bock's .NET Languages blog delivers a blow-by-blow account of each day's presentations. According to Jason, the symposium attracted about 80 attendees. Following are links to Jason's pages with presenter names and abbreviated topics: Monday, July 31, 2006

Bryan Tyler also covered Day 1 on the Lycangeek blog, as did Werner Moise (Spec#). Tuesday, August 1, 2006 *Note: Jason mentions that Paul Vick "began with the Linus Torvalds quote that's going around these days about his view on VB." See the full quotation in the later "Linus Torvalds on Visual Basic" section. Bryan Tyler covered Day 2, also. Wednesday, August 2, 2006 Werner Moise adds more about F#, Don Syme, and the Research Pipeline. Note: The preceding lists differ slightly from the original symposium agenda and speaker list. Linus Torvalds on Visual Basic Linus Torvalds recently responded to Jaroslaw Rzeszotko's question, "What do you think will be the next big thing in computer programming? X-oriented programming, Y-language, quantum computers, what?" question:

I don’t think we’ll see a "big jump". We’ve seen a lot of tools to help make all the everyday drudgery easier - with high-level languages and perhaps the integration of simple databases into the language being the main ones. But most of the buzz-words have been of pretty limited use.

For example, I personally believe that Visual Basic did more for programming than "Object-Oriented Languages" did. Yet people laugh at VB and say it’s a bad language, and they’ve been talking about OO languages for decades. And no, Visual Basic wasn’t a great language, but I think the easy DB interfaces in VB were fundamentally more important than object orientation is, for example. So I think there will be a lot of incremental improvements, and the hardware improvements will make programming easier, but I don’t expect any huge productivity help or revolutions in how people do things. At least not until you start approaching real AI, and I don’t think real AI is going to be anything you will ever "program."

Technorati Tags: , ,, , , , , , , , , , , , , , , ,

Sunday, July 09, 2006

Wufoo Challenges InfoPath for Form-Based Web Data Entry

Wufoo is a new form-based data-entry application for collecting and tracking data via the Web. A unique feature of the application is the ease with which the forms you design can be embedded in an IFrame of a Web page or blog entry by copying the IFrame's HTML from a window that opens when you click the Code link (below) to your page. (Click the image to display the full-size version.)

You also can invite individuals to fill out the form by creating a list of email recipients:

As an example, the following simple form collects new customer information in fields similar to those for the Northwind sample database's Customers table. The form validates fields marked with a red asterisk as required. Controls with missing required values turn red when the user tries to submit the form. (The extra space at the bottom of the form accommodates the depth added by error messages.)

Note: While writing this post, the Wufoo server died temporarily; however, the site appears to have been reliable for the past few days. TechCrunch's Marshall Kirkpatrick had a similar 404 experience but gave Wufoo high marks for usability.

When the user complete the entries and clicks Submit, Wufoo acknowledges the submission with a message box. If you're using a free account, which limits you to three forms, you're then hit with barrage of Wufoo advertising pages. If you mark the E-Mail New Entries checkbox and supply an e-mail address, you recieve a UTF-8 e-mail message similar to that below for each entry.

Users can enter and edit data at the Wufoo site with a form similar to that shown here, which includes a Yahoo! map mashup for the location specified in the Address control. If you want to restrict data entry to designated users, you must have a paid Wufoo account. The free account enables everyone or just the administrative user to enter or edit form data.

The Wufoo design canvas lets you choose from a variety of controls, as shown here for the New Customer form. Special-purpose controls—such as Date, Time, Phone, Address, and Website—appear to be unique to Wufoo and a few competitors' forms. You can rearrange the vertical sequence of controls by dragging, but a control occupies the entire width of the form, regardless of the width of its text box or other widget.

You also can create a basic report based on the "dataset" for form entries. Reports that involve numeric values can display basic bar and pie charts. The Report Manager lets you export reports to local files in Excel or CSV format.

Wufoo has four levels of paid services ranging from US$9 for 500 entries to US$199 for unlimited entries per month. Paid plans also provide access to customer support, the capability to upload files together with form data, an option to redirect to a designated URL after submission, and password protection of forms and reports.

Caution: Wufoo invokes a severe penalty—more akin to a fine—if you don't pay upfront for a sufficient number of form entries per month. Wufoo charges a fee of $0.05 per entry ($50.00/M) for exceeding the number of entries allowed by the plan. The ordinary cost per thousand entries (CPM) ranges from $4.60 for the $69/month to $18.00 for the $9/month plan.

Competiton from InfoPath 2007 and Access 2007

InfoPath provides very sophisticated data validation and verification features but isn't easily or cheaply adapted to hosted systems for extranets or the Internet. You can add InfoPath 2007 form rendering capability to Web pages by the techniques described in MSDN's "Hosting the InfoPath 2007 Form Editing Environment in a Custom Web Form" technical paper. However, you'll need InfoPath Forms Services running on the Web server, which requires a license for either Microsoft Office SharePoint Server (MOSS) 2007 or Office Forms Server (MOFS) 2007. (MOSS and MOFS provide InfoPath Forms Services to render the form in a browser with the XmlFormView control.) You also need to program the XmlFormView control to handle data transfer, which isn't a walk in the park. The InfoPath 2007 client is integrated into the Outlook 2007 e-mail environment. Wufoo doesn't require software licenses but submission costs can become substantial for a large organization unless you opt for the unlimited $199.00/month option.

Note: InfoJetSoft offers InfoJet Service—a .NET class library that enables publishing InfoPath 2003 SP1 forms to Web sites for user data entry in IE 6.0 or Firefox. InfoJet Server is an ASP.NET Web application that delivers InfoPath forms to users for data entry, local storage, or e-mail transmission. InfoJet EditPart is a set of Web Parts for SharePoint data entry. The license fees for InfoJet Service is $500 for 10 forms (XSNs), $1,500 for 50 forms, and $5,000 for an unlimited number of forms. There's no charge for submissions.

Microsoft Access 2007 offers an Outlook 2007-based e-mail data-entry system that uses HTML or InfoPath 2007 forms to automatically add to or edit tables of an Access 2007 (.accdb) or SQL Server 2005 [Express] database, or a SharePoint list. Users can complete HTML forms in any forms-enabled e-mail application but HTML e-mail must be enabled, which some organizations prohibit. Filling out InfoPath forms requires the InfoPath 2007 client application to be installed on the user's computer. You must send update or insert forms to specific users for completion. Outlook 2007 is required to export the returned form's data to Access 2007, so Microsoft Office 2007 Professional Edition will be required for HTML forms and Professional Plus Edition for InfoPath forms.

AJAXian and Other Web Competitors

The online forms business—if this crowded category can truly be called a business—got a lift in early 2006 from AJAX technologies. Recent AJAXian entrants include:

  • Formspring offers substantially lower pricing ($50.00/month for unlimited responses) but fewer features than Wufoo.
  • Form Assembly's Formbuilder has a $9.00 per month charge for unlimited responses. Formbuilder has posted a preview of a new version that offers predefined fields, more than one control per line, and table layout.
  • JotForm, a script.aculo.us-based free (at least for now) form generator that lets you edit the form's HTML and CSS, as well as paste it to a Web page.
  • Theblueform is a combinaton Web form and workflow (approval) designer.
  • Sidewalk delivers a basic form-generation and response-storage service for $3.00 per month.
  • Wyanet's WyaCracker offers free processing and features similar to JotForm, plus reports in RSS, XML, or HTML format, but the site's garish UI is likely to put off most users.
  • Starterbase is a forms-based startup that offers a $49.99 per year unlimited forms and users account with CSV data import and export, Excel import, and XML export. Free accounts allow five applications and public access or three designated users.

Note: My March, 2006 "Dabble DB: The New Look in Web Databases" post describes many of the Web-based data-entry services that compete with Wufoo: DabbleDB, QuickBase, eUnify DB, Caspio Express DB, eCriteria, HTML DB, Google Base, Lazybase and Zoho Creator. The June 27, 2006 "Generate Data-Based Web Sites With Blinq" post describes a preview version of a forthcoming ASP.NET 3.0 tool for Visual Studio "Orcas" that generates in less than a minute a complete data-entry and reporting Web site for multiple relational tables in SQL Server 2005 [Express] databases.

Please leave a comment if I've missed any recently-released AJAXian form builders.

Conclusion

I agree with Marshall Kirkpatrick, Derek Punsalan, Jason Bagley, and others that Wufoo does Web data-entry forms right. Users can create and test their own custom form much more quickly than a corresponding InfoPath form, and the data is far more accessible to most information workers as an Excel or CSV file than an XML document or Access 2007 table. However, the Wufoo folks should rethink the draconian monthly fine for users who exceed their payment plan's maximum entries.

Wufoo might consider a more enterprise-scale name for their service ... but who anticipated that a company named Google would end up with a greater market cap than General Motors?

[Updated 7/11/2006 and 7/12/2006]

Technorati Tags: , , , , , , , , , , , , , , , , , , , , , , , , , ,

Tuesday, June 27, 2006

Generate Data-Based Web Sites With Blinq

Blinq 1.0 is Microsoft's prototype of an extension to LINQ to SQL (formerly DLinq) that auto-generates a complete data-entry and editing ASP.NET 2.0 Web site by executing a simple command-line statement.

The "Generate Data-Based Web Sites With Blinq" article from FTPOnline's ASPNET Channel and the .NETInsight newsletter describes how to obtain the necessary LINQ May 2006 CTP and Blinq 1.0 prerequisites and then autogenerate a 25-page site in less than a minute.

Blinq 1.0 is a much more sophisticated site-generation implementation than Ruby on Rails' scaffolding feature. For example, Blinq 1.0 uses ASP.NET 2.0's SiteMap and Menu server controls to provide single-click, site-wide navigation. Editing takes full advantage of DetailsView and paged GridView server controls. Blinq 1.0 also supports editing tables with composite primary keys, such as the Northwind database's Order Details table; Ruby on Rails scaffolding doesn't support composite keys.

The downloadable sample code requires the Northwind sample database running on SQL Server 2005 or SQL Express. The article also includes instructions for modifing the generated source code to repurpose the homepage and adjust the master page layout to reduce whitespace on all pages.

See the earlier "2006 Lang .NET Symposium to Expose Blinq for ASP.NET" OakLeaf post for more background on Microsoft's Blink 1.0 protoype Web-site generator. Click here for links to all FTPOnline channels.

Click here to read the June 27, 2006 issue of .NETInsight, which includes the final session lineup for VSLive! New York to be held September 10 to 13, 2006. Sessions feature data access from Microsoft's new "Data Dude" to LINQ to SQL. Other topics include ASP.NET data binding, C# methods, VB.NET, and testing. Technorati Tags: , , , , , , , , ,

Monday, June 19, 2006

ADO.NET 3.0 Entity Framework Docs Redux

Subsequent to Tech•Ed 2006's DAT304, "Next Generation Data Access in .NET Applications with ADO.NET vNext," presentation by the ADO.NET team's Pablo Castro, these two documents about ADO.NET vNext and the Entity Framework reemerged on June 17, 2006 from 404 oblivion:

Both had disappeared the day after their initial publication on May 10, 2006, as I noted in my "ADO.NET 3.0 Entity Framework Ephemera" post. Thanks to Erwyn Van Der Meer, Steve Eichert, and Fabrice Marguerie for reporting their reappearance. All three LINQ bloggers have posted comments about or analyses of these documents, which cover (per Fabrice):
  • The Entity Data Model
  • Entity SQL (eSQL)
  • LINQ to Entities
  • LINQ to DataSets
  • LINQ to SQL (previously DLinq)
According to Erwyn's recollection of the originals, which I didn't see, there was no mention of LINQ, DLinq, or XLinq. The reincarnated white papers now pay lip-service to LINQ. Here's Pablo Castro's description of his TechEd presentation:
ADO.NET 1.0 presented a break-through in data-access technologies with explicit support for disconnected scenarios and a lightweight, high-performance provider model. In ADO.NET 2.0, the API was extended to enable more scenarios, perform faster and scale better. In this session we discuss what comes next. The next version of ADO.NET has both evolutionary aspects and serious innovations in it; from language-integrated query (LINQ) to object services to mapping, ADO.NET will bring simplification and great expression power to the Microsoft data platform enabling construction of sophisticated business applications and tools with less effort and more functionality.

Kent Tegels' blog post about Dave Campbell's DAT101 presentation, "Microsoft's Data Platform Vision," indicate it was at least as vague as its description:

Are you trying to anticipate upcoming trends shaping the industry? What are the secrets to success for the next decade in data management? In this session, Dave Campbell details Microsoft's data platform vision, as well as provides a clear roadmap to help you meet the demands created by the next data explosion and the next generation of data-driven applications.

However, Pablo Castro did demonstrate DLinq.

Luca Bolognese, LINQ's lead program manager, delivered DEV215, "Visual Studio: The .NET Language Integrated Query Framework Overview" with this description:

Modern applications operate on data in several different forms: Relational tables, XML documents, and in-memory objects. Each of these domains can have profound differences in semantics, data types, and capabilities, and much of the complexity in today's applications is the result of these mismatches. The Orcas release of Visual Studio aims to unify the programming models through language integrated query (LINQ) capabilities in C# and Visual Basic, a strongly typed data access framework, and an innovative API for manipulating and querying XML.

It's encouraging to see the ASP.NET team adopting LINQ technology in their Blinq prototype for "scaffolding" complete Web sites from the metadata of an SQL Server [Express] database. Technorati Tags: , , , , , , , , , , , , , ,

2006 Lang .NET Symposium to Expose Blinq for ASP.NET

Blinq—the prototype of a new Microsoft LINQ-based tool for autogenerating data-intensive ASP.NET Websites—will be one of the topics covered at Microsoft's 2006 Lang .NET Programming Languages And Compilers Symposium to be held on the Redmond campus July 31 to August 2, 2006. According to Polita Paulus—the developer of ASP.NET 2.0's GridView, DetailsView and FormView controls who's presenting a paper on Blinq at Lang .NET:

Blinq is a tool for generating ASP.NET websites for displaying, creating, and manipulating data based on database schema. Just point Blinq at a SQL database and it will create a website with pages that display sorted and paged data, allow you to update or delete records, create new records, and follow relationships between tables in your database. You don't need to write SQL queries to use Blinq; LINQ will generate optimized queries for you that request just the data you want to show. Blinq uses the May LINQ Community Tech Preview to access data. The code Blinq creates is simple and easy to customize to fit your needs.

Polita announced the availability of the Blinq 1.0 code download, which "prototypes functionality we are building into our next version of ASP.NET," in a June 15, 2006 "Building a data website? Try Blinq!" post in the ASP.NET forum. You can get more details on Blinq at the ASP.NET site's Sandbox project's forum and download the code here. Polita also has started a new Blinq Preview Forum for support and feedback.

The following screen capture shows the default home page for a Blinq 1.0 Website autogenerated from the Northwind sample database with minor customizing edits applied to the DefaultStyles.css stylesheet (click the image to display the full-size version).

Each table generates TableName.aspx, TableNameDetails.aspx, and NewTableName.aspx files. The Menu control to the left has buttons that open a DetailsView to insert a new record in the table. The screen capture below shows NewCustomer.aspx with data for a new Customers record.

Clicking a menu button opens a GridView for the selected table. The Customers.aspx page below displays the added BOGUS customer record.

Stay tuned Click here for a link to a forthcoming new technical article about Blinq from FTPOnline's .NETInsight newsletter.

More About 2006 Lang .NET Microsoft's Thottam Sriram is the conference chair and Erik Meijer is the program chair for 2006 Lang .NET, which immediately follows OSCON (the O'Reilly Open Source Convention) that's scheduled for July 24 to 28 in Portland, OR. (Note that the tentative dates in my May 17 update to the "Erik Meijer Promotes LINQ at Expo-C 2006" post have changed from August 1 to 3 to Monday, July 31, to Wednesday, August 1, 2006.)

Thottam is the "new program manager who will be owning Reflection, Reflection Emit, CodeDom, etc." A list of OakLeaf blog posts about Erik Meijer, which include links to his other recent LINQ presentatrions, is here. Of course LINQ is one of the Symposium's "areas of interest."

Noted LINQ luminaries presenting .NET 3.0 and Orcas papers are Anders Hejlsberg, "Language Integrated Query (LINQ) and C# 3.0" and Paul Vick, "Visual Basic: Where are we going, where have we been?"

Other highlights are Mike Barnett's "Spec#: Why Every Language Should (Will) Have Contracts" presentation, Gary Flake's "How I Learned to Stop Worrying and Love the Imminent Internet Singularity", and John Gough from the Queensland University of Technology "Dealing with Ruby on the CLR."

Technorati Tags: , , , , , , , ,