Is the Nerddiner walk-through suitable for ASP.NET MVC 2? - asp.net-mvc

I'm keen to teach myself ASP.NET MVC 2 (coming from a heavy embedded or rich GUI background). If have found the nerddiner walk-through but it is still for ASP.NET MVC 1. The codeplex downloads have been updated to MVC 2 but the link for the PDF goes back to the MVC 1 book.
Is it even possible to follow the walk-through in MVC 2?
If so, what technologies does it skip? (e.g. LinqToSql instead of EF?)
Is there an updated PDF (other than getting the whole Professional ASP.NET MVC 2 book)?
EDIT - the answer seems to be universally that the v1 tutorial is good enough for learning v2. As it happened, I downloaded the sample chapter of the new book from Amazon onto my Kindle DX and found that the tutorial has been updated to EF. Because I don't personally like learning something (e.g. LinqToSql) that has been superseded - I've clicked "Buy" - Damn you Amazon for making it so easy to spend my money :-)

There's no updated PDF version but the MVC 2 version of the book is coming out this might be updated.....
However if you go through the nerd dinner walk through 99.9% of what you read applies to MVC 2. MVC 2 just adds more functionality that won't be covered but there's plenty of blogs around that cover MVC 2 functionality - check out Scott Guthrie or Phil Haack for details.
As far as technologies skipped the nerd dinner PDF uses LinqToSql whereas the MVC 2 sample uses Entity Framework. Both are valid forms of data access and are similar so if you start on LinqToSql you probably will pick up Entity Framework easily.

I did exactly what you want to do and it worked fine. Nerd Dinner is a great place to start if you are trying to learn MVC. All of the fundamentals are there and you won't miss too much. What you will find after finishing Nerd Dinner is that is will give you a great understanding of MVC but you will want to go to the next level and learn more. So even though Nerd Dinner is not MVC 2, it is one of the best tutorials I found to learn the basics of MVC in general.
So to answer your questions:
Yes, you definitely can go through Nerd Dinner with MVC 2
I wouldn't worry too much about what is missing if you are just learning, just go through it and things will become clear and you will have many more questions after that
I don't know if there is an updated version of the pdf but I would rather doubt it. I think Nerd Dinner was designed as a starting point to learn MVC.

Related

Design Patterns in ASP .NET MVC Application

Can somebody give me a link to article or name of book, where i can find something about Design Patterns in ASP .NET MVC applications? Sry if i asking for something stupid, i'm not expert in this.
I'd recommend Steven Sanderson's book for how to use MVC (probably worth waiting for the MVC 3 version which is due soon)
Otherwise I'd look at general design patterns books like Head First Design Patterns as these still apply within MVC.
Do you have a more specific question around a particular design pattern?
MVC itself is a design pattern. You can use several combinations of other design patterns in your application to suit your particular needs.
If you want a read an excellent book on ASP.NET MVC then I would recommend Steven Sanderson's book - http://www.amazon.co.uk/Pro-ASP-NET-Framework-Steven-Sanderson/dp/1430210079
Note: This book is available for MVC2 as well, but I have not read that one. This book uses several good concepts that will help you create a production ASP.NET MVC application including TDD, repository pattern etc
The official Microsoft website is actually very good for this. http://www.asp.net/mvc. I actually used Rob Conery's MVC store front video to get started (http://www.asp.net/mvc/videos/aspnet-mvc-storefront-part-1-architectural-discussion-and-overview). He goes through the repository pattern and a few other good practices for MVC, it's a little outdated now in some areas as it is written in MVC 1 but a lot of the points still hold.
Dino Esposito and Andrea Saltarello have a very good explanation and demystification of the MVC pattern on their book "Microsoft .NET: Architecting Applications for the Enterprise". I've got a review of the MVC chapter of their book in my blog

ASP.NET MVC Workshop

I am an MVC developer since ASP.NET MVC Preview 1 and my company chose me as an instructor for an MVC 2 workshop. The session will last for 3 hours and I have not yet decided about the contents of the workshop.
What would you tell about MVC 2 in 3 hours to grab and keep the people's attention?
Thanks.
You should watch some of the presentations on Channel 9. And pick some topics that they go over...
Basics
NerdDinner
It will depend of the kind of people will watch your workshop, it they are familiar with ASP.NET, ASP.NET MVC or the MVC pattern, etc.
I think that the first and bigger concept behind the MVC is the separation of concerns, and you should show it and how it can help the developers, specially with the TESTING issue.
If people are not familiar with MVC, only this part would take a good time. If they're familiar and you want to talk specifically about the version 2 of the framework, I think the bigger changes from the previous one were:
Areas
Template Helpers
DataAnnotation Attributes
Model validator
With few examples, once 3 hours is few time to get deeper in each of these points. Would be nice to develop a few app live so they can see how easy it is.
after introduction of mvc framework u can go on to include following topics
Routing (route constraints matching and custom route handlers)
Model validation and custom
validation attributes Security and authorization attributes Model
binding default model binders and writing custom model binders
custom html helpers
Take a look at 13 extensibility points of mvc
Read Steven Sanderson's book, especially the bit about glib demos that don't tell the real story.
Some people suggest Nerddinner, but why not just point them at Hansellmann's video on the subject? To be honest, you need Nerddinner to get an impression of how MVC works, and Steven Sanderson's book to get an impression of how to use MVC.
Still, I really don't think that this is a valid question, and don't know why the Stackoverflow police have not jumped on this one.
Check out some of the presentations here: http://www.asp.net/mvc
Scott Hanselman has a 73 minute one on the home page, that might be a good one to start with and mimic, as well as some of the other ones.
Why not take them through building NerdDinner? http://www.wrox.com/WileyCDA/Section/id-321793.html
Some of the Scott Hanselman videos out there on MVC are good, too, and might give you a small break from talking.
One thing I would cover is the flexibility of MVC. E.g., you have your choice of models and view languages. I would definitely cover the Spark View Engine, to give people an idea of how they can get away from code-centric (as opposed to markup-centric) view languages.

Starting Asp.Net MVC with VS2010 and MVC 2

I am starting out with MVC on VS2010 RC, having done a lot with Web Forms previously, and have been working my way through various tutorials and guides for MVC 1.
My question is, is it worth buying an MVC 1 based book for use with MVC 2, or are they significantly different that that would make it confusing?
The reason I ask is because the MVC 2 books I am looking at are not due for publishing for another few months, and I haven't come across any major issues while doing the Nerd Dinner tutorial - however, I am coming to the edge of what tutorials can give me, and would like an indepth book on the subject.
Regards
Moo
The best MVC1 book I have read is Steven Sanderson's Pro ASP.NET MVC Framework. He is currently working on a new version which will be about MVC 2. The book is scheduled to be released in May 2010, but in the mean time you can have a look at his video series about MVC 2 on Tekpub. I haven't watched them myself, but if they're as good as his book, they'll be well worth the money.
I'd say that the concepts will help, but there are lots of new functions in MVC2. Have you looked at Nerd-Dinner Codeplex site? (http://nerddinner.codeplex.com/) that should have been updated to MVC2.
However there are alot of resources online - if i'm honest I find more detail online than in books, but thats the kind of person I am. What are you looking at, thats not in the online guides?

Recommendations for learning ASP.NET MVC from a desktop developer's perspective

One of my New Year's Resolutions is to finally learn some web development. I've decided on ASP.NET MVC as I'm a believer in TDD and IoC. I'm looking for a list of topics and perhaps an order to learn them for what I'll need to know to be a solid ASP.NET MVC developer. Perhaps this is embarassing, but the only web experience I have was html pages I made using WYSIWYG editors 5+ years ago when I was in college.
So first, congratulations on picking ASP.NET MVC. I dare say that ASP.NET MVC is easier to work with than WebForms. WebForms tends to take somewhat of a "black-box" approach to the web and treat it more like classic WinForms development. WebForms would probably be a slightly more comfortable technology for you (coming from WinForms development) but MVC will leave you with a greater understanding of how the web works, which is incredibly important.
Before you dive into ASP.NET MVC, you may want to brush up on the basics of HTTP, because it is important to understand when you starting writing action methods that respond differently based on request verbs. It's also nice to know exactly what HTTP headers are, and how they can be leveraged in your application. Anyway, here's my list for you:
Important People and Their Blogs
Phil Haack: He is the lead developer on ASP.NET MVC, and his blog has tons of neat tricks and tips for using it.
Scott Hanselman: He worked with the team on NerdDinner and from time to time his blog has some neat MVC stuff.
Rob Conery: Rob's an avid promoter of ASP.NET MVC and an active open-source contributor. He has tons of code on github for you to browse for inspiration/guidance, and he also has tons of screencasts on his blog and on his business website, TekPub. I recommend purchasing his screencasts from TekPub because he's just an amazing presenter and makes understanding ASP.NET MVC so easy.
Scott Guthrie: He wrote the first chapter with respects to NerdDinner in the Professional ASP.NET MVC 1.0 book, and he always has some cool posts about new features coming in ASP.NET MVC.
Steven Walther: It seems like every time I look at his blog he's got another cool trick or code snippet related to ASP.NET MVC. He's also written a book on ASP.NET MVC that has some pretty good reviews on Amazon.
Reading Material
WDVL: HyperText Transfer Protocol: Again, this is your HTTP tutorial. I've read through part of it and it seems pretty decent. You don't need a rock solid understanding of HTTP, but a general overview of request verbs and headers specifically will help you.
NerdDinner.com Tutorial: This is lengthy step-by-step guide written by ScottGu himself about how to create a basic ASP.NET MVC website from beginning to end.
Profesional ASP.NET MVC 1.0: This is a book by the team that wrote this ASP.NET MVC, and it really does a great job of explaining the framework.
ASP.NET MVC Framework Unleashed: This is Steven Walther's book on the framework. It has some decent reviews on Amazon, though I've never read it myself, so I couldn't really give my opinion one way or the other.
Screencasts
Rob Conery's MVC Storefront Series: These screencasts are amazingly helpful. In the beginning they were working against pre-release copies of the MVC framework, so some stuff has changed, but they're still amazing material for learning ASP.NET MVC.
Scott Guthrie's Presentations on ASP.NET MVC 2: Look at the ASP.NET MVC section of this page. There are some really neat new features coming in ASP.NET MVC 2, and Scott actually builds a good foundation from the ground up with this presentation. He takes you through beginner stuff first and then shows the neat new tricks later.
Phil Haack's MIX09 MVC Session: Great content here straight from the man himself. Phil's actually a great presenter, and there's a lot of good content here.
Phil Haack's MIX09 Advanced MVC Session: Some more advanced stuff and neat tricks from Phil.
Scott Hanselman's File -> New Company MIX09 Session: I actually attended this session while I was at MIX09, and Scott's a great presenter. Well worth a gander :)
Rob Conery and Steven Sanderson TekPub Screencasts: These aren't free, but they're worth every penny. Rob and Steven are amazing teachers, and I can't recommend TekPub screencasts enough. They are top-notch.
IoC and Dependency Injection
Since you mentioned IoC specifically in your OP, there are a few libraries and blog posts that might help you with that:
Simone Chiaretta: How to use Ninject 2 with ASP.NET MVC: I actually use Ninject in my own personal projects, so this is a great resource if you're a fan of Ninject.
Rob Conery's "Hana" Source Code: Sometimes I just love seeing some quality reference code. This is actually the source for Rob's blog. He was using StructureMap originally, but I think he changed recently to Ninject.Mvc.
MVC Storefront DI Screencast: Rob talks about setting up dependency injection in the MVC Storefront. This one uses StructureMap I believe.
TekPub Concepts video (free): Rob goes over the basics of IoC and DI in this video if you need a refresher. It's free too :)
Other Pertinent Web Technologies
Because you're looking to move to the web, there are other languages and technologies that you need to know as well. Below is a list of some brief tutorials to get you started, although each of these subjects could easily warrant a post as big (or bigger) than this one!
HTML: Seems silly that I'm mentioning this here, but I only mention it because there's a lot of push these days to write valid HTML. A majority of accessibility and browser incompatibility issues can be averted by having clean markup. I personally use XHTML in my sites, but any doctype will do :)
JavaScript: This is a neat language that can be used to make many web applications feel more like a desktop application (amongst other things). There are a lot of performance gains and design victories that can be had by properly leveraging JavaScript. Once you feel comfortable with JavaScript, you will probably want to make the move to a JavaScript library to make cross-browser compatibility very easy. My JavaScript library of choice is jQuery.
CSS: This is how you should be applying style to your websites. One of the biggest mistakes a lot of developers make is to make their HTML in charge of presentation (using tables for layouts [holy war], etc. etc.). Arguments and holy wars aside, CSS is a valid skill to have, and it really isn't as hard as some might have you believe :)
I know this seems like a lot, and I've probably inundated you with material to read, however I think it's important to build a solid foundation. Web development is a lot of fun when you are good at it, and it's definitely a great way to make a living! Good luck! ASP.NET MVC is a great framework, and you've made a great choice.
Oh yeah, and there are a few other things you might want to Google in your spare time. They tend to be pretty advanced, so I didn't include them here, but you will run into them when you get more involved in the web world:
AJAX: Makes your web applications perform more naturally and do things in the background.
Web Services: A universal way to exchange data on the web. For example, there are web services that provide weather forecasts and stock quotes. You can consume them and even create some of your own!
XML and JSON: These are used to describe data. When you serialize data on the web, XML and/or JSON are the conventional technologies most developers use. JSON is popular particularly because it can be consumed so nicely within JavaScript.
First step in starting MVC is going through Nerd Dinner Tutorial.
Its the simplest and quickest way to introduce you to the basics of MVC in my opinion.
Thanks
Sorry if this sounds a bit simplistic, but... The tutorials at http://asp.net/mvc, while basic, are good to get you comfortable with the framework. As is NerdDinner. I've found that if you have a development background then learning MVC is not that big of a stretch, so long as you can grasp the MVC pattern which is pretty straight-forward. It'll be more effort to get the web interface side of things up to speed. Your best bet would be to get comfortable with HTML, JavaScript (and AJAX), and CSS so that you can produce a good interface (view).
And the obligatory "learn jQuery" for your web UI.
Get the Nerd Dinner here :
http://aspnetmvcbook.s3.amazonaws.com/aspnetmvc-nerdinner_v1.pdf
It is one of the best resources I have used so far
I would start with the following book:
Pro ASP.NET MVC Framework
alt text http://www.apress.com/resource/bookcover/9781430210078?size=medium
It contains great information on starting MVC development from scratch. The sports store example includes much more useful information than Nerd Dinner IMO.
Check out the ASP.NET MVC in Action book and the codecampserver project that goes along with it.
I switched from Webforms to MVC for my day job I while back, and found exposing myself to Rails development, post 6pm at home :), really helpful with the transission as many of Asp.net MVC principles seem to be a direct port from Rails..... and its Rails so you will just love it anyway...;)

How can i use asp.net mvc

I need to know how to use the asp.net mvc? i am new to this technology and i decided to use it and i have downloaded MVC release 1.0 so i need to know the steps needed fro setup the framework as after setting up the framework do i need to do any configurations in VS? i need a tutorial for creating mvc project and an example with code for accessing database through mvc. and which version or release of mvc u advice me to use release 1 or 2 ?
And with respect to posting back i knew that mvc don't do post back like web forms instead it call controller so is this means that each view (.asox file) don't have a related .cs file or the .cs file is shared with many .aspx files ?
I know that my question is not clear but i got confused from articles about mvc when i ask any question or seatch about mvc many articles without practical example or direct answer to my questions in my mind
Thanks in advance
Asp.net have some good basic tutorials here http://www.asp.net/learn/mvc-videos/ and here http://www.asp.net/mvc/learn/. Hope they help you.
you dont need to do any configuration in VS at all. after you installed ASP.NET MVC you got a new project type called ASP.NET MVC Web Application thats where your journey begins :)
a good place to start would be this little sample app http://www.asp.net/learn/mvc/#MVC_SampleApp
after this you should understand the basic concept of how ASP.NET MVC works
You could start out reading ScottGu's "Nerddinner" tutorial. It was originally published as part of the book titled "Professional ASP.NET MVC 1.0", but has later been released freely on his blog. I believe the tutorial covers all the basics needed to get up and running.
If you feel you need more insight, I would suggest you look to Steven Sanderson's "Pro ASP.NET MVC Framework", rather than the aforementioned book. Sanderson's book seems to cover more detail on how stuff work, and he does a great job trying to promote best practices.
Pick up a good book, e.g.- http://weblogs.asp.net/scottgu/archive/2009/03/10/free-asp-net-mvc-ebook-tutorial.aspx, or go to http://www.asp.net for tutorials.

Resources