skip to main | skip to sidebar
Showing posts with label ASP.NET. Show all posts
Showing posts with label ASP.NET. 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.

Wednesday, June 04, 2008

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

Tech•Ed Special: Daily posts during Tech•Ed Developers 2008 and possibly thereafter will be updated top-down during the day

Updated 6/4/2008 for new content and comment added by Frans Bouma about O/RM Persistence Ignorance. See Updated tags below.

Updated 6/5/2005: Kathy Kam missing URL, link to SharePoint Extensions, Data Dude blog post about IBM DB2, and Sync Framework 1.0 CTP2 added.

Kathy Kam: Silverlight 2 Beta 2’s Base Class Library will Include LINQ to JSON and Support ADO.NET Data Services

Kathy says in her Silverlight 2 Beta 2 will be available later this week post of June 3, 2008:

    • Rich Base Class Library: Beta 2 includes improved threading abilities, LINQ-to-JSON, ADO.NET Data Services support, better support for SOAP, and various other improvements to make networking and data handling easier.

The only LINQ to JSON implementation that I’m aware of is Jason Newton-King’s API that I covered in the “James Newton-King Publishes LINQ to JSON Beta” topic of LINQ and Entity Framework Posts for 2/11/2008+. Here are links to Jason’s announcement post and Json.NET’s CodePlex library.

Support for ADO.NET Data Services (a.k.a. Astoria) is a very welcome feature, because it implies support for SQL Server Data Services (SSDS) when the SSDS team conforms their protocol to Astoria’s. This is just one more arrow in Astoria’s quiver.

(Thanks to Tim Anderson for the heads-up.)

Added: 6/4/2008 Updated 6/5/2008: Added missing URL

Tim Anderson Finds It Strange that Gates Didn’t Mention Live Mesh in His Keynote

I do, too, but for a different reason. Tim’s Missing from Bill Gates Tech Ed keynote: Live Mesh post of June 4, 2008 concludes:

Gates gave a nod to cloud computing as the future … but that was it, it was on to fun robotics. I found this a surprising omission. As I see it, Mesh + Silverlight (plus of course things like SSDS) forms Microsoft’s cloud computing development platform. However, I imagine that like modelling vs software factories this is a matter of debate within the company as well as outside; perhaps we are seeing the Gates view vs the Ozzie view here.

However, inclusion of SQL Server Data Services in the Trey Research demo indicates to me that BillG isn’t averse to cloud computing, per se. I have the feeling that it’s Web 2.0’s “social computing” element and Live Mesh’s consumerish tenor that he doesn’t like. Bill and Melinda’s fortune was made on business, not consumer, software.

Here’s a link to the keynote transcript.

Added: 6/4/2008

Data Platform Group Delivers the Details of the Trey Research Keynote Demo

In its 'Beyond Heroes' - Behind the scenes with SQL Server 2008 at TechEd 2008 post of June 4, 2008, the DP Group provides a detailed, illustrated description of the scenario that the Trey Research demo during Bill Gates’ kenote was intended to convey. According to this post, the blog post’s text was uploaded to SQL Server Data Services (SSDS) and the image was synced from the cellphone to SSDS in an operation similar to syncing contact data demonstrated at MIX 08.

Here’s one of the images from the Windows Communication Foundation (WCF) demo.

Zach Owens, the demo’s architect, provides more detailed info about the concept in his TechEd 2008 Developers - Data Platform Keynote Demo Architecture post of June 3, 2008.

Behind the scenes of the Trey Research demo (from Johnny Halife’s Tech Ed North America 2008 from the trenches post of June 5, 2008:

Added: 6/4/2008  Updated: 6/5/2008

Mike Taulty Writes QueryInterceptor() and ChangeInterceptor() Code for Authorization of ADO.NET Data Services Actions

In his Authorising with ADO.NET Data Services post of June 3, 2008, Mike tackles ADO.NET Data Services (Astoria) authorization methods with VS 2008 SP1’s new QueryInterceptor() and ChangeInterceptor() methods. His earlier Authenticating with ADO.NET Data Services post uses .NET Fx 3.5’s Client Applications Services to provide Forms authentication.

At the end, Mike runs into a corner:

So far, I've not found any place to centralise this [authorisation] code and hook into the dispatch mechanism that Data Services is using. You might think that it's better to hook into the underlying WCF infrastructure but I suspect that gets a little tricky given that Data Services can accept both batched and non-batched requests which means you'd have to presumably do quite a lot of work at the WCF level just to figure out what the operation and entity sets are whereas Data Services is already doing this work for both batch and non-batched operations.

So...at the time of writing, I'm still searching for something here. All clues gratefully received :-)

Added: 6/3/2008 1:00 PM PDT

Dave Campbell Demos SQL Server Data Services and Entity Framework During Gates Keynotes

Dave’s demo uses Microsoft Sync Framework as a hub to replicate data between WPF, Web and mobile apps and includes examples of geotagged text and the GEOMETRY, GEOLOGY, and FILESTREAM datatypes. The demo wasn’t clear as to what data was replicated to SQL Server Data Services (SSDS); SSDS doesn’t support these new datatypes, so I assume that the text of a simulated blog post was synced.

Here’s the timeline:

  • 00:56:15 Start of SQL Server content
  • 00:58:30 Start of SQL Server Data Services (SSDS) content
  • 00:59:32 Start of Entity Framework and Entity Data Model content for “rich WPF app”
  • 01:06:30 End of SQL Server content

Watch the keynote at Tech•Ed Online:Tech·Ed NA Developers Keynote delivered by Bill Gates

Added: 6/3/2008 11:00 AM PDT

Bart De Smet Announces Update to Parallel Extensions (Parallel Fx)

Bart’s Parallel Extensions to .NET Framework 3.5 June 2008 CTP post of June 2, 2008 lists the following improvements in the June CTP:

  • Improved notion of task hierarchies in the TPL
  • PLINQ now runs on top of the TPL
  • Revised ordering preservation design for PLINQ (AsOrdered)
  • The new LINQ-style Zip operator
  • Coordination Data Structures (CDS) with 10 publicly available types already, including lock-free collection types

You can download the CTP here.

Added: 6/3/2008 10:00 AM PDT

Julie Lerman to Spray Graffiti on Web Pages at Tech*Ed Developer 2008

Repeated from 6/2/2008: According to her TechEd Ask The Experts: Website Graffiti? Silverlight 2.0 Annotation at the Vista booth post of June 1, 2008, Julie will

be doing a fun Ask the Experts session at the Windows Vista booth Windows Vista at TechEd Developer 2008 “Ask the Experts” Website Graffiti?  Drawing and Annotation with Silverlight on Tuesday June 3rd 1:00-2:00

Julie's How hard could it be to get to TechED? post of June 2 illustrates the joys of today's airline travel. She caught a 6 o'clock flight to Orlando Tuesday morning. Read her The "body clock" I didn't know I had post at 5:15 EDT today from Burlington airport.

Don't miss Julie's session!

Domain and Pattern All-Stars to Lead Data Programmability Team toward Persistence Ignorance Trophy

Danny Simmons' DP Advisory Council post of June 2, 2008 announces that the DP Team has hired the following famous folks to create a new Advisory Council:

Notice that there is not one member of the nHibernate Mafia in the bunch.

Hopefully, the Advisory Council will prevent a repetition of the PI and Entity Framework (削除) fiasco (削除ここまで) controversy of early 2007 et seq, as reported in Persistence Ignorance Is Bliss, but Is It Missing from the Entity Framework?

Note: Steve is a member of a Tech•Ed panel discussing a topic dear to my heart: Are we there yet? Successfully navigating the bumpy road from Access to SQL Server. Unfortunately, it’s at the same time as Julie’s “Graffiti” presentation.

Update 6/4/2008: Be sure to read Frans Bouma’s eloquent comment about whether PI is necessary or even achievable.

Check out Mike Taulty, Daniel Moth, and Udi Dahan Tech-Talk Video Interviews at Tech•Ed 2008 Developer Online

Microsoft UK .NET evangelists Mike Taulty and Daniel Moth take on “the top features of Visual Studio & .NET Framework 3.5” and Paul Foster interviews .NET architect Udi Dahan about Udi’s open-source nServiceBus as the first two of a series of Tech-Talks from Tech•Ed Developers 2008.

Data Programmability Team Announces Distributed Cache for ASP.NET at Tech*Ed

According to Anil Nori’s Announcing Project Codename "Velocity" post of June 2, 2008:

Today, Microsoft is announcing the first CTP of a distributed caching product to provide the .NET application platform support for developing highly performant, scalable, and highly available applications. The project code named “Velocity” is a distributed cache that allows any type of data (CLR object, XML document, or binary data) to be cached. “Velocity” fuses large numbers of cache nodes in a cluster into a single unified cache and provides transparent access to cache items from any client connected to the cluster. The Data Platform Developer Center at http://msdn.microsoft.com/data and the Velocity Team Blog at http://blogs.msdn.com/velocity provides additional information about project code named “Velocity” as well as links to download our first CTP.

Update 6/5/2008: The Velocity Team blog has additional details about Velocity CTP1.

Silverlight 2 Beta 2, VSTS Database Edition Support for IBM DB2, and New VS 2008 SharePoint Extensions Announced in Gates Keynote 

“Soma” Somasegar’s June 3, 2008 On stage at the TechEd 2008 keynote post announces:

  • Silverlight 2 beta 2 – This is going to be available later in the week with a commercial Go Live license. Silverlight 2 beta 2 will be used to power the unprecedented online experience NBC Universal is creating for the 2008 Beijing Olympics. To help developers take full advantage of Silverlight, we are also making available Expression Blend 2.5 June 2008 Preview and Microsoft Silverlight Tools Beta 2 for Visual Studio 2008.
  • Working with IBM, we will further simplify application development for enterprise teams working in heterogeneous environments. IBM and Microsoft have agreed to work together to integrate IBM DB2 database access with Visual Studio Team System Database Edition. Update: Gert Draper has a brief blog post (DataDude Goes Multi-Platform) about the demo and relationship with IBM’s DB2 group.
  • Visual Studio 2008 extensions for Windows SharePoint Services 3.0 v1.2 – this allows developers to use Visual Studio 2008 to extend the value of Windows SharePoint Services and Microsoft Office SharePoint Server by providing a simplified development environment. Update: You can download the code and documentation here. LINQ and Entity Framework Posts for 6/5/2008+ has more details about the extensions,
  • Latest CTP of the Microsoft Sync Framework - a comprehensive synchronization platform that enables collaboration and offline scenarios for applications, services and devices. A CTP of the Microsoft Sync Framework for Windows Mobile is now available as is full support for the FeedSync open protocol format. Update: Microsoft Sync Framework v1.0 CTP2 released 3/6/3008 is the latest CTP and the Windows Mobile CTP is expected in 2008Q3.

Links to these topics will be added when available.

Update 6/5/2008: Link to SharePoint Extensions, Data Dude blog post, and Sync Framework 1.0 CTP2 added.

Diego Vega Reports That the Entity Framework Sample Provider Has Been Updated for SP1

Diego’s June 3, 2008 Entity Framework Sample Provider Updated for SP1 Beta post’s name says it all. If you’re working on an Entity Framework-enabled ADO.NET data provider, you can download the bits for the Sample Provider from this Code Gallery page.

Added: 6/3/2008 2:00 PM PDT

Matthieu Mezil Explains How Entity Framework’s ObjectContext.ApplyPropertyChanges() Method Works

The ObjectContext.ApplyPropertyChanges() is a mystery to many Entity Framework developers and its current documentation isn’t very clear.

Apply property changes let’s you save changes made to an entity that’s been detached, modified, and then attached to an ObjectContext, such as would occur by invoking a Web service. Matthieu points out that you have two choices for using ApplyPropertyChanges():

    • You use optimistic mode. You keep from the DB the entity with the same EntityKey (using TryGetObjectByKey for example), to be sure that the entity is loaded on the context. Then, you call ApplyPropertyChanges with modified property.
    • You do not use optimistic mode. Remember that the optimitic mode is done per property. You need to use ConcurrencyMode=fixed on EDM for each property to verify before SaveChanges. In this case, you need to keep a copy of your original entity, attach the copy to the context and then call ApplyPropertyChanges.

Added: 6/3/2008 2:00 PM PDT

LinqMaster Compares Filtering a File List by Date with C# 2.0 and LINQ

His How to Use LINQ to Filter a List of Files by Date post of June 3, 2008 demonstrates how LINQ can reduce the number of lines of code required for a typical file system list function.

Added: 6/3/2008 12:15 AM PDT

Rob Conery Produces One-Hour Screencast with Jeremy Miller about Dependency Injection for the ASP.NET MVC Storefront

Rob started his Dependency Injection (DI) adventure with Microsoft’s Unity Application Block but decided to go with Jeremy Miller’s StructureMap DI framework instead. His MVC Storefront: Dependency Injection post of June 2, 2008 provides the basic details but the earlier MVC Storefront: Best Episode Yet Is On It's Way Monday (5/30/2008) sheds more light on the topic.

Most previous episodes in Rob’s ASP.NET MVC Storefront screencasts have run about 20 minutes, but this one lasts 57 minutes.

Added: 6/3/2008 11:55 AM PDT

Scott Tucker Liked My “Manipulate Data in the Cloud” Article but Not the Title

Scott’s Is Astoria (ADO.NET Data Services) going to be the answer to cloud computer? post of June 3, 2008 says, in part:

I just read an article on VS Magazine titled Manipulate Data in the Cloud with ADO.NET. After reading I realized that article simply covers Data Services and REST implementation etc but doesn’t really show anything remotely related to cloud. I guess the author forgot the cloud in a cloud :)

Don’t get me wrong I liked the article but don’t agree with the title.  Sometimes I feel I am the only one pulling my hair looking at some of the new stuff being thrown in by Microsoft.

I replied in a comment:

All you need to do to put your data in the cloud with ADO.NET Data Sources (Astoria) is to move it to the other side of the firewall and add authentication and authorization code. The plan is for Astoria to be the on-premises version of SQL Server Data Services.

The “Live Mesh and LINQ to Mesh Updates” topic of my LINQ and Entity Framework Posts for 5/1/2008+ post explains the forthcoming connections between Astoria, SQL Server Data Services and Live Mesh in the “SSDS and Live Mesh” subtopic.

Added: 6/3/2008 11:30 AM PDT

Sunday, May 04, 2008

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

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

Streaming LINQ Shows Potential for Complex Event Processing

Marc Adler's On Entitlements, Coral8 CCL, SQL, and LINQ post of May 4, 2008 describes difficulties he encountered in when porting an T-SQL query with two inner and two outer joins to Coral8's Continuous Computation Language (CCL) for a financial analysis project. He was able to implement the LINQ equivalent of his T-SQL query in about 10 minutes. His conclusion:

LINQ has a lot of goodness to it. LINQ is pervasive, and all flavors of LINQ are being developed. I can very well imagine that Microsoft is looking at versions of LINQ that could handle streaming data. Right now, I think that it would be fairly easy to hook up LINQ queries in a pipeline that would handle simple queries on streaming data. Adding streaming SQL constructs is very doable.

If Microsoft was to come out with a Streaming LINQ that is available as part of .NET, how would this affect the world of CEP? An immediate casualty might be NEsper.* ... But, longer term, I think that a combination of WCF, Streaming LINQ, and a version of Microsoft Analysis Services that was further geared to real-time streams would be a killer to the rest of the CEP industry.

* NEsper is an Open Source ESP/CEP Engine for .NET. ESP is an abbreviation for Event Stream Processing, which encompasses Complex Event Processing (CEP).

Marc is the technical lead for a CEP project at a major Wall Street investment bank. Entitlements in this post's context refers to persons entitled to view CEP results, not Social Security or Medicare.

In a comment to the post, Jon Riecke, Lead Platform Architect for Aleri, Inc., a CEP software vendor, mentioned that the upcoming 3.0 release of the Aleri Streaming Platform will base its pattern-matching facilities on LINQ syntax.

To find out more about CEP, tune into the Complex Event Processing Blog and Marco on CEP.

P.S. Bart De Smet just posted the final episode of his C# 3.0 Pattern Matching Series: The Return of the Pattern Matcher - Sample Code Available

Added: 5/4/2008 12:30 PDT

Andrew Matthews Updates LINQ to RDF v0.6 to VS 2008

From the How Did I Miss This Department: Andrew (a.k.a. the Wandering Glitch) released LINQ to RDF v0.6 on April 5, 2008. His Announcing LinqToRdf v0.6 post of the same date lists these improvements:]

  • LinqToRdf Designer and VS.NET 2008 extension completely rewritten
  • LinqToRdf Installer now includes the installer of LinqToRdf Designer (at no extra cost)
  • Project and Item templates now installed as part of LinqToRdf Designer
  • Generated object and data properties now get their own EntitySet or EntityRef.
  • Generates LINQ to SQL-style DataContext objects to hide query creation. Much Cleaner.

You can download LINQ to RDF v0.6 from GoogleCode.

Note: I probably missed this because there's no obvious RSS/Atom feed for the Wandering Glitch blog, only a Twitter feed.

Added: 5/4/2008 12:30 PDT

This Nine-Minute Video Gets You Up and Running with the Google App Engine

I received my Invitation to Try Google App Engine on Friday but didn't have time to try deploying my Google App Engine (GAE) SDK desktop test project until today. Fortunately, I found this 09:15 clip by a fast-talking Google Python guru on YouTube.

The clip covers building a simple UI with a Django template that stores messages in the data store and retrieves text messages by author with a GQL query. The segment on deploying the app to GAE starts at about 08:25.

Note: GoogleDevelopers has 122 videos about Google Web services, et al., including the Campfire One release presentation. If you're new to Python and like video tutorials, ShowMeDo is the place to start. Joscha Feth's Google App Engine & eclipse (PyDev) post has fully illustrated instructions for getting code completion with Eclipse, PyDev, and the GAE working.

As time permits, I plan to determine whether GAE is a contender for "data store in the cloud" status and a viable competitor to SQL Server Data Services.

Added: 5/4/2008 12:30 PDT

Colin Meek: Composing LINQ to Entities Predicates

In his LINQ to Entities: Combining Predicates post of May 2, 2008, Colin offers three choices to compensate for LINQ's lack of an Or operator when composing predicates:

  1. Chain Unions instead of Where clauses, which is inefficient.
  2. Build the predicate by hand with ParameterExpression and Expression statements, which is a pain.
  3. Write a utility function called Compose() to implement LINQ to Entities-friendly And and Or builder methods by leveraging the ParameterRebinder implementation of Matt Warren's Expression Visitor from his IQuerable Providers series.

Interesting approach.

Added: 5/3/2008 11:45 PDT

Live Mesh and LINQ to Mesh Updates

Live Mesh Blog and Forum

The Live Mesh Blog has a detailed Behind Live Mesh: How we run cloud services post of April 30, 2008 by dev lead Alex Mallet.

Early Live Mesh adopters don't seem to have found the Live Mesh Forum. It had only 145 users as of May 3, 2008 10:00 PDT.

LINQ to Mesh (From Ori Amiga's Channel9 Video)

The Mesh Operating Environment (MOE) SDK currently has Silverlight, Javascript and desktop C# libraries. (The SDK also supports IronPython, as Ori demonstrated, but not VB.) Unfortunately, the Mesh team won't say when the SDK might be available, other than vague references to PDC 2008.

Here's the sample code for a LINQ to Mesh query against a Mesh object that Ori didn't attempt to execute because of a bug found earlier (~50:00):

Mesh mesh = Mesh.Load(new Uri(@"https://preview/mesh.com"), 
        new NetworkCredential("someone@somewhere.com", "Basic", myCred))

var meshQuery = from meshObject in mesh.CreateQuery<CoreObject>()
        where meshObject.Title == "title"
        orderby meshObject.Title
        select meshObject;

According to Ori at ~51:00, "the query processor can figure out three things:

  1. Which part of the query can execute most efficiently in our back-end storage using fine-grained indices in the cloud and execute that query as close to the data as possible.
  2. In our Mesh Operating Environment, we can keep on processing and linking and querying over that data to answer the question you're asking in the LINQ query.
  3. And you can query over the data in your local machine."

SSDS and Live Mesh

Jamie Thomson's SSDS and Mesh post of May 1, 2008 proposes using Live Mesh to sync SSDS data, perhaps even between two Authorities. Here's the story on potential SSDS and Live Mesh interop:

  • Pablo Castro and the Astoria team are working on a sync model for "Astoria Offline."
  • The SSDS team said they "will support the full EDM/EF/ADO.Net V3 model in due time."
  • Nigel Ellis demonstrated in his Introducing SQL Server Data Services session at MIX08 using the Sync Framework to synchronize vCard contact data between Microsoft Access 2007 and SSDS v1.
  • Francois Ajenstadt, director of project management for SQL Server, said "The goal is to bring the API's between SSDS and Astoria closer together closer to Release."
  • Ari Amiga says the Mesh team has been "working a lot with the Astoria team to make sure that our query syntax is the same, our URL syntax is the same, so it all looks nice and beautiful."
  • Astoria now uses, Mesh supports and SSDS will support the Atom Publication Protocol (AtomPub).

Added: 5/3/2008 10:30 PDT

ADO.NET Data Services Article in Visual Studio Magazine

My "Manipulate Data in the Cloud with ADO.NET [Data Services]" is the cover story for Visual Studio Magazine's May 2008 issue. Here's the deck:

ADO.NET Data Services (formerly code-named "Project Astoria") delivers data from relational tables and Windows Live services to Web mashups and Visual Studio 2008 projects, including ASP.NET AJAX and Silverlight 2.0 rich Internet applications, as Representational State Transfer (REST) resources over HTTP in response to URI-based requests or LINQ to REST queries.

Mesh Connection: At about 50:00 into the Ori Amiga: Programming the Mesh Channel 9 video segment of April 24, 2008 Ori mentions that the Mesh team is working with the Astoria folks to make sure their query and URL syntaxes are the same.

Related Topics: John Udell suggests taking advantage of Astoria's record-level URL addressability to implement loosely-coupled collaborative list-making in his Stonewall Farm, Darby Brook Farm, and the collaborative curation of data post of May 2, 2008. Because of its flexible entity feature (ad-hoc addition of attributes to an entity) SQL Server Data Services might be even a better choice when the SSDS team enables offering public read-only access to a container.

Moved: 5/3/2008 to Manipulate Data in the Cloud with ADO.NET [Data Services] due to length.

Kevin Hoffman Releases Continuous LINQ (CLINQ) v.1.1

According to Kevin's CLINQ v1.1.0.0 Released! post of May 2, 2008, CLINQ 1.1 now includes:

  • Support for Continuous Aggregation. Now, in addition to being able to have your result sets automatically update themselves in response to changes in the source set as well as changes to items in the source set, you can have aggregate scalar values that continuously update in the same fashion. The following is a list of the supported aggregation types that can now be done continuously:
    • Average
    • Min
    • Max
    • Sum
    • Standard Deviation
    • Count
  • Brand new demo application. This demo application not only shows off the power of continuous queries and WPF data binding, but also shows you how to use continuous aggregates, create your own continuous aggregates, and how to databind a WPF GUI to a continuous aggregate value.
His post has a screen shot of the Stock Monitor demo application in action.

Added: 5/2/2008 10:30 PDT

Jeff Currier Wants Questions to Address in SSDS Best Practices Tech*Ed Session

Jeff says in his Speaking at TechEd post of May 1, 2008:

I'm heading down to Orlando in a couple of weeks to give a talk about best practices when it comes to SSDS.  I'm working on my talk outline and was curious if there were any topics in particular that the community wanted to hear about in the talk?

I've posted my topics in a comment.

Jeff's session is "Best Practices in Building Applications with Microsoft SQL Server Data Services," which has the following description:

This interactive session provides a hands-on roadmap for developing and managing applications that use Microsoft SQL Server Data Services (SSDS), details best coding practices, and answers questions related to using on-demand storage services for business solutions.

This appears to be the sole SSDS session at Tech*Ed 2008.

Added: 5/2/2008 10:00 PDT

Popularity of SaaS/PaaS and Web Services/SOA Gain 1% Over 2006 According to McKinsey/Sandhill Survey

This 19-page Enterprise Software Customer Survey 2008 report by consultants McKinsey & Co. and Sandhill Partners finds that:

Innovation in the software industry is on the upswing, with Software as a Service (SaaS) being a key driver. The SaaS model is becoming mainstream and this has led to the rise of a new generation of SaaS platforms (also referred to in the industry as Platform as a Service – PaaS).

The distribution of 857 responses to "Please select the most important trend impacting your business" are shown in the following table for 2006 and 2008:

Most Important Trend, Percent 2006 2008
SaaS/SaaS or PaaS Platform 30 31
Web Services/Service Oriented Architecture 24 25
Open Source 10 8
Offshoring/Globalization 15 13
Software Industry Consolidation 17 7
Others 4 16

A detailed analysis of SaaS/PaaS platforms, which include "cloud computing" starts on page 5. Page 6 concludes:

The momentum toward adoption of SaaS platforms is surprising. Nearly three-quarters of the companies surveyed prefer to adopt platforms in at least one of the three archetypes we identify here.

For platform vendors, the only falloff in interest comes at the largest enterprises, those employing more than 25,000 people. In short, nearly every company – or division of a larger enterprise – is a customer or a prospect for SaaS platforms.

Exhibits on pages 6 - 9 provide additional details on interest in various models SaaS/PaaS models.

BEA's Understanding the Cloud Computing/SaaS/PaaS markets: a Map of the Players in the Industry post of May 2, 2008 by Peter Laird and Kent Dickson has clear definitions of cloud computing, SaaS, PaaS, and Core Cloud Services, as well as a map and list of major players with links to their sites.

Added: 5/2/2008 11:30 PST

SSDS Finally Provisioning Private Beta Users at a Faster Pace

KellyAlt says in Onboarding early beta customers of May 2, 2008:

Over the past 4 weeks, we have been onboarding customers slowly.  Since the response to our restricted beta invitation was quite overwhelming, quite a few of you will experience some delays in getting an account.  The SSDS team is doing everything possible to get you onboarded as soon as possible.  I am happy to say that I am seeing the pace pick up a bit over the last week.

I've been working with SSDS for about three weeks and have written a WinForm test harness to give SSDS v1 a thorough workout. Here's the UI when using the REST protocol to upload a Northwind Employee entity with a base64Binary-encoded bitmap:

Watch for my "Test-Drive SQL Server Data Services" feature article coming in the July 2008 issue of Visual Studio Magazine, which will include complete C# source code for the test harness.

Added: 5/2/2008 08:30 PDT

Ryan Dunn Interviews Tudor Toma and Soumitra Sangupta About the Business Value of SSDS

In Channel9's Tudor Toma and Soumitra Sengupta: SQL Server Data Services Business Value segment of May 1, 2008 (28:19):

Ryan sits down and talks with the Group Program Manager Tudor Toma and Architect Soumitra Sengupta about the business value of SSDS.

Added: 5/1/2008 17:00 PDT

David DeWinter Adapts T4 Templates to Generate T-SQL Stored Procedure Scripts for Entity Data Models

The Text Template Transformation Toolkit (commonly called T4) is a free Microsoft code generation engine for VS 2005 and later that supports their Domain Specific Languages and Software Factories toolkits. The Hilton Giesenow and Oleg Sych blogs have posts about T4.

David's Entity Framework Stored Procedure Generation post of April 26, 2008 describes the template:

The T4 template we created is designed to be a general purpose way to generate CUD procedures for an Entity Framework model. ...

The template not only generates EF-compliant sprocs, but it also considers only the tables that are in the SSDL of the model file. Unfortunately, the template must query the database (SQL Server 2005 only!) in order to make all the decisions necessary to create the output file. However, this is usually quite fast on generations other than the first one.

The template would have been a big time saver when I wrote 40+ stored procedures for my forthcoming book's test project.

Added: 5/1/2008 13:40 PDT

Rick Strahl Posts LINQ to SQL and WCF JSON/REST Samples from His ASP.NET Connections Presentations

Rick's ASP.NET Connections Slides and Samples Posted item of May 1, 2008 provides links to sample code and PowerPoint slides from his three presentations at the ASP.NET Connections conference in Orlando. Following are Rick's abstracts of the sessions:

Building a LINQ to SQL Business Layer for ASP.NET Applications

LINQ to SQL - although completely object based, is still little more than a sophisticated data access layer and so a business object layer is still needed to abstract business logic and provide common functionality that every business related entity requires. The business layer provides a few high level abstractions to the CRUD layer as well as a host of low level features that allow better control for low level data access in case LINQ to SQL queries are ill suited for queries and operations that cannot be performed with LINQ to SQL at all.

This session and its sample code is the culmination of Rick's extensive writing about LINQ to SQL in enterprise-grade projects.

WCF 3.5 JSON and REST Services

WCF 3.5's AJAX support has been made nearly as easy and comprehensive as ASMX functionality and there are many options of how data can be accessed over HTTP now with official protocol support for the webHttpBinding. This session starts of with examples of pure REST URLS and demonstrates features like URL templating, different response formats (wrapped, bare, XML, JSON) as well as the various different options for serving in this fashion. There are also examples of serving up raw data such as images or HTML content out of the REST based API. The remainder of the session focuses on AJAX functionality and explores different ways that WCF services can be called.

If you're interested in ADO.NET Data Objects, which support WCF JSON and REST protocols, don't miss this session.

Ajax Alternatives: Using jQuery with ASP.NET

Off-topic for this blog, but very interesting if you're into AJAX.

Note: Slides are the last file in the ZIP containers.

Frans Bouma Adds LINQ to SQL Refactoring and ASP.NET Dynamic Data Support to LLBLGen Pro

LLBLGen Pro has its own native LINQ implementation, but Frans announces in his Linq to Sql support added to LLBLGen Pro post of May 1, 2008 that latest version (2.6 beta) of LLBLGen Pro includes templates for generating LINQ to SQL classes and mapping (*.dbml) files.

This means you can use LLBLGen Pro's code generator to update your LINQ to SQL data model from SQL Server metadata automatically. Microsoft's LINQ to SQL implementation requires manually updating the data model for schema changes. (ADO.NET Entity Framework's Model Browser has an Update Model from Database context menu command.)

Frans says, "The only downside is that you can't update your model in the Linq to Sql designer anymore. But, why would you?"

LLBLGen Pro ASP.NET Dynamic Data Support

Frans' Dynamic Data and 3rd party o/r mappers is a fact post of May 1, 2008 describes how he convinced Scott Guthrie to open ASP.NET Dynamic Data products to third-party object/relational mapping (O/RM) tools, which in turn enables substituting LLBLGen Pro for LINQ to SQL or Entity Framework.

Steele Price Finds LINQ to SQL Frustrating

In his Some of my frustrations with Linq to Sql post of May 1, 2008, Steel Price complains about:

  • Duplication of the "one" object of a many:one association (such as a Customer for a new Order) with the InsertOnSubmit() method if the entity has both an ID field and association.
  • Lack of a method of assuring that deletions precede insertions with multiple updates to the DataContext.
  • Loading an Association does not automatically set the ID if that field is also in the map.

These are legitimate issues that the LINQ to SQL team should fix in VS 2008 SP1.

LINQ to SQLite Accepted as a Google Summer of Code Project

Kevin Kubasik, who wrote a fledgling LINQ to SQLite provider, reports in his Mono GSOC Projects: Linq to SQLite post of May 1, 2008 that he "noticed that one of the accepted proposals for the Mono project is to create a LINQ provider for SQLite."

This project appears to be related to the "Linq to SQL for open source databases" topic of Mono's Student Projects page and is listed in Current Projects on Google Code's Mono Project page.

An Open Source Project for a SQLMetal.exe and SQL Server Compact Edition 3.5 UI

LINQ to SQL's graphic designer doesn't support SQL Server Compact Edition (SSCE) 3.5, so you must use the SQLMetal.exe command-line tool to create LINQ to SQL classes for *.sdf database files.

J. Torres has started a open source project on CodePlex to create a front end for SQLMetal.exe that's compatible with SSCE 3.5.

However, it's a good bet that SSCE 3.5 support will be included in VS 2008 SP1, so the project might have a short shelf life.

Derek Whittaker Explains How to Group LINQ to SQL Sequences on Multiple Columns

Derek explains in his Multi-Column Grouping with Linq2Sql post of April 30, 2008 how to write the LINQ to SQL equivalent of the following T-SQL query.

SELECT COUNT(*) AS Count, 
 cs.SendID, 
 cs.Name AS SendName, 
 cts.ListID, 
 cts.ListName, 
 ctom.EmailAddress 
FROM CampaignTrackingOpenedMail AS ctom 
 INNER JOIN CampaignTrackingSummary AS cts 
 ON ctom.CampaignTrackingSummaryID = cts.[ID] 
 INNER JOIN CampaignSend AS cs 
 ON cts.SendID = cs.SendID 
GROUP BY cs.SendID, 
 cs.Name, 
 cts.ListID, 
 cts.ListName, 
 ctom.EmailAddress 

The translation isn't obvious.

Alex James Starts a Fantasy Football Project with Entity Framework as the Data Source

Back in late March, Alex published his Statement of Intent:

I'm going to start creating 'real world' applications using the Entity Framework, and I'm going to blog about all the tradeoffs I make, the hoops I have to jump through, the gotcha's I encounter, the workarounds, the design considerations etc.

In Real world App - Part 1 - Choosing an Application of April 30, 2008, Alex decides on Fantasy Soccer (a.k.a. Fantasy Football).

In Fantasy Soccer - Part 2 - an overview of the rules of May 1, 2008, Alex says:

At this stage only one thing is certain, it will use the Entity Framework for data access.

Fantasy Soccer - part 3 - Unit of Measure of May 3, 2008 discusses using the Entity Data Model's ComplexProperty feature to handle issues with English versus metric measurements and using a helper class to enable sorting by a scaled value, such as weight in lbs. or kg. (Stones for en-uk?>

Updated: May 3, 2008

The clip covers building a simple UI with a Django template that stores messages in the data store and retrieves text messages by author with a GQL query. The segment on deploying the app to GAE starts at about 08:25.

Note: GoogleDevelopers has 122 videos about Google Web services, et al., including the Campfire One release presentation. If you're new to Python and like video tutorials, ShowMeDo is the place to start. Joscha Feth's Google App Engine & eclipse (PyDev) post has fully illustrated instructions for getting code completion with Eclipse, PyDev, and the GAE working.

As time permits, I plan to determine whether GAE is a contender for "data store in the cloud" status and a viable competitor to SQL Server Data Services.

Added: 5/4/2008 12:30 PDT

Colin Meek: Composing LINQ to Entities Predicates

In his LINQ to Entities: Combining Predicates post of May 2, 2008, Colin offers three choices to compensate for LINQ's lack of an Or operator when composing predicates:

  1. Chain Unions instead of Where clauses, which is inefficient.
  2. Build the predicate by hand with ParameterExpression and Expression statements, which is a pain.
  3. Write a utility function called Compose() to implement LINQ to Entities-friendly And and Or builder methods by leveraging the ParameterRebinder implementation of Matt Warren's Expression Visitor from his IQuerable Providers series.

Interesting approach.

Added: 5/3/2008 11:45 PDT

Live Mesh and LINQ to Mesh Updates

Live Mesh Blog and Forum

The Live Mesh Blog has a detailed Behind Live Mesh: How we run cloud services post of April 30, 2008 by dev lead Alex Mallet.

Early Live Mesh adopters don't seem to have found the Live Mesh Forum. It had only 145 users as of May 3, 2008 10:00 PDT.

LINQ to Mesh (From Ori Amiga's Channel9 Video)

The Mesh Operating Environment (MOE) SDK currently has Silverlight, Javascript and desktop C# libraries. (The SDK also supports IronPython, as Ori demonstrated, but not VB.) Unfortunately, the Mesh team won't say when the SDK might be available, other than vague references to PDC 2008.

Here's the sample code for a LINQ to Mesh query against a Mesh object that Ori didn't attempt to execute because of a bug found earlier (~50:00):

Mesh mesh = Mesh.Load(new Uri(@"https://preview/mesh.com"), 
        new NetworkCredential("someone@somewhere.com", "Basic", myCred))

var meshQuery = from meshObject in mesh.CreateQuery<CoreObject>()
        where meshObject.Title == "title"
        orderby meshObject.Title
        select meshObject;

According to Ori at ~51:00, "the query processor can figure out three things:

  1. Which part of the query can execute most efficiently in our back-end storage using fine-grained indices in the cloud and execute that query as close to the data as possible.
  2. In our Mesh Operating Environment, we can keep on processing and linking and querying over that data to answer the question you're asking in the LINQ query.
  3. And you can query over the data in your local machine."

SSDS and Live Mesh

Jamie Thomson's SSDS and Mesh post of May 1, 2008 proposes using Live Mesh to sync SSDS data, perhaps even between two Authorities. Here's the story on potential SSDS and Live Mesh interop:

  • Pablo Castro and the Astoria team are working on a sync model for "Astoria Offline."
  • The SSDS team said they "will support the full EDM/EF/ADO.Net V3 model in due time."
  • Nigel Ellis demonstrated in his Introducing SQL Server Data Services session at MIX08 using the Sync Framework to synchronize vCard contact data between Microsoft Access 2007 and SSDS v1.
  • Francois Ajenstadt, director of project management for SQL Server, said "The goal is to bring the API's between SSDS and Astoria closer together closer to Release."
  • Ari Amiga says the Mesh team has been "working a lot with the Astoria team to make sure that our query syntax is the same, our URL syntax is the same, so it all looks nice and beautiful."
  • Astoria now uses, Mesh supports and SSDS will support the Atom Publication Protocol (AtomPub).

Added: 5/3/2008 10:30 PDT

ADO.NET Data Services Article in Visual Studio Magazine

My "Manipulate Data in the Cloud with ADO.NET [Data Services]" is the cover story for Visual Studio Magazine's May 2008 issue. Here's the deck:

ADO.NET Data Services (formerly code-named "Project Astoria") delivers data from relational tables and Windows Live services to Web mashups and Visual Studio 2008 projects, including ASP.NET AJAX and Silverlight 2.0 rich Internet applications, as Representational State Transfer (REST) resources over HTTP in response to URI-based requests or LINQ to REST queries.

Mesh Connection: At about 50:00 into the Ori Amiga: Programming the Mesh Channel 9 video segment of April 24, 2008 Ori mentions that the Mesh team is working with the Astoria folks to make sure their query and URL syntaxes are the same.

Related Topics: John Udell suggests taking advantage of Astoria's record-level URL addressability to implement loosely-coupled collaborative list-making in his Stonewall Farm, Darby Brook Farm, and the collaborative curation of data post of May 2, 2008. Because of its flexible entity feature (ad-hoc addition of attributes to an entity) SQL Server Data Services might be even a better choice when the SSDS team enables offering public read-only access to a container.

Moved: 5/3/2008 to Manipulate Data in the Cloud with ADO.NET [Data Services] due to length.

Kevin Hoffman Releases Continuous LINQ (CLINQ) v.1.1

According to Kevin's CLINQ v1.1.0.0 Released! post of May 2, 2008, CLINQ 1.1 now includes:

  • Support for Continuous Aggregation. Now, in addition to being able to have your result sets automatically update themselves in response to changes in the source set as well as changes to items in the source set, you can have aggregate scalar values that continuously update in the same fashion. The following is a list of the supported aggregation types that can now be done continuously:
    • Average
    • Min
    • Max
    • Sum
    • Standard Deviation
    • Count
  • Brand new demo application. This demo application not only shows off the power of continuous queries and WPF data binding, but also shows you how to use continuous aggregates, create your own continuous aggregates, and how to databind a WPF GUI to a continuous aggregate value.
His post has a screen shot of the Stock Monitor demo application in action.

Added: 5/2/2008 10:30 PDT

Jeff Currier Wants Questions to Address in SSDS Best Practices Tech*Ed Session

Jeff says in his Speaking at TechEd post of May 1, 2008:

I'm heading down to Orlando in a couple of weeks to give a talk about best practices when it comes to SSDS.  I'm working on my talk outline and was curious if there were any topics in particular that the community wanted to hear about in the talk?

I've posted my topics in a comment.

Jeff's session is "Best Practices in Building Applications with Microsoft SQL Server Data Services," which has the following description:

This interactive session provides a hands-on roadmap for developing and managing applications that use Microsoft SQL Server Data Services (SSDS), details best coding practices, and answers questions related to using on-demand storage services for business solutions.

This appears to be the sole SSDS session at Tech*Ed 2008.

Added: 5/2/2008 10:00 PDT

Popularity of SaaS/PaaS and Web Services/SOA Gain 1% Over 2006 According to McKinsey/Sandhill Survey

This 19-page Enterprise Software Customer Survey 2008 report by consultants McKinsey & Co. and Sandhill Partners finds that:

Innovation in the software industry is on the upswing, with Software as a Service (SaaS) being a key driver. The SaaS model is becoming mainstream and this has led to the rise of a new generation of SaaS platforms (also referred to in the industry as Platform as a Service – PaaS).

The distribution of 857 responses to "Please select the most important trend impacting your business" are shown in the following table for 2006 and 2008:

Most Important Trend, Percent 2006 2008
SaaS/SaaS or PaaS Platform 30 31
Web Services/Service Oriented Architecture 24 25
Open Source 10 8
Offshoring/Globalization 15 13
Software Industry Consolidation 17 7
Others 4 16

A detailed analysis of SaaS/PaaS platforms, which include "cloud computing" starts on page 5. Page 6 concludes:

The momentum toward adoption of SaaS platforms is surprising. Nearly three-quarters of the companies surveyed prefer to adopt platforms in at least one of the three archetypes we identify here.

For platform vendors, the only falloff in interest comes at the largest enterprises, those employing more than 25,000 people. In short, nearly every company – or division of a larger enterprise – is a customer or a prospect for SaaS platforms.

Exhibits on pages 6 - 9 provide additional details on interest in various models SaaS/PaaS models.

BEA's Understanding the Cloud Computing/SaaS/PaaS markets: a Map of the Players in the Industry post of May 2, 2008 by Peter Laird and Kent Dickson has clear definitions of cloud computing, SaaS, PaaS, and Core Cloud Services, as well as a map and list of major players with links to their sites.

Added: 5/2/2008 11:30 PST

SSDS Finally Provisioning Private Beta Users at a Faster Pace

KellyAlt says in Onboarding early beta customers of May 2, 2008:

Over the past 4 weeks, we have been onboarding customers slowly.  Since the response to our restricted beta invitation was quite overwhelming, quite a few of you will experience some delays in getting an account.  The SSDS team is doing everything possible to get you onboarded as soon as possible.  I am happy to say that I am seeing the pace pick up a bit over the last week.

I've been working with SSDS for about three weeks and have written a WinForm test harness to give SSDS v1 a thorough workout. Here's the UI when using the REST protocol to upload a Northwind Employee entity with a base64Binary-encoded bitmap:

Watch for my "Test-Drive SQL Server Data Services" feature article coming in the July 2008 issue of Visual Studio Magazine, which will include complete C# source code for the test harness.

Added: 5/2/2008 08:30 PDT

Ryan Dunn Interviews Tudor Toma and Soumitra Sangupta About the Business Value of SSDS

In Channel9's Tudor Toma and Soumitra Sengupta: SQL Server Data Services Business Value segment of May 1, 2008 (28:19):

Ryan sits down and talks with the Group Program Manager Tudor Toma and Architect Soumitra Sengupta about the business value of SSDS.

Added: 5/1/2008 17:00 PDT

David DeWinter Adapts T4 Templates to Generate T-SQL Stored Procedure Scripts for Entity Data Models

The Text Template Transformation Toolkit (commonly called T4) is a free Microsoft code generation engine for VS 2005 and later that supports their Domain Specific Languages and Software Factories toolkits. The Hilton Giesenow and Oleg Sych blogs have posts about T4.

David's Entity Framework Stored Procedure Generation post of April 26, 2008 describes the template:

The T4 template we created is designed to be a general purpose way to generate CUD procedures for an Entity Framework model. ...

The template not only generates EF-compliant sprocs, but it also considers only the tables that are in the SSDL of the model file. Unfortunately, the template must query the database (SQL Server 2005 only!) in order to make all the decisions necessary to create the output file. However, this is usually quite fast on generations other than the first one.

The template would have been a big time saver when I wrote 40+ stored procedures for my forthcoming book's test project.

Added: 5/1/2008 13:40 PDT

Rick Strahl Posts LINQ to SQL and WCF JSON/REST Samples from His ASP.NET Connections Presentations

Rick's ASP.NET Connections Slides and Samples Posted item of May 1, 2008 provides links to sample code and PowerPoint slides from his three presentations at the ASP.NET Connections conference in Orlando. Following are Rick's abstracts of the sessions:

Building a LINQ to SQL Business Layer for ASP.NET Applications

LINQ to SQL - although completely object based, is still little more than a sophisticated data access layer and so a business object layer is still needed to abstract business logic and provide common functionality that every business related entity requires. The business layer provides a few high level abstractions to the CRUD layer as well as a host of low level features that allow better control for low level data access in case LINQ to SQL queries are ill suited for queries and operations that cannot be performed with LINQ to SQL at all.

This session and its sample code is the culmination of Rick's extensive writing about LINQ to SQL in enterprise-grade projects.

WCF 3.5 JSON and REST Services

WCF 3.5's AJAX support has been made nearly as easy and comprehensive as ASMX functionality and there are many options of how data can be accessed over HTTP now with official protocol support for the webHttpBinding. This session starts of with examples of pure REST URLS and demonstrates features like URL templating, different response formats (wrapped, bare, XML, JSON) as well as the various different options for serving in this fashion. There are also examples of serving up raw data such as images or HTML content out of the REST based API. The remainder of the session focuses on AJAX functionality and explores different ways that WCF services can be called.

If you're interested in ADO.NET Data Objects, which support WCF JSON and REST protocols, don't miss this session.

Ajax Alternatives: Using jQuery with ASP.NET

Off-topic for this blog, but very interesting if you're into AJAX.

Note: Slides are the last file in the ZIP containers.

Frans Bouma Adds LINQ to SQL Refactoring and ASP.NET Dynamic Data Support to LLBLGen Pro

LLBLGen Pro has its own native LINQ implementation, but Frans announces in his Linq to Sql support added to LLBLGen Pro post of May 1, 2008 that latest version (2.6 beta) of LLBLGen Pro includes templates for generating LINQ to SQL classes and mapping (*.dbml) files.

This means you can use LLBLGen Pro's code generator to update your LINQ to SQL data model from SQL Server metadata automatically. Microsoft's LINQ to SQL implementation requires manually updating the data model for schema changes. (ADO.NET Entity Framework's Model Browser has an Update Model from Database context menu command.)

Frans says, "The only downside is that you can't update your model in the Linq to Sql designer anymore. But, why would you?"

LLBLGen Pro ASP.NET Dynamic Data Support

Frans' Dynamic Data and 3rd party o/r mappers is a fact post of May 1, 2008 describes how he convinced Scott Guthrie to open ASP.NET Dynamic Data products to third-party object/relational mapping (O/RM) tools, which in turn enables substituting LLBLGen Pro for LINQ to SQL or Entity Framework.

Steele Price Finds LINQ to SQL Frustrating

In his Some of my frustrations with Linq to Sql post of May 1, 2008, Steel Price complains about:

  • Duplication of the "one" object of a many:one association (such as a Customer for a new Order) with the InsertOnSubmit() method if the entity has both an ID field and association.
  • Lack of a method of assuring that deletions precede insertions with multiple updates to the DataContext.
  • Loading an Association does not automatically set the ID if that field is also in the map.

These are legitimate issues that the LINQ to SQL team should fix in VS 2008 SP1.

LINQ to SQLite Accepted as a Google Summer of Code Project

Kevin Kubasik, who wrote a fledgling LINQ to SQLite provider, reports in his Mono GSOC Projects: Linq to SQLite post of May 1, 2008 that he "noticed that one of the accepted proposals for the Mono project is to create a LINQ provider for SQLite."

This project appears to be related to the "Linq to SQL for open source databases" topic of Mono's Student Projects page and is listed in Current Projects on Google Code's Mono Project page.

An Open Source Project for a SQLMetal.exe and SQL Server Compact Edition 3.5 UI

LINQ to SQL's graphic designer doesn't support SQL Server Compact Edition (SSCE) 3.5, so you must use the SQLMetal.exe command-line tool to create LINQ to SQL classes for *.sdf database files.

J. Torres has started a open source project on CodePlex to create a front end for SQLMetal.exe that's compatible with SSCE 3.5.

However, it's a good bet that SSCE 3.5 support will be included in VS 2008 SP1, so the project might have a short shelf life.

Derek Whittaker Explains How to Group LINQ to SQL Sequences on Multiple Columns

Derek explains in his Multi-Column Grouping with Linq2Sql post of April 30, 2008 how to write the LINQ to SQL equivalent of the following T-SQL query.

SELECT COUNT(*) AS Count, 
 cs.SendID, 
 cs.Name AS SendName, 
 cts.ListID, 
 cts.ListName, 
 ctom.EmailAddress 
FROM CampaignTrackingOpenedMail AS ctom 
 INNER JOIN CampaignTrackingSummary AS cts 
 ON ctom.CampaignTrackingSummaryID = cts.[ID] 
 INNER JOIN CampaignSend AS cs 
 ON cts.SendID = cs.SendID 
GROUP BY cs.SendID, 
 cs.Name, 
 cts.ListID, 
 cts.ListName, 
 ctom.EmailAddress 

The translation isn't obvious.

Alex James Starts a Fantasy Football Project with Entity Framework as the Data Source

Back in late March, Alex published his Statement of Intent:

I'm going to start creating 'real world' applications using the Entity Framework, and I'm going to blog about all the tradeoffs I make, the hoops I have to jump through, the gotcha's I encounter, the workarounds, the design considerations etc.

In Real world App - Part 1 - Choosing an Application of April 30, 2008, Alex decides on Fantasy Soccer (a.k.a. Fantasy Football).

In Fantasy Soccer - Part 2 - an overview of the rules of May 1, 2008, Alex says:

At this stage only one thing is certain, it will use the Entity Framework for data access.

Fantasy Soccer - part 3 - Unit of Measure of May 3, 2008 discusses using the Entity Data Model's ComplexProperty feature to handle issues with English versus metric measurements and using a helper class to enable sorting by a scaled value, such as weight in lbs. or kg. (Stones for en-uk?>

Updated: May 3, 2008

The clip covers building a simple UI with a Django template that stores messages in the data store and retrieves text messages by author with a GQL query. The segment on deploying the app to GAE starts at about 08:25.

Note: GoogleDevelopers has 122 videos about Google Web services, et al., including the Campfire One release presentation. If you're new to Python and like video tutorials, ShowMeDo is the place to start. Joscha Feth's Google App Engine & eclipse (PyDev) post has fully illustrated instructions for getting code completion with Eclipse, PyDev, and the GAE working.

As time permits, I plan to determine whether GAE is a contender for "data store in the cloud" status and a viable competitor to SQL Server Data Services.

Added: 5/4/2008 12:30 PDT

Colin Meek: Composing LINQ to Entities Predicates

In his LINQ to Entities: Combining Predicates post of May 2, 2008, Colin offers three choices to compensate for LINQ's lack of an Or operator when composing predicates:

  1. Chain Unions instead of Where clauses, which is inefficient.
  2. Build the predicate by hand with ParameterExpression and Expression statements, which is a pain.
  3. Write a utility function called Compose() to implement LINQ to Entities-friendly And and Or builder methods by leveraging the ParameterRebinder implementation of Matt Warren's Expression Visitor from his IQuerable Providers series.

Interesting approach.

Added: 5/3/2008 11:45 PDT

Live Mesh and LINQ to Mesh Updates

Live Mesh Blog and Forum

The Live Mesh Blog has a detailed Behind Live Mesh: How we run cloud services post of April 30, 2008 by dev lead Alex Mallet.

Early Live Mesh adopters don't seem to have found the Live Mesh Forum. It had only 145 users as of May 3, 2008 10:00 PDT.

LINQ to Mesh (From Ori Amiga's Channel9 Video)

The Mesh Operating Environment (MOE) SDK currently has Silverlight, Javascript and desktop C# libraries. (The SDK also supports IronPython, as Ori demonstrated, but not VB.) Unfortunately, the Mesh team won't say when the SDK might be available, other than vague references to PDC 2008.

Here's the sample code for a LINQ to Mesh query against a Mesh object that Ori didn't attempt to execute because of a bug found earlier (~50:00):

Mesh mesh = Mesh.Load(new Uri(@"https://preview/mesh.com"), 
        new NetworkCredential("someone@somewhere.com", "Basic", myCred))

var meshQuery = from meshObject in mesh.CreateQuery<CoreObject>()
        where meshObject.Title == "title"
        orderby meshObject.Title
        select meshObject;

According to Ori at ~51:00, "the query processor can figure out three things:

  1. Which part of the query can execute most efficiently in our back-end storage using fine-grained indices in the cloud and execute that query as close to the data as possible.
  2. In our Mesh Operating Environment, we can keep on processing and linking and querying over that data to answer the question you're asking in the LINQ query.
  3. And you can query over the data in your local machine."

SSDS and Live Mesh

Jamie Thomson's SSDS and Mesh post of May 1, 2008 proposes using Live Mesh to sync SSDS data, perhaps even between two Authorities. Here's the story on potential SSDS and Live Mesh interop:

  • Pablo Castro and the Astoria team are working on a sync model for "Astoria Offline."
  • The SSDS team said they "will support the full EDM/EF/ADO.Net V3 model in due time."
  • Nigel Ellis demonstrated in his Introducing SQL Server Data Services session at MIX08 using the Sync Framework to synchronize vCard contact data between Microsoft Access 2007 and SSDS v1.
  • Francois Ajenstadt, director of project management for SQL Server, said "The goal is to bring the API's between SSDS and Astoria closer together closer to Release."
  • Ari Amiga says the Mesh team has been "working a lot with the Astoria team to make sure that our query syntax is the same, our URL syntax is the same, so it all looks nice and beautiful."
  • Astoria now uses, Mesh supports and SSDS will support the Atom Publication Protocol (AtomPub).

Added: 5/3/2008 10:30 PDT

ADO.NET Data Services Article in Visual Studio Magazine

My "Manipulate Data in the Cloud with ADO.NET [Data Services]" is the cover story for Visual Studio Magazine's May 2008 issue. Here's the deck:

ADO.NET Data Services (formerly code-named "Project Astoria") delivers data from relational tables and Windows Live services to Web mashups and Visual Studio 2008 projects, including ASP.NET AJAX and Silverlight 2.0 rich Internet applications, as Representational State Transfer (REST) resources over HTTP in response to URI-based requests or LINQ to REST queries.

Mesh Connection: At about 50:00 into the Ori Amiga: Programming the Mesh Channel 9 video segment of April 24, 2008 Ori mentions that the Mesh team is working with the Astoria folks to make sure their query and URL syntaxes are the same.

Related Topics: John Udell suggests taking advantage of Astoria's record-level URL addressability to implement loosely-coupled collaborative list-making in his Stonewall Farm, Darby Brook Farm, and the collaborative curation of data post of May 2, 2008. Because of its flexible entity feature (ad-hoc addition of attributes to an entity) SQL Server Data Services might be even a better choice when the SSDS team enables offering public read-only access to a container.

Moved: 5/3/2008 to Manipulate Data in the Cloud with ADO.NET [Data Services] due to length.

Kevin Hoffman Releases Continuous LINQ (CLINQ) v.1.1

According to Kevin's CLINQ v1.1.0.0 Released! post of May 2, 2008, CLINQ 1.1 now includes:

  • Support for Continuous Aggregation. Now, in addition to being able to have your result sets automatically update themselves in response to changes in the source set as well as changes to items in the source set, you can have aggregate scalar values that continuously update in the same fashion. The following is a list of the supported aggregation types that can now be done continuously:
    • Average
    • Min
    • Max
    • Sum
    • Standard Deviation
    • Count
  • Brand new demo application. This demo application not only shows off the power of continuous queries and WPF data binding, but also shows you how to use continuous aggregates, create your own continuous aggregates, and how to databind a WPF GUI to a continuous aggregate value.
His post has a screen shot of the Stock Monitor demo application in action.

Added: 5/2/2008 10:30 PDT

Jeff Currier Wants Questions to Address in SSDS Best Practices Tech*Ed Session

Jeff says in his Speaking at TechEd post of May 1, 2008:

I'm heading down to Orlando in a couple of weeks to give a talk about best practices when it comes to SSDS.  I'm working on my talk outline and was curious if there were any topics in particular that the community wanted to hear about in the talk?

I've posted my topics in a comment.

Jeff's session is "Best Practices in Building Applications with Microsoft SQL Server Data Services," which has the following description:

This interactive session provides a hands-on roadmap for developing and managing applications that use Microsoft SQL Server Data Services (SSDS), details best coding practices, and answers questions related to using on-demand storage services for business solutions.

This appears to be the sole SSDS session at Tech*Ed 2008.

Added: 5/2/2008 10:00 PDT

Popularity of SaaS/PaaS and Web Services/SOA Gain 1% Over 2006 According to McKinsey/Sandhill Survey

This 19-page Enterprise Software Customer Survey 2008 report by consultants McKinsey & Co. and Sandhill Partners finds that:

Innovation in the software industry is on the upswing, with Software as a Service (SaaS) being a key driver. The SaaS model is becoming mainstream and this has led to the rise of a new generation of SaaS platforms (also referred to in the industry as Platform as a Service – PaaS).

The distribution of 857 responses to "Please select the most important trend impacting your business" are shown in the following table for 2006 and 2008:

Most Important Trend, Percent 2006 2008
SaaS/SaaS or PaaS Platform 30 31
Web Services/Service Oriented Architecture 24 25
Open Source 10 8
Offshoring/Globalization 15 13
Software Industry Consolidation 17 7
Others 4 16

A detailed analysis of SaaS/PaaS platforms, which include "cloud computing" starts on page 5. Page 6 concludes:

The momentum toward adoption of SaaS platforms is surprising. Nearly three-quarters of the companies surveyed prefer to adopt platforms in at least one of the three archetypes we identify here.

For platform vendors, the only falloff in interest comes at the largest enterprises, those employing more than 25,000 people. In short, nearly every company – or division of a larger enterprise – is a customer or a prospect for SaaS platforms.

Exhibits on pages 6 - 9 provide additional details on interest in various models SaaS/PaaS models.

BEA's Understanding the Cloud Computing/SaaS/PaaS markets: a Map of the Players in the Industry post of May 2, 2008 by Peter Laird and Kent Dickson has clear definitions of cloud computing, SaaS, PaaS, and Core Cloud Services, as well as a map and list of major players with links to their sites.

Added: 5/2/2008 11:30 PST

SSDS Finally Provisioning Private Beta Users at a Faster Pace

KellyAlt says in Onboarding early beta customers of May 2, 2008:

Over the past 4 weeks, we have been onboarding customers slowly.  Since the response to our restricted beta invitation was quite overwhelming, quite a few of you will experience some delays in getting an account.  The SSDS team is doing everything possible to get you onboarded as soon as possible.  I am happy to say that I am seeing the pace pick up a bit over the last week.

I've been working with SSDS for about three weeks and have written a WinForm test harness to give SSDS v1 a thorough workout. Here's the UI when using the REST protocol to upload a Northwind Employee entity with a base64Binary-encoded bitmap:

Watch for my "Test-Drive SQL Server Data Services" feature article coming in the July 2008 issue of Visual Studio Magazine, which will include complete C# source code for the test harness.

Added: 5/2/2008 08:30 PDT

Ryan Dunn Interviews Tudor Toma and Soumitra Sangupta About the Business Value of SSDS

In Channel9's Tudor Toma and Soumitra Sengupta: SQL Server Data Services Business Value segment of May 1, 2008 (28:19):

Ryan sits down and talks with the Group Program Manager Tudor Toma and Architect Soumitra Sengupta about the business value of SSDS.

Added: 5/1/2008 17:00 PDT

David DeWinter Adapts T4 Templates to Generate T-SQL Stored Procedure Scripts for Entity Data Models

The Text Template Transformation Toolkit (commonly called T4) is a free Microsoft code generation engine for VS 2005 and later that supports their Domain Specific Languages and Software Factories toolkits. The Hilton Giesenow and Oleg Sych blogs have posts about T4.

David's Entity Framework Stored Procedure Generation post of April 26, 2008 describes the template:

The T4 template we created is designed to be a general purpose way to generate CUD procedures for an Entity Framework model. ...

The template not only generates EF-compliant sprocs, but it also considers only the tables that are in the SSDL of the model file. Unfortunately, the template must query the database (SQL Server 2005 only!) in order to make all the decisions necessary to create the output file. However, this is usually quite fast on generations other than the first one.

The template would have been a big time saver when I wrote 40+ stored procedures for my forthcoming book's test project.

Added: 5/1/2008 13:40 PDT

Rick Strahl Posts LINQ to SQL and WCF JSON/REST Samples from His ASP.NET Connections Presentations

Rick's ASP.NET Connections Slides and Samples Posted item of May 1, 2008 provides links to sample code and PowerPoint slides from his three presentations at the ASP.NET Connections conference in Orlando. Following are Rick's abstracts of the sessions:

Building a LINQ to SQL Business Layer for ASP.NET Applications

LINQ to SQL - although completely object based, is still little more than a sophisticated data access layer and so a business object layer is still needed to abstract business logic and provide common functionality that every business related entity requires. The business layer provides a few high level abstractions to the CRUD layer as well as a host of low level features that allow better control for low level data access in case LINQ to SQL queries are ill suited for queries and operations that cannot be performed with LINQ to SQL at all.

This session and its sample code is the culmination of Rick's extensive writing about LINQ to SQL in enterprise-grade projects.

WCF 3.5 JSON and REST Services

WCF 3.5's AJAX support has been made nearly as easy and comprehensive as ASMX functionality and there are many options of how data can be accessed over HTTP now with official protocol support for the webHttpBinding. This session starts of with examples of pure REST URLS and demonstrates features like URL templating, different response formats (wrapped, bare, XML, JSON) as well as the various different options for serving in this fashion. There are also examples of serving up raw data such as images or HTML content out of the REST based API. The remainder of the session focuses on AJAX functionality and explores different ways that WCF services can be called.

If you're interested in ADO.NET Data Objects, which support WCF JSON and REST protocols, don't miss this session.

Ajax Alternatives: Using jQuery with ASP.NET

Off-topic for this blog, but very interesting if you're into AJAX.

Note: Slides are the last file in the ZIP containers.

Frans Bouma Adds LINQ to SQL Refactoring and ASP.NET Dynamic Data Support to LLBLGen Pro

LLBLGen Pro has its own native LINQ implementation, but Frans announces in his Linq to Sql support added to LLBLGen Pro post of May 1, 2008 that latest version (2.6 beta) of LLBLGen Pro includes templates for generating LINQ to SQL classes and mapping (*.dbml) files.

This means you can use LLBLGen Pro's code generator to update your LINQ to SQL data model from SQL Server metadata automatically. Microsoft's LINQ to SQL implementation requires manually updating the data model for schema changes. (ADO.NET Entity Framework's Model Browser has an Update Model from Database context menu command.)

Frans says, "The only downside is that you can't update your model in the Linq to Sql designer anymore. But, why would you?"

LLBLGen Pro ASP.NET Dynamic Data Support

Frans' Dynamic Data and 3rd party o/r mappers is a fact post of May 1, 2008 describes how he convinced Scott Guthrie to open ASP.NET Dynamic Data products to third-party object/relational mapping (O/RM) tools, which in turn enables substituting LLBLGen Pro for LINQ to SQL or Entity Framework.

Steele Price Finds LINQ to SQL Frustrating

In his Some of my frustrations with Linq to Sql post of May 1, 2008, Steel Price complains about:

  • Duplication of the "one" object of a many:one association (such as a Customer for a new Order) with the InsertOnSubmit() method if the entity has both an ID field and association.
  • Lack of a method of assuring that deletions precede insertions with multiple updates to the DataContext.
  • Loading an Association does not automatically set the ID if that field is also in the map.

These are legitimate issues that the LINQ to SQL team should fix in VS 2008 SP1.

LINQ to SQLite Accepted as a Google Summer of Code Project

Kevin Kubasik, who wrote a fledgling LINQ to SQLite provider, reports in his Mono GSOC Projects: Linq to SQLite post of May 1, 2008 that he "noticed that one of the accepted proposals for the Mono project is to create a LINQ provider for SQLite."

This project appears to be related to the "Linq to SQL for open source databases" topic of Mono's Student Projects page and is listed in Current Projects on Google Code's Mono Project page.

An Open Source Project for a SQLMetal.exe and SQL Server Compact Edition 3.5 UI

LINQ to SQL's graphic designer doesn't support SQL Server Compact Edition (SSCE) 3.5, so you must use the SQLMetal.exe command-line tool to create LINQ to SQL classes for *.sdf database files.

J. Torres has started a open source project on CodePlex to create a front end for SQLMetal.exe that's compatible with SSCE 3.5.

However, it's a good bet that SSCE 3.5 support will be included in VS 2008 SP1, so the project might have a short shelf life.

Derek Whittaker Explains How to Group LINQ to SQL Sequences on Multiple Columns

Derek explains in his Multi-Column Grouping with Linq2Sql post of April 30, 2008 how to write the LINQ to SQL equivalent of the following T-SQL query.

SELECT COUNT(*) AS Count, 
 cs.SendID, 
 cs.Name AS SendName, 
 cts.ListID, 
 cts.ListName, 
 ctom.EmailAddress 
FROM CampaignTrackingOpenedMail AS ctom 
 INNER JOIN CampaignTrackingSummary AS cts 
 ON ctom.CampaignTrackingSummaryID = cts.[ID] 
 INNER JOIN CampaignSend AS cs 
 ON cts.SendID = cs.SendID 
GROUP BY cs.SendID, 
 cs.Name, 
 cts.ListID, 
 cts.ListName, 
 ctom.EmailAddress 

The translation isn't obvious.

Alex James Starts a Fantasy Football Project with Entity Framework as the Data Source

Back in late March, Alex published his Statement of Intent:

I'm going to start creating 'real world' applications using the Entity Framework, and I'm going to blog about all the tradeoffs I make, the hoops I have to jump through, the gotcha's I encounter, the workarounds, the design considerations etc.

In Real world App - Part 1 - Choosing an Application of April 30, 2008, Alex decides on Fantasy Soccer (a.k.a. Fantasy Football).

In Fantasy Soccer - Part 2 - an overview of the rules of May 1, 2008, Alex says:

At this stage only one thing is certain, it will use the Entity Framework for data access.

Fantasy Soccer - part 3 - Unit of Measure of May 3, 2008 discusses using the Entity Data Model's ComplexProperty feature to handle issues with English versus metric measurements and using a helper class to enable sorting by a scaled value, such as weight in lbs. or kg. (Stones for en-uk?>

Updated: May 3, 2008

Subscribe to: Comments (Atom)
 

AltStyle によって変換されたページ (->オリジナル) /