Registration now open for Party with Palermo: Tech Ed 2008 Developers edition

If you are going to Tech Ed Developers, and you have a blog, add the badge below.  The Tech Ed party website is up.  Go RSVP now. 

Party with Palermo is the place to be when you get in to town.  Meet up with your friends at Party with Palermo.  If you would like to sponsor, the information is there as well.  http://teched2008.partywithpalermo.com/ 

 

Please add this badge to your website or blog to promote the event:

Party with Palermo

Registration now open for Party with Palermo: DevTeach 2008 Toronto edition

If you are going to DevTeach, and you have a blog, add the badge below.  The DevTeach party website is up.  Go RSVP now. 

Party with Palermo is the official kick-off social event of DevTeach Toronto.  After the pre-con, the conference will move to Party with Palermo Monday night.

If you would like to sponsor, the information is there as well.  http://devteach2008toronto.partywithpalermo.com/ 

 

Please add this badge to your website or blog to promote the event:

Party with Palermo

Video of Alt.Net Opening

For those not at the Alt.Net Conference, here are videos of the opening.  I’m not a pro video guy, so there is a green bar across the bottom.

Part 1

Part 2

ASP.NET MVC Framework – new build available – source includes unit tests

Just today, the MVC Framework team dropped the soure code refresh on its CodePlex workspace.  This includes a big controller base class refactoring along with other enhancements.

A big deal, also, is that the source code drop now includes the unit tests!  That’s awesome.  Great job Levi, Eilon, Phil and Rob!!

 

Now we have some work to do to upgrade MvcContrib and CodeCampServer to the new drop. 🙂

 

The biggest deal is that controllers and actions are now more DRY and more SRP and much more testable because of the ActionResult that action methods now return.

 

Keep in mind that the MVC Framework is still a work in progress so there are still many things that will change.

 

I’ll be reporting my findings with the new release, and from what I have found out this week at the MVP Summit, there are some big improvements.  I was also able to corner Phil Haack for a conversation, and when I started sharing my ideas, he was way ahead of me on almost all of them, so color me impressed.  Keep tabs at http://feeds.feedburner.com/jeffreypalermo

Action behavior using ASP.NET MVC and MvcContrib

This post is a quick rundown of action method behaviors.  This will be halfway obsolete with the next MVC drop on codeplex, but here goes:

You can download MvcContrib from http://mvccontrib.org.  The convention controller is there.  The ConventionController takes away nothing from System.Web.Mvc.Controller, but it adds some useful things on top.  My example controllers inherit from ConventionController.

First, To get an action method to fire and run, just make it public.  Now it’s web callable:

public class TwitterController : ConventionController
{
    public void SaveTweet(string tweet)
    {
        //integrate with twitter to do cool stuff.
        Response.Write("Wrote: " + tweet);
    }
}

If you run the above action with the default routes, you’ll get the error:

A public action method named ‘Index’ could not be found on the controller.

To fix that, we can add MvcContrib.Attributes.DefaultActionAttribute and to to the url:  http://localhost:1308/twitter?tweet=howdy

 

[DefaultAction]
public void SaveTweet(string tweet)
{
    //integrate with twitter to do cool stuff.
    Response.Write("Wrote: " + tweet);
}

And the output is:

Wrote: howdy

 

Now, what if I didn’t want the SaveTweet method to be web-callable.  Perhaps it’s a public method on a controller that isn’t an action.  I can added System.Web.Mvc.NonActionAttribute, and I’ll navigate to http://localhost:1308/twitter/savetweet?tweet=howdy.

 

[NonAction]

/twitter/savetweet?tweet=howdy.

{
    //integrate with twitter to do cool stuff.
    Response.Write("Wrote: " + tweet);
}

Then I get the following error because now SaveTweet is not an action method:

A public action method named ‘savetweet’ could not be found on the controller.

 

Now, finally, if we look at the method name, we can see that SaveTweet(string tweet) is a non-repeatable action.  It has side effects.  It’s pushing a tweet to twitter.  We probably don’t want that to happen with a GET.  In other words, we don’t want the mere act of navigating to /twitter/savetweet?tweet=howdy to cause a backend change in the system.  Because of this, it’s reasonable to restrict this action to POSTs only.  We can do that by using the MvcContrib.Attributes.PostOnlyAttribute:

 

[PostOnly]
public void SaveTweet(string tweet)
{
    //integrate with twitter to do cool stuff.
    Response.Write("Wrote: " + tweet);
}

 

If we attempt to run this with a GET, we’ll see the following error:

Action ‘SaveTweet’ can only be accessed using an HTTP Post.

 

I’ve given a quick rundown of different ways to use action methods.  Note that the ASP.NET MVC Framework is still in flux, and things will still change dramatically.  I, and others, are expressing our constantly evolving understanding of how to use the ASP.NET MVC Framework as time goes on.  This understanding is expressed in the MvcContrib and CodeCampServer.  You can follow my understanding process on my feed at http://feeds.feedburner.com/jeffreypalermo.

Also follow Phil Haack, who is a PM steering the evolution of the framework.

Where you can find me this spring

MVP Summit 2008:  Tomorrow I pray to God that American Airlines doesn’t cancel my direct flight from Austin to Seattle for the 2008 MVP Summit where I will host another Party with Palermo.  As of this morning, over 220 have RSVPed for the party on April 13th at 7PM.  Eat supper before you come because the finger food will go fast!!  If you haven’t RSVPed, please do so now so I have the best count possible.

I’m also facilitating an open space session on Tuesday afternoon of the MVP Summit.  My accepted topic is:  “Why cheap developers are expensive and the unspoken quality variable.”

ALT.NET Seattle:  Next Friday and Saturday, I’ll be attending the ALT.NET Conference in Seattle.  My goal will be to keep my mouth shut and absorb ideas from folks I don’t have the benefit of being in constant contact.

Agile Boot Camp:  April 3 – May 1, I’ll be teaching another Agile Boot Camp, an agile developer training class put on by Headspring Systems.  There are still a few spots available.  Mike Palermo blogged about his experience at the March training.

DevTeach Toronto: May 12th through 16th, I’ll be speaking at DevTeach as well as throwing another Party with Palermo on the first day of the conference.  The RSVP site will go up right after the MVP Summit PwP.  I’ll be speaking on software configuration management and the ASP.NET MVC Framework.

Austin Code Camp 2008:  If I get back from DevTeach in time, I’ll drop in to the Austin Code Camp hosted by the Austin .Net User Group.  I won’t be speaking since I might not be back in time.

AgileAustin Open Space:  I’m on the board of directors of the AgileAustin group, and we are holding our first conference on May 30, 31, and June1.  It’s in Austin, TX, and you can see the website here.

TechEd 2008 Developers:  Yes, I’ll be throwing the biggest Party with Palermo of the year at TechEd 2008 Developers.  Last year saw 435 in attendance, so we’ll see if we can break the fire code this year!  I have not set up the registration site yet, but it will go on www.partywithpalermo.com.  If you are interested in sponsoring this blowout bash, contact me at any time.  It’s going to be huge!

I’m also speaking at TechEd Devs.  Unfortunately, Doug Seven cancelled by Blackbelt Software Configuration Management breakout session in the development practices track because I don’t use Team System.  I’m giving two talks in the Architecture track on architectural concerns of 1) the ASP.NET MVC Framework and 2) Object-Relational Mappers with examples using NHibernate.  See the list of sessions here.  There are 20 architecture track breakout sessions, so it’s easy to find my 2.

I’m also hosting a Birds of a Feather session of Agile Development with .Net.

I’m looking forward to the summer when things settle down a bit so that I can devote more time to my book, ASP.NET MVC in Action with Manning.

As always, you can subscribe to my feed at http://feeds.feedburner.com/jeffreypalermo