Slides and demos from DevWeek 2013

[Update: I added the downloads for the demo code on March 12th.]

I had a great time discussing these topics with everyone at DevWeek 2013. Thanks to all who attended my sessions. Here are the slides:

Getting Serious About The Cloud For Developers
Slides: Getting serious about the Cloud (DevWeek).pdf
Demos: CloudDriverS3SecureFiles-Demo-DevWeek-Kennedy.zip

18 Ways Your Brand-New MVC Web Application Can Be Better
Slides:More Ways MVC Better (DevWeek) – Kennedy.pdf
Demos: 18WaysMvcNewProjectBetterDemo-DevWeek-Kennedy.zip

Building Rich Forms in ASP.NET MVC (important - see note below)
Slides: Rich Forms with ASP.NET MVC (DevWeek).pdf
Demos: Rich-ASPNET-Forms-Demos-Michael-Kennedy.zip

Applied NoSQL in .NET (important – see note below)
Slides: Applied NoSQL in .NET (DevWeek).pdf
Demos: Applied-NoSQL-in-dotNET-Demos-Michael-Kennedy.zip

Important note: In order to run this demo, you must download MongoDB and start it on your local machine. You do not need to initialize a database or anything like that but the db will be empty so use the admin feature to create categories and books. Running MongoDB as a Windows Service is not required.

Cheers,
@mkennedy

Preventing JavaScript Files from Loading Multiple Times

This post is about ensuring that you do not execute a particular JavaScript file more than one time. Let’s start by asking:

What happens if you link to a js file twice in your page?

Here is a contrived example.

Notice that we are including bad-example.js twice. Do modern browsers somehow realize they loaded this file already and skip this? Not yet, as we’ll see!

Imagine bad-example.js had this code in it. Continue reading

Join Me at Guerrilla .NET in November

Just a quick announcement for an developer upcoming event I’ll be participating in…

Early November I’ll be co-teaching DevelopMentor’s biggest .NET developer event of the year in Los Angeles: Guerrilla .NET. If you haven’t been to Guerrilla .NET, it’s a very unique and memorable event – it’s unlike almost any other training class you’ve seen. We’ve just updated the outline with the most important current and upcoming technologies (see below).

I hope to see you there! Feel free to contact me with any questions.
@mkennedy

Guerrilla .NET
November 5th-9th
in Los Angeles
    Newly Updated with: Windows 8, VS 2012, MVC 4 and Entity Framework 5.

Guerrilla .NET provides a deep exploration of .NET design philosophy and practical advice. You learn a myriad of patterns and best practices, and you get hands-on experience developing applications using Visual Studio 2012 and Windows 8. Learn to write code using new .NET class libraries like Entity Framework 5, MVC 4, and even the new Windows Runtime (WinRT).

Course Topic Highlights:

  • Windows 8 For The Developer
  • LINQ and Entity Framework 5
  • XAML-based Programming
  • ASP.NET MVC 4.0: Beyond the Basics
  • Introduction to jQuery
  • Model-View-ViewModel for WPF and Metro
  • Building RESTful Services with The ASP.NET Web API
  • Programming Win8 Apps: Metro / WinRT
  • Entity Framework 5 and Code First
  • PFx: Task: a Unified Threading API
  • PFx: The Parallel Class and Concurrent Data Structures
  • C# 5.0
  • What’s New in .NET 4.5
  • Cloud Computing for the .NET Developer: IaaS, PaaS, and Patterns
  • Applied NoSQL with LINQ, and MongoDB
  • KnockoutJS
  • Power Debugging
  • Design Patterns for Testable Applications
  • Topic X

No, You Don’t Need A Windows App

Do you think you need a Window’s app for your next project? Here’s a thought: No you don’t.

Let me give you one less reason choose the rocky-road of desktop apps today. You’ll hear people tell you that if you build applications for business users (so-called LOB apps) that are input heavy or have complex navigation, your only choice is to build a Windows application.

Why? Because your power users will want hot-keys. They don’t want to use the mouse and navigation and all that stuff that makes the web less usable. They’ll just want to hit a few keystrokes and jump from place to place and do that quick look-up or data entry.

If you haven’t looked carefully around the web lately, here’s a revelation:

Real web apps have hot-keys too.

Continue reading

Building a Cloud OS for .NET Developers – Part 2

In Part 1 of my Building a Cloud OS for .NET Developers series, I talked about setting up a pure cloud OS focused on developers. But the one crucial aspect I left out was the developer tools.

In this second installment, we’ll be covering exactly that. How do we manage having Visual Studio and associated tools and servers universally accessible in the cloud, even on mobile devices such as iPads?

Continue reading

Building a Cloud OS for .NET Developers – Part 1

Let’s talk about cloud operating systems. This article explores the options and potential of moving entirely “To The Cloud” for developers who normally demand significant offline power from their applications (IDEs, compilers, debuggers, etc). We’ll focus on .NET / Visual Studio developers, but I’m sure you can adapt this to your technology of choice.

I’ve been fascinated with what Google is doing with Chrome OS. I think finding a way to fully “live in the cloud” has a lot of promise. However, in practice Chrome OS is entirely unappealing to me. It’s just a single browser window, maximized. Yuck. I don’t mind doing most things in the browser, but I’d like multiple non-maximized browser windows and a desktop to organize things like shortcuts. That’s OK though because Chromebooks aren’t the only option. We have decent operating systems right now that can function largely in the same way if we set them up with discipline.

Continue reading

Building Windows Machines in Amazon EC2

In this article I’m going to give you a simple, step-by-step overview of how to create a Windows 2008 server image in Amazon’s Elastic Cloud Compute (EC2) infrastructure. Now I must admit I’d rather have found a good tutorial on The Internets or even in a book. Feel free to send me any I missed. My experience is they are either dated or about Linux and so on…

First, briefly why does one care about EC2? Well maybe you are buying into the whole cloud computing story which lets you cheaply out-source your computer hardware for amazingly cheap prices (staring around $0.20 / hour for a dedicated machine). That’s a great reason and Microsoft and Google have interesting plays there too.

Personally I just want a simpler way to create virtual machines. We’ll have full admin access over remote desktop to our system to install whatever we want. I’m putting Visual Studio 2010 Beta on mine to play around with that software without ’polluting’ my real system.

Here we go. If you don’t delay I suspect this would take you about 20 minutes from start to login! Subsequent virtual machines are much faster to create and launch because the can be based on pre-configured images.

1. Create an Account

Register for an Amazon Web Services account at http://aws.amazon.com/.

Continue reading

Azure Interview on SearchCloudComputing.com

Rob Barry and Jack Vaughan interviewed me for their article on SearchCloudComputing.com entitled

Azure cloud on horizon: The devil is in the data architecture details

Here’s a small excerpt. If you’re interested in Windows Azure and Cloud Computing, read on…

Microsoft did a good job when they designed Azure, according to Kennedy. “The company encourages you to build scalable reliable systems by basically making it really hard to do the stuff that makes systems unreliable,” he said.

There are many developers curious about cloud computing, but most are being rather cautious. Directions on Microsoft’s Sanfilippo said he’s talked to more developers that are concerned about building on top of their existing work than re-coding everything to work in the cloud.

“There’s still an education bit that has to happen about what kind of applications are appropriate for Azure. But I think there’s a lot of curiosity about Azure,” Kennedy said.

Still, he continued, “I don’t know many projects that are betting the bank on Azure yet.”

Note: This is a little dated as it was publish in July 2009 – some how I missed the original publication – but it’s still an interesting read.

Thanks Rob and Jack for the article and conversation.

ASP.NET Routing in Windows Azure Using WebForms

[Update: If you are using ASP.NET 4 and .NET 4, Microsoft has added direct, built-in support into the Page class (the foundational class for WebForms pages). See Scott Guthrie's post on this topic: URL Routing with ASP.NET 4 Web Forms (VS 2010 and .NET 4.0 Series).]

I’m a huge fan of ASP.NET Routing. It gained popularity as the part of ASP.NET MVC which channels requests for a given URL to the right controller action. In a wise move, Microsoft moved the routing infrastructure out of ASP.NET MVC and
into its own assembly with the release of .NET 3.5 SP1.

With ASP.NET Routing you can construct search engine optimized and human friendly URLs such as these:

Here part of the URL (tag or user) selects the page and part of the URL (everything or codinghorror) are effectively query parameters to the page.

This is well documented in the ASP.NET MVC world running on your server – you can’t get anything done without it in MVC. But what about Windows Azure? What if you don’t want ASP.NET MVC? What if you’re a traditional type of person and want all the goodness that comes with what is now called ASP.NET WebForms (aka “normal ASP.NET”)?

In this brief post, I’ll cover how to use ASP.NET routing and ASP.NET WebForms in Azure. The sample project can be downloaded if you want to follow along. Phil Haack has
written a good post on using routing alongside ASP.NET WebForms so I won’t cover too much background information.

How does this change for Azure?

The short answer is that it doesn’t. If you get routing working for IIS 7 in your web app, you can effectively deploy it to Azure. But the steps always felt convoluted to me when reading others’ write-ups on this. So let’s run through converting a Windows Azure Web Role  essentially a “stock” ASP.NET WebForms app) to use routing in Azure.

First you’ll need the Azure SDK and Visual Studio tools:

  1. Next, create a new solution in Visual Studio by choosing Cloud Service->Web and Worker Cloud Service.
  2. Add a new Global.asax file to your web role project.
  3. Add a reference to System.Web.Routing and System.Web.Abstractions in your web role project.
  4. Define a custom class that derives from IRouteHandler which will map URL parameters into the HttpContext for use in your pages:
    Continue reading

Article: Azure Storage

I recently wrote an article for DevelopMentor’s Developments newsletter entitled Azure Storage. Read it at the DevelopMentor website here:

http://www.develop.com/content/newsletters/aprilazure

I’ve republished here for my readers. Enjoy!


Developments: Azure Storage

by Michael Kennedy

[Listen to this article as a podcast: Azure-Storage-Article-Kennedy.mp3]

October 27th 2008, Los Angeles CA – It’s 9 AM and Microsoft is hosting PDC (their most forward looking developer conference). Ray Ozzie and company are introducing Windows Azure: A new platform which is their first foray into the nascent world of large-scale utility computing. This scalable and reliable platform-as-a-service functionality is commonly referred to as ”Cloud Computing” because it runs somewhere out there on the Internet.

Computing platforms that rival the reliability of the utility grids (e.g. electric and gas) which we daily take for granted have long been the stuff of dreams.

A few companies have realized this dream – Google and Amazon come to mind as a couple of the rare exceptions who have accomplished this goal. These companies’ web properties seem to handle unbounded amounts of traffic with zero down time. The data centers, redundancies, software engineering and operations know-how required to make this happen are exceedingly expensive. Some reports have Google spending over $2.4 billion (that’s 2,400 million dollars) on data centers in 2007 alone.

Prior to large-scale cloud computing efforts (circa 2005), most of us could only dream of such scalability and reliability. Today we have at least three highly reputable companies offering some kind of pay as you go cloud computing platform – Microsoft, Amazon, and Google.

Microsoft’s Azure is a new comer to the industry. But for .NET developers, it is not to be ignored. Azure allows you to use your existing skills to build essentially the same .NET applications you are familiar with and “deploy them to the cloud.”

These scalable, reliable, and geographically-replicated applications that run on Azure depend on data of course. Virtually all applications we write will be nothing without their underlying data. But if we simply use the tried and true methods of data storage such as the file system or a (single) database server our data is not all that scalable or reliable. Because we cannot have a scalable and reliable application without data, we need a new mechanism for storing and accessing data from our Azure applications.

Enter Azure Storage

Continue reading

Just Launched: .NET Dev Buzz

I just launched the beta version of an entirely differnet kind of .NET community website:

.NET Dev Buzz
Bringing you absolutely fresh conversations about .NET and the Microsoft developer community.

http://dotnet.ubbuzz.com/

I’ll follow this up with some highlights of a bunch of interesting .NET concepts being used here.

For starters, consider this. This is a website built in ASP.NET web forms, but there is no view state, no form posts, and no (visible) aspx files. It’s fully RESTful.