11 July 2007

I Want My DinnerNow!

By Matt Duffin.

I have gained a bit of a reputation around the office. Far from the brilliant, enigmatic persona a bright-eyed Matt wanted to portray at the beginning of the placement, I’m seen around here as a bit of a - how should I put it - gourmand. My habit of hanging around after catered meetings to grab the last plate of brownies doesn’t help either.


So I guess it’s only fitting that my final Student Zine article should focus around that very topic!


DinnerNow is a fictitious marketplace where customers can order food from local restaurants for delivery to their home or office. So, that’s the food part sorted, but what’s all this got to do with Microsoft tools and technology?


The sample is designed to demonstrate how you can develop a connected application using several new Microsoft technologies - where ‘several new’ is a criminal understatement. DinnerNow features both the hot and the cool (no food references intended) of the latest Microsoft technologies, including IIS7, ASP.NET Ajax Extensions, Linq, Windows Communication Foundation, Windows Workflow Foundation, Windows Presentation Foundation, Windows PowerShell, and the .NET Compact Framework, and with those as a main meal, there’ll be no need for dessert [OK Matt, enough already! – Ed].

The sample is impressive not only because it’s a full end-to-end scenario using the latest Microsoft technologies, but also because you can grab the full source code! Head to http://www.dinnernow.net to get it. As of writing, the latest build is version 1.3 and it comes in two flavours: one for Visual Studio 2005 and one for those of you who’ve taken the jump and got your hands on Visual Studio Code Name “Orcas” Beta 1 (for a good introduction to Orcas, check out Paul Kiddie’s ‘.NET Evolved’ article in last month’s Student Zine).

Although both samples feature pretty much the same functionality, you’ll get some extra benefits from downloading the Orcas version – including examples of some new features of the upcoming .NET Framework 3.5: Language Integrated Query for .NET (LINQ) and LINQ-to-SQL, Workflow Services (codenamed "Silver") and WCF RSS services. There are also some Orcas-based standalone labs that revolve around the DinnerNow scenario, but don’t require you to download the full sample – these are great for skilling up quickly on specific technologies such as Using DLinq (Linq to SQL) with .Net 3.5, Syndication using WCF, etc.


If that’s not enough to persuade you to check it out, there’s also a great video on Channel9 showing the members of the team who built DinnerNow giving a demonstration of its features.
So, you’ve watched the video, grabbed the download and decided that you, like me, want your DinnerNow; where do you go from here?


Well first, sit back and relax. If you approach these things anything like how I do, you want to get stuck right in, hit F5 and see the sample in all its glory. However, there’re quite a few dependencies and you’ll need to set up the environment before you can get things moving. Fortunately, DinnerNow comes with thorough documentation (‘documents\DinnerNow.net Installation Guide’) and a Dependency Checker that will analyse your system for everything you need, and help you to download and install any missing prerequisites.

Unfortunately, when using the checker, I stumbled at the first hurdle. Because scripting is a very powerful tool, but one which can be misused for malicious purposes, Windows PowerShell includes an execution policy to protect user data and the integrity of the operating system. The default policy prevents you from running scripts, but some scripts are required to get DinnerNow working.


Although the Dependency Checker flags up the restrictive policy, the batch file that changes it to the correct setting appears to be missing from the install. You can change the policy manually by running PowerShell as an administrator (either by navigating to ‘C:\windows\system32\windowspowershell\v1.0’ or through the Start Menu) and entering ‘set-executionpolicy unrestricted’.


From that point onwards, getting the rest of the prerequisites is a simple matter of following the prompts in the checker. Once the checker tells you that you’ve got everything you need, execute ‘RunMe.bat’ as an administrator and it’ll go away to do the grunt work of setting up the database, configuring IIS and actually building DinnerNow.


Now you’re ready to get started!


The sample looks at the scenario of ordering, managing and delivering food from the perspective of four different classes of user: the customer, who’s going to order food from a variety of restaurants in their local delivery area using an ASP.NET AJAX website, the restaurant manager, who’s going to view the incoming orders and update their status using a WPF-based smart client application, the delivery driver, who’s going to receive notification of orders to be delivered using a mobile application, and an IT Pro, who’s going to manage the overall end-to-end solution using PowerShell management tools and MMC snap-ins.


Phew! That’s quite a tall order. Fortunately, the team has created a comprehensive walkthrough (included as part of the download, or available online at http://www.dinnernow.net/downloads/docs/DinnerNow%20Scenario%20Walkthrough.xps) that covers everything from starting the backend services and workflows that power DinnerNow, creating a CardSpace Information Card to log yourself on to the site as a customer, taking advantage of the rich Kiosk experience provided by WPF, finding out where to hop on your scooter and deliver an order, to analysing workflow loads and statistics.


When you get fed up of playing with DinnerNow as an end-user, delving into the code is very simple. Most parts of the sample are implemented as Visual Studio solutions and projects, and the code is nicely factored for readability (but could do with a few more comments, *cough*).


Anyone who remembers IBuySpy (a demonstration portal application built using ASP.NET) will remember how eagerly it was jumped upon, mutated and incorporated into online solutions existing today.


In the same way, it would be great to see what you guys make of DinnerNow, and what emerges from it! As always, if you’re using the codebase, or have any questions about the sample, we’re happy to hear from you at ukstuzin@microsoft.com.


Signing off for the last time, Matt.

 

Comments

# UK StudentZine Blog I Want My DinnerNow | Green Tea Fat Burner said:

PingBack from http://greenteafatburner.info/story.php?id=3378

07 June 09 at 10:11 PM
New Comments to this post are disabled
Page view tracker