Screencast: Building ASP.NET MVC Forms with Razor

[note: This screencast has been adapted from my earlier blog post.]

In this ASP.NET MVC Foundations screencast, we’re going to look at building an ASP.NET MVC page which allows users to create and edit objects in our domain. We’ll cover just the basics of using HTML helpers to map model properties to our HTML form and Model Binding to convert our HTML form back into our rich domain object.We’ll start with a very basic store website which has read-only data and we’ll add the ability to create and edit products in our store. Be sure to watch in HD mode for a crisp screen.

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

11 Killer Open Source Projects I Found with NuGet

So maybe I’m late to the party, but I recently started playing with NuGet. It’s a killer new way to find, install, maintain, and manage references to open source libraries in Visual Studio 2010. Plenty of people have written about it (Phil Haack and  Scott Hanselman for example). Let’s just say you should learn about NuGet if you don’t know it already.

What I want to talk about is all the cool open source projects I found just by flipping through the pages of the NuGet directory in the Visual Studio “Add Library Package Reference” dialog.

Continue reading

Webcast: NoSQL Movement, LINQ, and MongoDB

Note: The webcast is over, you can watch the recording above.

I’m happy to announce I’ll be doing a free webcast in the DevelopMentor webcast series on MongoDB, .NET, LINQ, and NoRM.

NoSQL Movement, LINQ, and MongoDB 
Tuesday May 25th – 11AM PST
Register here

I hope to see you there. We’ll be building out a website in ASP.NET MVC with MongoDB as the back-end using LINQ. There will be plenty of code so it should be fun and educational.

Cheers!
@mkennedy

MongoDB vs. SQL Server 2008 Performance Showdown

This article is a follow up one I wrote last week entitled “The NoSQL Movement, LINQ, and MongoDB – Oh My!”. In that article I introduced the NoSQL movement, MongoDB, and showed you how to program against it in .NET using LINQ and NoRM. You can also watch my conference presentation at MongoDB Seattle 2011 or this DevelopMentor webcast.

I highlighted two cornerstone reasons why you might ditch your SQL Server for the NoSQL world of MongoDB. Those were

1. Ease-of-use and deployment
2. Performance

For ease-of-use, you’ll want to read the original article.

This article is about the performance argument for MongoDB over SQL Server (or MySql or Oracle). In the first article, I threw out a potentially controversial graph showing MongoDB performing 100 *times* better than SQL Server for inserts.

“A potentially controversial graph showing MongoDB performing 100 times better than SQL Server”

We’ll see source code, downloadable and executable examples and you can verify all of this for yourselves. But first, here’s a new twist on an old proverb:

“Data is money”

Continue reading

The NoSQL Movement, LINQ, and MongoDB – Oh My!


Maybe you’ve heard people talking about ditching their SQL Servers and other RDBMS entirely. There is a movement out in the software development world called the “NoSQL” movement and it’s taking the web application world by storm.

“Insanity!” you may cry, “for where will people put their data if not in a database? Flat files? Tell me we aren’t going back to flat files.”

No, but in the relational model, something does has to give. The NoSQL movement is about re-evaluating the constraints and scalability of data storage systems in the light of the way modern web applications generate and consume data.

The outcry about flat files above is meant to highlight an assumption developers often have about building data-driven applications: Data goes in the database (SQL Server, Oracle, or MySql). Just maybe, if we are really cutting-edge, we might consider storing our data in the cloud, but the choices generally stop there.

The NoSQL movement asks the question:

“Is the relational database (RDBMS) always the right tool for data storage and data access?”

Continue reading

Webcast: Building Modern Apps in ASP.NET WebForms

At DevelopMentor we have been running a bunch of free webcasts. Last month it was  TDD and Agile. This month we are running 4 webcasts celebrating the announcements  around .NET 4.0, Visual Studio 2010, and PDC 2009.

Join me Monday, November 23rd and register here:

http://bit.ly/aspwebforms

Note: This event is in the past, but you can watch the recording here:

We’ll talk about integrating ASP.NET’s routing infrastructure into existing an ASP.NET WebForms application. This allows you to build SEO websites with URLs like

http://dotnet.ubbuzz.com/tag/.NET+4.0

while still taking advantage of all the productivity features of WebForms such as post-backs, controls, UpdatePanel, and so on.

We have room for a couple hundred more attendees so please register and be part of the fun. I promise lots of demos and some disdainful comments about PowerPoint!

Share it with your friends (social, virtual, real, and other types) using the widgets below!

ASP.NET MVC: What’s that, you’d rather hear about ASP.NET MVC, not this creaky old WebForms stuff? That’s Brock Allen’s talk: http://bit.ly/intromvc

WF 4: Is WF 4 and visual programming your thing? Check out Maurice de Beijer’s WF 4 talk: http://bit.ly/meetwf4

New Parallel Extensions your thing: Check out Andy Clymer’s PFX talk. (link to follow soon).

Cheers,
Michael

TDD Space Invaders Video and Downloads

Recently Llewellyn Falco and I did a webcast for DevelopMentor where we demonstrated some TDD techniques and introduced Approval Tests. We let the audience choose our project and they chose Space Invaders. It was all great fun. Now the videos and MP3 streams are online and available for download.

Be sure to check out the write-up we did afterward where we talked about the tools and gave you a chance to try it for yourself:

TDD Space Invaders Write-up

You can also watch two other, higher level agile webcasts by Bill Nazzaro here:

Agile Webcasts at DevelopMentor

Cheers!
Michael

 

TDD Invades Space Invaders

A joint post by Llewellyn Falco and Michael Kennedy

[Update: Get the videos and additional downloads for this webcast.]

As a follow-up to our “Avoiding 5 Common Pitfalls in Unit Testing” article we did a webcast where we took a problem from the audience and solved it live and unrehearsed on stage. These kinds of performances are always a risk but that’s part of what makes them fun.

Of course, the question is could we have done it better? Here’s your chance to try it for yourself (details below).

The Problem:

Our viewers chose to have us build the game Space Invaders. The first thing we had to do to sketch out a basic scenario we could implement. We started with a picture to remind what Space Invaders even was:

This was too big of a scenario for us to tackle in the allotted 40 minutes for programming. So then we started by creating a simpler scenario which we sketched out on the “whiteboard”:

Continue reading

Article: Building a Twitter Application in .NET

I recently wrote an article for DevelopMentor‘s Developments newsletter entitled Building a Twitter Application in .NET. You can read it at the DevelopMentor website:

http://www.develop.com/twitternetapps

I’ve republished here for my readers. Enjoy!


Building a Twitter Application in .NET

by Michael Kennedy (@mkennedy)
http://www.michaelckennedy.net

Twitter has become one of the web’s hottest properties. It is a central part of mainstream news programs such as CNN’s Anderson Cooper 360, congressional debates, and talk shows. In fact, it grew at a rate of 1400% this past year [bit.ly/jG9BG].

If your company wants to interact with your customers in a modern and engaging experience, you need to be on Twitter. In fact, if you have customers that really like or dislike you, they are probably talking about you on Twitter. You should be part of that conversation.

In this article, we will explore how to build a rich interactive experience on Twitter that goes beyond just creating a new Twitter account. We will build a .NET application that uses the Twitter API (a free service) alongside other cool technologies such as the WCF REST Starter Kit [http://bit.ly/v8mBb] and LINQ to fully leverage the Twitter experience.

Continue reading

Article: Avoiding 5 Common Pitfalls in Unit Testing

Llewellyn Falco and I recently wrote an article for DevelopMentor’s Developments newsletter entitled Avoiding 5 Common Pitfalls in Unit Testing.

You can read it at the DevelopMentor website:

http://www.develop.com/testingpitfalls

I’ve republished here for my readers. Enjoy!

[Update: We have also done a webcast demonstrating some of these ideas, which we wrote up here:

http://www.michaelckennedy.net/blog/2009/10/28/TDDInvadesSpaceInvaders.aspx]


Avoiding 5 Common Pitfalls in Unit Testing

by Llewellyn Falco and Michael Kennedy

When I started out with unit tests, I was enthralled with the promise of ease and security that they would bring to my projects. In practice, however, the theory of sustainable software through unit tests started to break down. This difficulty continued to build up, until I finally threw my head back in anger and declared that

“Unit Tests have become more trouble than they are worth.”

So we stopped. Not all once, but over the months our unit tests died a quiet death. When tests would stop working, we just ignored them. When new features were reported, they were developed without unit testing. At first, it seemed great. We were able to move without the baggage of maintaining the old tests! But soon all the original problems of having a system without tests came back to us. Things keep breaking, deadlines were increasingly pushed back. Releases came with an extraordinary amount of stress, late nights & weekends. The final straw came when we were forced to rush out an immediate update, and ended up taking down the company for 2 days straight. Our new motto became:

“Unit Testing: you’re damned if you do, you’re damned if you don’t.”

In the end, we decided that despite the hardship caused by maintaining unit tests, it just wasn’t feasible to operate without them. So we started down the road to re-incorporate testing into our software development process. As the months went by, however, we discovered that the hardships we remembered had not returned. Looking back, we realized that we had made many mistakes the first time around. The second time around we were smarter. So you, too, can enjoy the benefits of unit tests here are the 5 major pitfalls we encountered the first time around, and how you can avoid them.

Continue reading

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

RESTful Web Services with WCF Screencast

I recently got the chance to record a screencast discussing REST-oriented web services in WCF. If you’re interested in WCF you should definitely check it out because WCF and REST make an awesome combination.

I cover building WCF services using REST princples, the WebGet and WebInvoke attributes, working with the SyndicationFeed & Rss20FeedFormatter classes, and configuration-free WCF hosting in IIS.

You can also download the source code of the project built in the screencast.

Finally, if you’re willing to do without video you can download just the audio as an MP3.

Debugging the Future (Advanced .NET Debugging) Video Presentation

My esteemed colleague, friend, and fellow instructor at DevelopMentor Jason Whittington gave a great presentation on advanced .NET debugging recently at the Oklahoma City Developer’s Group. They luckily recorded it on video and published it on their website so that it may “live on in the Google“.

   Debugging The Future: The Video by Jason Whittington

If you want to debug .NET applications right down to their memory footprint, this talk is for you. If you like this type of presentation, be sure to check out the classes we offer at DevelopMentor.