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

1 comments:

Frans Bouma said...

"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"
I must say I find the choice of people for this group rather odd. Fowler has moved on to Ruby for example, and most others aren't really developers anymore, but architects.

The point is that the Persistence Ignorance motivation is purely a technical one: the developer who asks for it, wants it because it's easier for writing your own classes -> it offers more 'freedom' in the way how the entity classes are written. There's no other reason why PI would be even on the table: It's purely about entity class E has to be structured in a way X and the developer doesn't want to be limited to how X should look like by a persistence layer.

Unfortunately, it's a myth to believe that PI is possible: one of the more advanced aspects of using a persistence framework is the way entity graphs are managed in-memory. This isn't standarized, however it is something a developer has to live with/works with in his/her own code. So this behavior drives how the developer writes code consuming/working with entity class instances.

As all known POCO frameworks for .NET differ in how entity management is done in memory, the choice which framework is used leaks into the own code written by the developer. So in one way PI seems to be present, however in other places the choice of which O/R mapper is locked inside the code written by the developer, due to the features offered by the persistence framework.

What I always wonder is why this is such a bad thing... Everyone who has swapped grid controls on a form knows how deep the effects are of which control set is used but no-one really cares. However, when it comes to persistence frameworks, it's suddenly a bad thing, without proper arguments why.

MS would have been better of if they would have hired POCO oriented o/r mapper writers for advice. Not the codebetter.com group nor a group of architects who never have to work with the code they're advising on.

Although IMHO, this whole strive for PI in EDM/EF is useless: once it's been released, the backwards compatibility issue will pop up and they'll never be able to change it. It's not just the interface they now force upon you. It's the methods generated on the datacontext to get things done as well, as the entity management stuff for in-memory entity management which makes things locked into EF no matter how transparent you make it.

One typical example is FK fields. EF doesn't have those. Some poco frameworks do. Others don't. Typically they're important, for example in databinding scenario's.