views:

576

answers:

11

I've been using ASP.NET MVC for personal projects since before it hit RTM.

I am preparing a presentation for my colleagues to introduce them to basic concepts of ASP.NET MVC and show them how it could be used in our environment.

My presentation has a 15 minute limit. There is a lot of information to relay (especially if you factor in projects like MVCContrib and various blog posts).

What topics should I focus on?

Some context: I work for a digital agency. My colleagues are .NET developers with 3+ years of ASP.NET experience.

What's been suggested so far:

  • Reasons for wanting to switch to ASP.NET MVC
  • Routing
  • ActionResults (ability to serve different responses)
  • Request-Response internals
  • Testability
  • Scaffolding (T4 templates)
  • Fine-grained control over HTML output
  • Separation of concerns ()
  • Differences between ASP.NET and ASP.NET MVC
+5  A: 
  • Routing
  • The flexibility of ActionResults
  • Hooking up different Views to the same Controller Action (i.e. a Mobile view)

The big Topic of Unit Testing may be too big for a 15 Minute meeting, but if your developers are already using TDD I would add it

Michael Stum
+1  A: 

Explain them that:

  1. There are no server controls anymore

  2. There is no event-mechanism anymore

  3. There is no ViewState anymore

  4. Now they won't get away with comfortable WebForms and will have to learn the basics of HTTP, HTML/CSS and JavaScript

Prepare some medicines for those who will faint.

(5). Now it is not about pages, but about resources (REST model). URL will not point to a physical file (.aspx) but to a controller action which may serve back different kinds of responses - a page to render, a short xml as an Ajax response etc.

P.S. If you have something like company-internal framework which facilitates many common operations and it is built with WebForms, you will likely not persuade them to adopt MVC since it means lots of work, dramatic changes in the thought patterns and likely a significant amount of time/costs.

EDIT: For those who asked for positive points...

(6). SEO-friendly Urls out of the box, without the need for third party utilities for Url rewriting.

(7). Complete control over your HTML output. No ViewState payload, no injection of auto-generated IDs => clean markup + smaller pages sizes => less traffic consumption + shorter response times.

(8). A possibility for a clean transparent design of an application (even with multiple layers). Instead of hacking with each control separately in code behind, you are in a better position now to design an architecture with understandable and traceable flow of data - from the database layer over business logic until it reaches the view. Much better compared to ubiquitous WebForms coding style when each control goes directly into the database to get some data to display. Not necessarily that you manage a clean design, but at least the MVC concept makes it cleaner for you now how to do it right.

User
All negative points and no positive ones. Thats going to be a miserable 15 minute presentation. All of this taken away for what benefit. In 15 minutes benefits and key new concepts are really all you have time for.
AnthonyWJones
+4  A: 

You only have time for 2 or 3 main points.

The most important concept to grasp is that requests arrive at controllers then the controller chooses what view to present the results the controller has generated.

The next important concept is that MVC has its big win over the "classic" ASP.NET when you create unit tests for your controllers and the model. Without this MVC is just another way to skin a cat.

For a final point I would focus on the structure of URLs not because its that important but because we like things that have a clean feel and MVC Urls can do that, this may help generate a positive response.

Avoid going on about there being no server controls (which isn't entirely true) since that is likely to elicite a negative response. In general avoid mentioning what is doesn't do compared with ASP.NET forms (although there not being any need for Viewstate is worth mentioning in passing). You know that the benefits out weigh the things that are missing (or unnecessary) but your audience does not. Keep it positive.

AnthonyWJones
+1  A: 

I'd grab their attention with routing, that's the most obvious stuff (and it is not confined to MVC). I'd then look at the higher level view and talk about separation of concerns, testability and mockability.

If I were you I'd head over to ScottGu's blog and use his excellent material:-)

Steve Haigh
+1  A: 
this. __curious_geek
+1  A: 

If they have been using ASP.NET they might not be familiar with the MVC architecture to begin with and you might have to talk about that a little bit.

Since they are all developers and you have only 15 minutes, I would suggest you show them File > New for ASP.NET MVC project and briefly talk about the scaffolding. That's a big sell for MVC in that it works off the go and you are already set up for iterative development.

After that you could switch to a working demo of a simple application. For this I would step through the application with a debugger from routing in global.asax to controller action to model and eventually back up to the view. This will bring up interesting questions and explain the new application life cycle including SoC, MVC, L2S, etc. This will also implicitly highlight the differences between ASP.NET MVC and ASP.NET applications.

If you have wfetch (or Fiddler or Live HTTP Headers) then I would show the client side request as well and highlight the absence of view states and highligh the POST/GET verbs (PUT/DELETE if you are using wfetch). Maybe mention the usefulness of this in AJAX apps.

Anticipate questions on how to migrate the current app and what the value proposition is for your current use-case scenarios.

aleemb
A: 

A blog in 15mins :-). Seriously, maybe focus on the seperation of concerns ?

Morph
I think he was saying: Write a Blog (Software) in 15 Minutes using MVC.
Michael Stum
Yes, that's what made rails famous a couple of years ago.
Morph
+1  A: 

Check out the ASP.NET MVC Training Kit.

It includes a pre-canned (albeit 60 minute) presentation that you can hack around with.

It focuses on:

  • Seperation of Concerns
  • Testability
  • Control

I actually did something similar (although it was about 45 - 60 minutes including demo) just before this came out, and the key take home for us was really:

It gives you back control of the HTML mark-up.

The testability etc was fairly understood already, but that was seen as a key benefit over standard ASP.NET.

Zhaph - Ben Duguid
Thanks Zhaph - I'll have a look at that
Arnold Zokas
A: 

Ofcourse the first and most important thing is separation of concepts, which gives: 1.More transparent design which is easier to understand and manage. 2.Convention over configuration. Which speeds up development and reduces coding/design practice differences among developers. 3.Development patern already weaven into application design itself: You develop models, then controller, then views. Change and test them separately(maybe with dedicated developers).

But let me say if they given you only 15 minutes they really dont want to hear about it or use it for that matter ;)

A: 

I think that generally best approach when you want to present some new technology is to make a simple example that will explain some of the cool features.

You can create example of simple mvc application with 2 different views of the same page and 2 different controllers. One controller you can use for async operations and second for normal requesting. One view can be normal view, second view can be view optimized for mobile phones. It is few hours of work and with this example you can cover all of the cool features of asp.net mvc:

-routing -testability -flexibility and Separation of Concern

cheers

Marko
+2  A: 

You've gotten all sorts of points - my question is, why do you think you want to use it in the first place, and how do you think it will help you and the rest of the development team in your environment? The bullet points are useless if they don't apply to your situation.

Lurker Indeed