Showing posts with label Google Gears. Show all posts
Showing posts with label Google Gears. Show all posts

Tuesday, June 17, 2008

LINQ and Entity Framework Posts for 6/16/2008+

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

Frans Bouma Starts New Features in LINQ to LLBLGen Pro Series

Linq to LLBLGen Pro: feature highlights, part 1 of June 17, 2008 is the first of a series that Frans promises will “sum up some of the characteristic features of Linq to LLBLGen Pro, so you don't have to wade through the 15 articles I wrote about writing Linq to LLBLGen Pro.”

Frans emphasizes that “Linq to LLBLGen Pro is a full implementation of Linq” and delivers a set of questions about the specific LINQ operators and related features a LINQ-enabled O/RM tool should support. These question could well serve as the start of a criteria list for a .NET O/RM comparison table.

Wading through the 15 articles Frans wrote while writing the LINQ implementation is an exceptional opportunity to learn more about implementing LINQ in a .NET O/RM. Here they are:

Surprising Lack of Activity in SQL Server Data Services Forum

My All’s Quiet on the SQL Server Data Services Front post of June 17, 2008 starts with:

I'm surprised at the current lack of relevant threads in the SQL Server Data Services (SSDS) - Getting Started forum, which appears to have commenced operations on May 19, 2008 but garnered its first message on May 29.

And goes on to offer some potential reasons for the apparent lack of interest.

Update 6/17/2008 1530 PDT: SSDS evangelist David Robinson contests my conclusions and says in his Peace & Quiet? post of June 17, 2008:

[W]e are working with companies of all shapes and sizes, from some of the worlds largest banks to small start-ups, customers covering almost every industry imaginable.

He also added this comment to my post.

Added: 6/17/2008

ADO.NET Sync Services Team Posts How-To for Bi-Directional Synchronization

The Extending Visual Studio 2008 SP1 Sync Designer to Support Bi-Directional Synchronization post contains a link to recently-released documentation for enabling bi-directional sync between SQL Server Compact and SQL Server 20085+.

As you can see in this excerpt from the SP1 docs, the amount of code to enable bidi sync for a simple Northwind Customers table isn’t insignificant.

Added: 6/17/2008

LINQ and Related Sessions at CodeStock 2008 In Knoxville, TN

The CodeStock 2008 conference to be held August 9, 2008 at Pellissippi State Technical Community College in Knoxville, TN offer the following LINQ-Related sessions:

The one-day conference has six simultaneous sessions.

I’m surprised that no one’s covering Entity Framework and ADO.NET Data Services.

Thanks to Wally McClure for the heads-up on June 16, 2008.

CIO Magazine Posts Article on LINQ and TechFunk Copies It Verbatim

CIO Magazine’s Five Things the Boss Should Know About Microsoft's LINQ article of June 16, 2008 by John Paul Mueller is a semi-technical paean to the benefits of LINQ that emphasizes database queries.

What makes the story more interesting is the TechFunk blog’s word-for-word reproduction of the article in their Five Things the Boss Should Know About Microsoft's LINQ post of the same date. TechFunk provides no attribution whatsoever to CIO Magazine, for whatever that’s worth.

I’ve never seen a more flagrant case of plagiarism and copyright infringement by a technically-oriented blog.

Update 6/17/2008: Don’t get me wrong; I’m not a copyright bigot. This blog’s content is licensed under the Creative Commons Attribution 3.0 License.

AP is nuts for charging $12.50 for the fifth word quoted from their newsfeed and barring any excerpts if they find “Your use of the licensed Content to be offensive and/or damaging to Publisher’s reputation," as reported in TechDirt’s Associated Press: Fair Use Limits You To Four Words; Five Words Costs $12.50 post of June 17, 2008.

Steve Naughton Starts Database-Based Permissions Series for ASP.NET Dynamic Data

Immediately after finishing his seven-part A DynamicData Attribute Based Permission Solution using User Roles series, Steve has embarked on DynamicData: Database Based Permissions - Part 1, which moves the ASPNETDB users and roles tables on which the permissions were set. The next episode will be “Creating the user interface for setting the database based attributes.”

David Ebbo Explains ASP.NET Dynamic Data’s Associated MetaData Class and Its Future

Dynamic Data uses metadata attributes applied to entity classes or their properties to specify complex data types, format data, add validation rules, and other custom entity and property features. In his Dynamic Data and the Associated Metadata Class post of June 16, 2008, David explains how attribute-based metadata works today and how it might change in future versions.

Marcelo Lopez Ruiz Explains the Importance of ADO.NET Data Services’ InitializeService() Method

Marcelo notes in his So Special - InitializeService in ADO.NET Data Services post of June 16, 2008 that service initialization is a one-time process controlled by an internal static dictionary whose lifetime is that of the AppDomain. Marcelo recommends invoking the InitializeService() method explicitly to set the service’s configuration and error handling options.

Marcelo says his next post will “focus on the configuration object.”

Update 6/17/2008: Marcelo’s Why is my ADO.NET Data Service empty? post answers the question with:

The service configuration allows you to specify what access you want clients to have (by default) on entity sets. You may further restrict access through interceptors, but you can never grant more access than that specified on the configuration. …

By default, the service is completely locked down - all the entity sets have no access rights granted for them, and so the data service looks empty - you can't access any resource at all. That's why folks are sometimes baffled when "everything works", but nothing is accessible. You should implement the InitializeService method and start granting access on a per-entity-set basis, and then you're ready to go.

Craig Shoemaker Shows How to “create wildly different layouts and easily add third-party controls to your Dynamic Data websites”

His Rockstar Dynamic Data Customizations post of June 16, 2008 has links to the following five podcasts:

He also has an Introduction to Dynamic Data screencast and podcast that are subtitled “Get started with ASP.NET Dynamic Data with some practical advice.”

Craig is a “new-media evangelist” for Infragistics, so expect to see some third party controls in the preceding examples.

Serena Yeoh Updates Layered .NET Architecture Sample to .NET 3.5 and LINQ to SQL

Serena (a.k.a. Firedancer), who works for Microsoft Consulting Services, has updated her Layered Architecture Sample for .NET project on CodePlex by replacing the Data Access Application Block (DAAB) with LINQ to SQL, changing Business Entities to LINQ to SQL Entities, and implementing .NET 3.5 Workflow services. She says:

Layered Architecture Sample is created to demonstrate how we can apply some of these .NET technologies with the Layered Architecture design pattern. It is a simple example that illustrates the factoring of responsibilities and separation of concerns into multiple layers in an enterprise application. As the name implies, the main focus of the sample is "How to code the layers?" and not the actual functionality of the chosen Expense application. The Expense Business Process Flow was chosen simply because it is widely used and easiest to understand.

Serena provides additional insight to the project in her Layered.Architecture.Sample.for.NET.3.5 post of May 28, 2008. (Notice the emphasis on layered, not tiered.)

Thanks to Patrick Yong’s Layered Architecture Sample for .NET post of June 16, 2008 for the heads-up.

Off-Topic: Does Google Gears Deserve its Recent Notoriety?

MIX’s Joshua Allen tries to brake the Google Gears hype train stoked by Dare Obasanjo with his Google Gears as the Next Flash post and TechCrunch’s Nik Cubrilovic with Get Ready For A New Platform War. Google Gears Drives Straight At Microsoft’s Profits in his Gears a Profit-Killer? post of June 16, 2008.

Google Gears languished in obscurity until the “demo of a gears-enabled MySpace mail client prototype, shown at Google I/O” by two ex-Microsoft folks, one of whom was Mark Lucovsky, the architect of Hailstorm.

My Google Gears Piques New Interest in Data Synchronization post of June 1, 2007 covered the initial announcement of Google Gears at their 2007 Developer day. It also notes that Scott Hanselman almost swooned over Google Gears in his Google Gears - Maybe all Rich Internet Applications needed was Local Storage and an Offline Mode of May 30, 2008. Scott said, inter alia:

This is a huge move and is quite brilliant. In one seemingly innocuous move (and one tiny 700k (yes, 700K) download) Google is well positioned to get Google Docs, including Writely, Spreadsheet and Presentation, along with who knows what else, enabled for offline use. And the whole thing is Open Sourced via the New BSD License.

A year later, Google Gears implementations are few and far between.

Off-Topic: Migrating from Access/Jet to SQL Server Panel Discussion from Tech*Ed 2008

According to panelist Mary Chipman, “rumors of Access’s death have been greatly exaggerated.” The panel answers the question: Are we there yet? Successfully navigating the bumpy road from Access to SQL Server.

Of course the current Microsoft party line is to substitute SharePoint lists for Access/Jet databases.

Monday, July 02, 2007

Third-Party LINQ Implementations Update

LINQ to SharePoint

As promised, Bart De Smet has released the LINQ to SharePoint 0.2.0.0 Alpha for download from CodePlex with the following features:

  • SpMetal tool for SharePoint list entity creation
  • LINQ query provider for runtime LINQ query-to-CAML translation
  • A set of unit tests
  • Debugger visualizer for LINQ to SharePoint queries
  • Support for both C# 3.0 and VB 9.0

SharePoint Mapping Language

Bart's working on a major update to SpMetal.exe for Alpha version 0.3. He says:

However, there's more than just a new back-end to SpMetal. The cool thing about it is its potential for reuse elsewhere, including the VS 2008 IDE. Over time, the goal is to provide entity creation as easy as dragging and dropping lists from an add-in in Server Explorer to a designer surface. We're not there yet, but an important milestone is under development right now: SPML. Designers are just overlays on top of some source definition, for example a partial class with Windows Forms designer generated code or a resx file or ... In a similar way, SPML is the source-side of a SharePoint list mapping for LINQ to SharePoint. Currently it's very minimalistic, but over time it will get more and more expressiveness to drive the mapping process (e.g. you'll be able to decide which fields to include in the entity mapping and you'll be able to control a few aspects associated with entity updating, another 0.3 feature that's under development right now).

Note: For a recent OakLeaf post on LINQ to SharePoint see LINQ to SharePoint 0.2 Alpha to Meet Major WSS 3.0 Template/Apps Surge.

LINQ to Amazon Refactored

Rob Conery a developer from Kauai and the architect of the open-source Commerce Starter Kit for .NET 2.0 and the Subsonic "no-code" data access layer (DAL) has posted LINQ: How To Use LINQ To Query Just About Anything, in which he describes how he's refactoring Fabrice Marguerie's LINQ to Amazon project to .NET 3.5. Along the way, Rob provides one of the better explanations that I've see on expression trees. The IQueryable interface and expression trees enable LINQ to SQL and third-party LINQ implementations. He also includes a pointer to Paul Kimmel's June 28, 2007 Cigars, Lambda Expressions, and .NET article for DevLife that describes anonymous methods, lambda expressions. closures and currying in plain English.

Rob promises that the source code will be available the end of this week. Check his site or here for availability.

Update 8/8/2007: Rob published on August 2 a great LINQ to SQL screencast as SonicCast 6 - LINQ, LinqToSql, and SubSonic. His demo includes a simple technique to remove data source-related code from the page's code-behind file. He's considering adding support for LINQ to SubSonic or replacing its query generator with LINQ. No word so far on source code for his refactoring of Fabrice Marguerie's LINQ to Amazon to Beta 2.

i4o (Indexing for Objects) Article

Aaaron Erickson has written "Indexed LINQ" for .NET Developer's Journal. Subtitiled "Optimizing the performance of LINQ queries using in-memory indexes," the article covers the theory behind creating indexes on in-memory collections and applying an extension method to the Where() standard query operator to enable speeding queries by up to a factor of 100 or so with the indexes. You can download the source code, runtime binary or both for i4o at http://www.codeplex.com/i4o. (Update 8/7/2007)

Third-Party LINQ Providers List

A complete list of third-party LINQ implementations that I update periodically is: Third-Party LINQ Providers.

Friday, June 01, 2007

Google Gears Piques New Interest in Data Synchronization

Google's announcement of their new Gears browser extension API for enabling offline capabilities in Web apps with these services:

  • LocalServer to cache and serve application resources locally.
  • Database (SQLite) to serve as a searchable local data store with online synchronization capability
  • WorkerPool to enable clients to run resource-intensive operations on a new thread

Google's Choosing an Offline Application Architecture page shows how the client application's UI can switch between the Web server and local database cache as its data source. Running SQLite or any other database in the browser requires write access to the client's file system. Synchronization can be manual, as in the Gears-enabled Google Reader (a button toggles between online and offline mode), or background, which can take advantage of the WorkerPool.

Update 6/2/2007: Tim Anderson's Why Google Gears? Thoughts from Google Developer Day provides an independent overview of Google Gears and notes the importance of synchronization. Tim also mentions full-text search in his SQLite will be everywhere post. According to Michael Cleverly's October 11, 2006 blog entry for D. Richard Hipp's keynote at the 13th Annual Tcl/Tk Conference:

As of SQLite 3.3.8 (released Monday!) full text search support in SQLite. Richard's authorized to announce help from engineers at Google. Later question elicited that roughly half of the FTS code was written by Richard and Dan, the other half by four engineers from Google. He isn't able to/can't comment on their motivations/plans/internal usage. [Minor edits.]

[The blog also notes that Microsoft uses SQLite in the Xbox.]

Google's Database API page states, "Google Gears includes SQLite's full-text search extension fts2."

Scott Hanselman says in his Google Gears - Maybe all Rich Internet Applications needed was Local Storage and an Offline Mode post:

Stunning move by Google today in the Rich Internet Application space. While most of us (myself included) are off debating Flash vs. Silverlight vs. Apollo vs. Whatever, Google introduces Google Gears ... a technology all of the above (or none of the above) can utilize ...

This is a huge move and is quite brilliant. In one seemingly innocuous move (and one tiny 700k (yes, 700K) download) Google is well positioned to get Google Docs, including Writely, Spreadsheet and Presentation, along with who knows what else, enabled for offline use. And the whole thing is Open Sourced via the New BSD License.

Dare Obasanjo quotes Robert Scoble's Google brings developers offline with “Gears”; new offline Reader post, and asks "[W]hat took them so long?", and closes with "Welcome to the future."

Robert says:

Gears supports using Adobe’s Apollo and Flash and should support other technologies including Microsoft’s Silverlight. [Emphasis added.]

But eWeek's Darryl K. Taft clarifies Gears' support for Silverlight in today's "Google Gears Aims to Bolster Adobe Apollo, Others" article:

Meanwhile, Google Gears will work with Microsoft's Silverlight cross-platform, cross-browser tool for building RIAs. Gears hopes to complement Microsoft's Silverlight and other technologies by offering an offline infrastructure that developers can incorporate into any Web application—even those that use plug-ins from other companies, a Google spokesperson said. [Emphasis added.]

However, Microsoft has its own local database cache: SQL Server Compact Edition (SSCE) and Synchronization Services (Sync Services). Orcas Beta 1 includes Sync Services Beta 1 and an early version of the graphical Sync Designer for SSCE 3.5. Sync Services is limited to synchronization between SSCE 3.1 or 3.5 on the client side and SQL Server 200x behind the Web server. Unfortunately, SSCE v3.x doesn't have full-text search capability.

Presumably, it would be possible to install the SSCE bits (1.8 MB) in conjunction with the Silverlight 1.1 runtime (4.2 MB) but you'd also need to install at least the Sync Services client pieces. The entire gears.dll is 852 kB for IE and 700 kB for Firefox. (The SQLite library itself varies in size from 224 to 513 kB, depending on options). However, a more appropriate comparison might include the 2.3 MB for the Flash player and its helper file. Note that the Gears library doesn't include a synchronization service. Developers would need to write their own service, which is no small chore (especially in JavaScript.)

Update 6/6/2007: Dare analyzes Google Gears in his June 5, 2007 Google Gears: Replacing One Problem with Another post and concludes that the missing synchronization component might be a showstopper:

It seems that without providing data synchronization out of the box, Google Gears leaves the most difficult and cumbersome aspect of building a disconnected Web app up to application developers. This may be OK for Google developers using Google Gears since the average Google coder is a Ph.D but the platform isn't terribly useful to Web application developers who want to use it for anything besides a super-sized HTTP cookie.

Collectively, the comments to Dare's post point out that general-purpose synchronization systems aren't easy to get right and that users of the Gears toolkit will need to write their own sync services. One commenter (Sam Sethi) points out that the Remember the Milk online to-do list has added Google Gears synchronization.

Update 6/7/2006: eWeek's Microsoft Watch blogger, Joe Wilcox, posted his Can Microsoft Be the Wrench in Google Gears? article on June 6, 2007. Joe quotes the same paragraph from Date's entry (above), and observes:

Quite possibly, synchronization is the killer app that will determine whether desktop software maintains its relevance or the Web becomes the more popular platform. ... The natural place for synchronization services is as part of the operating system.

Microsoft DevSource's Jeff Cogswell responded to Joe's post in his June 7, 2007 Synchronization: The future of the web? item:

Unfortunately, I think Joe's blog is missing something here, and I'm speaking as a developer. Synchronizing data is never a trivial nor generic task, because how it works and what it does depends on the particular application, and often requires substantial user input, and is heavily tied to file formats and how the data is organized inside the file.

ZDNet Blogger David Berlind posted an audio interview about Google Gears that he conducted on May 30, 2007 with Google director of engineering Linus Upson. Berlind quotes Adobe’s vice president of product management Michele Turner:

[W]e were developing identical technology to facilitate the offline component of the Apollo runtime. ... For example, they’re [Google] using SQLite and we were already incorporating SQLite into Apollo. So, now we’re aligning our efforts with Google on things like the synchronous and asynchronous calls that must be made to the SQLite database in order to enable the offline capability.

Google Gears piqued more interest in data synchronization than I expected.

Recent Microsoft Synchronization Services Updates

My "Update Local Data Caches with Sync Services" article in the May 2007 issue of Visual Studio Magazine carries this deck:

"The Microsoft Synchronization Services 1.0 API for SQL Server 2005 Compact Edition and the new Sync Designer in the Orcas March 2007 CTP team up to generate a local data cache that synchronizes incrementally and bidirectional with SQL Server [Express]."

Sync services and the Sync Designer is the technology behind Occasionally Connected Systems, which--together with the Entity Framework--comprise the Dynamic Development "Pillar of Katmai."

My earlier "Lighten Up Your Local Databases" in the March 2007 Visual Studio Magazine issue covers SQL Server 2005 Compact Edition v3.1 , which is the first version licensed for use in conventional PCs, and v3.5, which is included in Visual Studio codename "Orcas." Microsoft initially called V3.5 "SQL Server Everywhere Edition." V3.5 adds important features, such as timestamp fields to aid synchronization and simplify concurrency conflict detection. SQL Server Mobile Edition v3.0 and earlier were licensed for use by devices and Tablet PCs only.

Microsoft's Rafik Robeal released Demo VII: Tombstone Cleanup and Detecting Stale Offline Clients for the Sync Services runtime. Tombstone cleanup detects and prevents stale clients from synchronizing and tells them to reinitialize their local data cache. A stale offline client is a computer that hasn't synchronized in the last n days, so the client's sync request is rejected.

Rafik has updated the preceding six demos to VS Orcas Beta 1 in his Sync Services Demos Refresh post:

Update 6/6/2007: Rafik just added a Sync Events for Conflict Handling, Progress Reporting, Business Logic … post that describes Sync Services new set of events. Some of the events are implemented in Beta 1, but you'll have to wait for Beta 2 for the others. See my Synchronization Services Runtime Beta 1 for ADO.NET 2.0 Is Available and A Sync Services Bidirectional Test Harness posts for issues with the Beta 1 release.