More on LINQ, XLinq and perspectives.

On XLinq

A lot of the questions about XLinq are around how it will sit beside/replace XQuery (and other XML query/transform techniques). Back when I first started doing some .NET 2.0 training in February, I was a bit miffed that XQuery had not made it into the .NET Framework. Now don't get me wrong, it's not the most elegant thing in the world, but the excuse that “it's not a standard YET, so we can't put it in the framework“ seemed a little insincere given that the SQL team had managed to jump over that hurdle. But given LINQ/XLinq, maybe this now makes sense. We'll have to get our feet wet and see how LINQ evolves over time into a shipping product.

  • Michale Rys gives his thoughts on the relation between XLinq and XQuery. Interestingly he points out that XLinq uses about 30% less memory than the DOM.
  • Mike Champion's thoughts also comparing XLinq to the DOM.
  • Soumitra Sengupta also adds his 2 cents on how XLinq is positioned with the rest of the XML processing technologies.
  • Dave Remy gives some also talks about how XLinq's implementation was from the ground up, but inspired by lessons learned on the back of the DOM.

Other perspectives floating around....

  • On an unrelated note, M. David Peterson has an interesting post from one of his colleagues, with specific mention of comparisons between LINQ, and Haskell.
  • Kent Tegels also shares his first impressions.
  • Paul Wilson has a critical review of DLinq. He rightly questions the “sqlserver only“ aspect of DLinq. I'm hopeful that this is only a temporal condition. Paul also mentions, among other things, poor support for stored procedures in DLinq, but at this point, I'm not convinced that is all too important. I have to think about that some more.
  • Werner Moise has some in depth thoughts.

Some Articles...

  • Infoworld has an interview with Anders.
  • Scott Swigart has an article on VB 9 in Dr. Dobb's with interviews with Paul Vick, Amanda Silver, Erik Meijer, Rob Copeland, Alan Griver, and Jay Roxe.

And if you are at PDC and want to get more information, Don Box is hosting a LINQ Panel discussion tomorrow and he is looking for your questions in his blog comments.

What is the world saying about Microsoft's C# and VB LINQ Project

I have to say that the LINQ syntax in VB hits much closer to the mark than C#. More on that later. What is everybody else saying out there about LINQ?

  • Erik Meijer says that VB has become his “programming language of choice.“
  • Sam Gentile “LINQ is freaking cool“, but he's feeling the beta pain because the VB and C# tech previews work with Beta 2 of 2005 and he just installed the VSTS release candidate.
  • Rédo believes LINQ “will represent a tectonic shift in the way that VB programmers will work with data“.
  • Somasegar believes that LINQ is a signifiicant developer productivity enhancement and he wants to hear your feedback.
  • Sean Chase points out some interesting ideas using lambda expressions with LINQ.
  • Frans Bouma compares DLinq to O/R mappers and points out the negative side of attribute based mapping for use in cross db platform support. There is a good follow up discussion in the comments on that post.
  • Marius Gheorghe likes the LINQ idea, but not so much the implementatio and seems to agree with Frans.
  • OrangeVolt hopes that Sun will adapt this for Java.
  • Ben Galbraith gives his comments on LINQ from a Java perspective. In particular, he's happy to see the type inference feature added to C# and wishes Java could do the same. The comments also contain some interesting discussion on Java and .NET.
  • Over at the SPS Weblog, LINQ is inspiring a Visual FoxPro Object-Oriented SQL. Don't get crazy, he's only got 1 hour of development under his belt.

There is also an interview with Anders Hejlsberg and Paul Vick worth reading. Why does Paul look so much happier than Anders in these photos? No doubt it is the VB syntax simplicity :)

Linq Resources

As you may have heard, the LINQ(Language Integrated Query) Project was announced publicly today at PDC. There will be a lot more information coming throughout the week, but here's the resources available as of today.

Overview

DLinq

XLinq

Visual Basic

C#

Microsoft LINQ Bloggers

Upcoming Chats

UPDATE: Added Dinesh, Matt and Luca to the bloggers list.
UPDATE 2: Added Rob, Erik, and Amanda to the bloggers list.

 

Reflections on the PDC Day 1 Keynote

Bill Gates gave a pretty typical high level keynote to introduce the keynote this morning. He talked about the past, how far we've come, and how now is the most exciting time, and that we are in most exciting industry. Not that I don't disagree, but I swear I've heard this keynote before.

After Bill, a series of VP's and Architect's ran through more product details. Things started to get much more interesting at this point. Chris Capossela gave an end user run down of Windows Vista and Office 12 - which will be both released at the same time near the end of 2006.

The UI is just stunning (as it always is in these demos). It was also nice to see the QuickSearch text box integrated through both products. Not unlike Google Desktop Search, and using the same engine as MSN Desktop Search, the QuickSearch text box gives context sensitive searching through the application. If you're in a document explorer - you can search there for documents. If you are in the start menu, you can easily search for applications (and recent documents). If you are in outlook you can easily search your in-box, contacts, etc. Of course you can do broad computer searches too, but that context is nice.

Chris also showed off Sidebar which isn't really big news, but he also showed the audience Sideshow. Sideshow uses the same dock-able gadgets that Sidebar does, but re-use them on what I can only describe as a built in Pocket PC device that is built into the cabinetry of your laptop. This allows you to check real-time information (email, appointments, etc.) without turning on or booting up your laptop. Expedia had a nice gadget working in Sideshow that showed up to the minute flight status. Nice.

RSS is also taking a prominent position in Vista and Office. An RSS store was announced that would store subscribed RSS feed content. This content would be regularly downloaded automatically, and the content would be available to the Sidebar, Outlook, IE7, and your own applications. Cool.

Office 12 has a new user interface that hopes to make more of its features discoverable. At first glance I wasn't all too excited about this, but I'll reserve my judgment until I play around with it. The quick “wizard“ like features were absolutely stunning though.

The integration with Outlook and Sharepoint is quite impressive. We are all accustomed to having our email/contacts/appointments offline stored in our outlook store. With Office 12, you can keep in sync with any Sharepoint folder to keep those files on your local store. Sweet. Better yet, a special new Sharepoint List for sharing PowerPoint decks. When you upload a PowerPoint file, an item appears in the list for each slide. From within PowerPoint, I can create a new deck, and pull individual slides from the Sharepoint server. You can optionally have it keep that slide up to date so if a new version is uploaded to the server, you'll automatically get it. Corporate plagiarism has just become so much easier.

After Chris's “consumer“ demos, Jim Alchin came out with Don Box, Chris Anderson, Anders Hejlsberg and Scott Guthrie. Jim started by giving some demos of some interesting plumbing bits. One cool thing in Vista is Super Fetch. Super Fetch is a preloaded memory cache of things you'll likely need, but unlike typical hard drive caches, it basis it's decisions on analyzing your behavior over days, weeks, months to determine what an idle machine should be preloading. The second part of his demo tied in very nicely where he showed that any USB Memory Stick could be plugged into a Vista machine and it would automatically start using it for expanded virtual ram. That totally rocks for laptops which can quickly max out their ram capacities.

Don and Anders went on to talk about some big news, namely the Language Integrated Query (LINQ) project. Linq provides a query engine on top of XML, Object and Relational data stores using a common query language reminiscent of SQL. No, this isn't an O/R mapping tool, but you can see how they may have wanted to delay ObjectSpaces until they got Linq out the door. I'll have more on this in my blog in the coming days. Attendees at PDC are getting Linq bits to try out, and don't forget to stop by the track lounge to pick up a copy of a Linq whitepaper. 

Next Don and Chris messed around with Indigo, and they also created a goofy Avalon application. Scott Guthrie came out to show off the Atlas product which is a set of cross browser javascripts and server side ASP.NET 2 controls to make Ajax style programming a snap.

To close out the lengthy presentation, Jim brought out a few other people to demonstrate complete applications to bring up the wow factor, including Microsoft Max and a kiosk application created for the North Face.

UPDATE: Dinesh Kulkarni gives some inside scoop on how ObjectSpaces is dead, or rather morphed into DLinq. It would appear ObjectsSpaces is not something you'll see built down the road on top of Linq.

Metro Toronto .NET User Group Meeting September 8th: Managed Code in Sql Server 2005

On September 8th I'll be speaking at the .NET User Group here in Toronto. I'll be talking about how developers can take advantage of Sql Server 2005's ability to host managed code. Full abstract and registration details are here.

DevTeach Conference in Montreal

I'm going to be heading out in a couple of weeks to DevTeach in Montreal. In addition to my regular session talk on Datasets, I'll also be participating in an architecture panel discussion as part of Groupe d’usagers Visual Studio Montréal, Software Architecture Special Interest Group's Special Software Architecture Meeting. The meeting is open to conference attendees, members of the user group, and anybody else for $5. Here's the details....

Speaker: Joel Semeniuk, Microsoft Regional Director, Winnipeg

Subject: Software architecture from the trenches

 

Architecture is the soul of our software. Software Architecture truly helps to define our success since if our architecture fails us, our software fails us. However, what makes a good architecture? What truly drives architectural decisions? Is one architecture better than another? In this session we will explore and discuss some of these questions while taking a close look at a few real-world examples. In each real-world scenario we will explore the resulting architecture and review the constraints the project faced both during design and during production and maintenance phases. We will also look retrospectively at each architecture presented and discuss ways that it could be improved upon with Microsoft .NET 2.0.

 

Joel Semeniuk is a founder and VP of Software Development at ImagiNET Resources Corp, a Manitoba based Microsoft Gold Partner in Ecommerce and Enterprise Systems. Joel is also the Microsoft Regional Director for Winnipeg, Manitoba. With a degree in Computer Science from the University of Manitoba, Joel has spent the last twelve years providing educational, development and infrastructure consulting services to clients throughout North America. Joel is the author of "Exchange and Outlook: Constructing Collaborative Solutions", from New Riders Publishing and contributing author of "Microsoft Visual Basic.NET 2003 KickStart" from SAMS. Joel has also acted as a technical reviewer on many other books and regularly writes articles for .NET Magazine and Exchange and Outlook Magazine on a variety of infrastructure and development related topics. Reach Joel by email at joels@imaginets.com.

 

Followed by a software architecture expert panel:

Beth Massi, Software Architecture MVP

Joel Semeniuk, Software Architecture MVP, Microsoft Regional Director Winnipeg

Barry Gervin, Software Architecture MVP, Microsoft Regional Director Toronto

Mario Cardinal, Software Architecture MVP

Carol Roy, Microsoft Canada .NET architecture specialist for the public sector

 

Well known Nick Landry (MVP .NET Compact Framework) will act as the moderator.

 

Come hear these experts talk about software architecture hot topics.  You'll also have the chance to ask questions and talk to the panelists.

 

Monday June 20th, 5:30PM to 9:30PM

Location: Sheraton Centre, 1201 Boulevard Rene-Levesque West

Cost: free for all the DevTeach attendees and the Groupe d’usagers Visual Studio Montréal members.  $5 for non members or non DevTeach attendees.

Note: this session will be held in English

More info: www.guvsm.net or http://www.devteach.com/BonusSession.asp

 

When is a database oriented as a service?

Do you consider your database as a service? It's worthwhile to review the tenents of a service oriented architecture. The first two tenents above are probably the most relevant to my question.

If you do all of your data access through stored procedures, then you might say your database boundary is explicit.

If your database doesn't depend on other services or applications to exist properly, then you could say that your database is autonomous. That's a little tricky. Although we may use stored procedures to access functionality in our database, we may have well known  practices that we have to call the ap_decrease_inventory  proc after we call the ap_ship_order proc to make sure our that our database values are all in check. I wouldn't call our database autonomous if it has to rely on these external rules being inforced.

I'm going to avoid the discussion of the last two tenents because I think the are a bit to pure for my question. I'm really just trying to differentiate between two types of databases that I see out there. For my purposes, I refer to these as Databases as Services, and Databases as File Systems.

Databases as Services typically are well encapsulated and contain business rules. These databases might be supporting several client applications. You probably take great care in these databases, designing them carefully, perhaps with modeling tools, and encapsulating the persistence function with stored procedures, functions, triggers, etc. You may or may not have a well defined data access layer in your client applications. You might consider all the stored procs to be your data access layer, so you might call you procs directly from UI and/or business layers of your application, but that really depends on how well your client application is written. From you database, you don't really care so much since it's well protected service that operates autonomously.

Databases as File Systems are much less strategic. They serve one purpose only - to save stuff from your application. You probably/hopefully have a well defined data access layer in your application. That may even be an Object Relational Mapping tool (ORM). You probably designed the database to support the persistence of the objects in your application, and to generalize, you probably only have one application using this database. The most important thing though is that all of your business rules should be in your application(s). This type of database doesn't mean you don't have db side logic such as stored procedures or triggers. You may decide for optimization reasons that some code needs to live closer to the tables and that's okay. It's okay, so long as you realize it's harder to reuse some of that logic in higher layers of your application and you are comfortable in having your logic live in multiple platforms.

Stored Procedures are increasingly being used to add encapsulation to our database. No longer is performance the rationale for stored procedures. And increasingly, we are seeing advanced services in our databases - 4GL code such as Java and .NET managed code are making their ways into our databases. User Defined Types, Objects, and with the next version of SQL Server, we're seeing a full fledged message queue mechanism with Service Broker. You can even host web services directly in SQL Server 2005.

Is your database a service? Which camp do you fall into? Unfortunately, I think many people live somewhere in between, and that isn't by design. Most of the architectural decisions here should be motivated by where you decide to draw your boundary for strategic reasons, not for what is handy at the moment. I'd like to see people more consciously make this decision and remain committed to it. What are your thoughts?

SQL Server 2005 "Yukon" Virtual "Hands On" Online Labs

SQL Server 2005 “Yukon” is in beta, but if you'd rather not go through the hassle of installing it (and trying to uninstall it) you can experience it through the magic of online virtual labs.

http://msdn.demoservers.com/login.aspx?group=sql2005

Not only is it a hosted environment, but guided hands on labs are provided for the following topics:

  • SQL Server 2005 Integration Services
  • SQL Server 2005 Introduction to SQL Server Management Studio
  • SQL Server 2005 Reporting Services
  • SQL Server 2005 Server Management Objects
  • SQL Server 2005 SQL CLR Integration
  • SQL Server 2005 SQL Query Tuning
  • SQL Server 2005 SQL Server and ADO.NET 
  • SQL Server 2005 T-SQL Enhancements
  • SQL Server 2005 Web Services
  • SQL Server 2005 XML Capabilites
  • Whidbey, ObjectSpaces and Mexico, Oh My!

    I'm just heading back home from Vancouver tonight on a red eye. When I get home, I have time for a load of laundry or two and then I'm flying to Mexico. Not just for some R&R, but I've also arranged to speak at the Mayan Riviera .NET User Group. (MR. Nug). I'm not sure what is better - going on vacation, or being able to write it off as a business expense. Unfortunately the only Spanish I know is “Dos cervasa por favor“ therefore this talk will be in English. My apologies.

    I'm going to be speaking about the new DataSet that is coming in Whidbey. By the time I get there, beta 2 should be available for download and it should be public knowledge that ObjectSpaces will finally be shipping as part of the whidbey release. I just got a preliminary build last night, so I'm going to try to do a demo of using a dataset with O/R mapping via ObjectSpaces.

    As you may have also heard, bundled into 2.0 Typed Datasets are Typed DataAdapters, also known as TableAdapters. In addition to TableAdapters, beta 2 will introduce typed forms, known as TypedForms. These will be precanned forms for both Web and Windows access that couples an easily painted form right on top of a dataset...with zero code. The cool thing about this is that you can simply add a column to your database table, and this will automatically change your data access layer, your middle tier entity and data entry forms. Likewise, you'll be able to simply drag a text box onto your TypedForms and this will automatically modify your database schema to add a new column to the table.

    There is also some discussion going on about also adding a TypedReport into the dataset that couples Sql Reporting Services Reports directly into your typed dataset class. This stuff is going to be so easy to use, that it is likely going to make it's way into InfoPath as part of the Office product so that end users can create their own data entry forms and reports in InfoPath. This new edition of InfoPath is going to be named “InfoMaker“. More information on this is available here. This new collection of classes in the dataset are now going to be collectively known as a "DataWindow". Again, more details here. No, it's not a snowy day hell. Hard to believe isn't it. This is surely a day to mark on your calendar.

    Say goodbye to Whidbey's System.Data.SqlServer namespace

    Pablo Castro writes in the new Data Access Team Blog that they are unifying System.Data.SqlServer classes into System.Data.SqlClient.

    If you are asking “What is System.Data.SqlServer?” the answer is that it's a ADO.NET managed provider for accessing SQL Server 2005 - from within SQL Server 2005 (managed procs, triggers, functions, etc.). Why a different provider? Well SqlClient uses a TDS (tabular data stream) external access protocol to connect to SQL Server. Obviously if you are already in SQL Server you don't want to go outside and back into your database. The SqlServer namespace provides similar classes (SqlConnection, SqlCommand, etc. etc. that work within the current context of your connection to the database.

    In the existing betas, MS was so nice to give them the same class names so that you might have an easy chance of porting data access code from client code to server code by changing the using/Imports <namespace> at the top of your class. You have a little bit of work to tweak your connection (if you really need one), but otherwise this porting process works pretty well. If you want the most efficient code, you also need to break your SqlCommands into static SqlDefinitions and SqlExecutionContexts for the actual executions. You also may need to output differently using the SqlContext's Pipe object.

    So the product team has decided to unify, removing the SqlServer namespace and making the SqlClient components serve dual duty. This magic switch happens simply by using a connection string of “context connection=true”.

    I have mixed emotions about this move. On one hand, it can make the porting process a bit smoother. You don't have to changing your using/Imports and you don't have to remove your connection object. It also means you'll instantiate SqlCommands the same way.

    On the other hand, it's not obvious to me by reading somebody's code if they are talking in-context to the  database, or out of context externally. In fact, this could very well switch based on a configuration setting for the connection string. The differences are not just related to performance, but also affect the transactional semantics. It would be very easy to switch code that is acting in-context as part of a transaction, to an external command that is not participating in a transaction by a simple configuration change. This is a big deal. I don't think transactional semantics should be a “configurable” thing. My opinion extends to the COM+ component catalog, but that is a whole other blog entry.

    This move ends up simplifying an API so much that a programmer's intentions are lost, and that's not a good thing. Pablo says this is coming in SQL Server Beta 3, but he wants your opinions.