views:

499

answers:

6

This is a shoutout as I've been spending the last few days learning about .NET and the process has left me a little confused rather than enlightened. Just as a background info, I have knowledge of PHP (have even used CakePHP to create a whole app rather easily) and Rails.

I am wondering if I should pursue ASP.NET or should stick to learning ASP.NET MVC? While I was going through a few tutorials of ASP.NET, the basics seemed rather straightforward, but somehow, when every example I've gone through sticks SQL statements right into the example without a DAL, I just get a little worried.

So, in case I was just not doing any good research, are there any books/sites out there that will help in this? Or should I just go and learn .NET MVC?

If you're wondering why I just don't stick with PHP or Rails, I just learned that I might just have to know a little .NET for the safety of my job.

+3  A: 

Rob Conery has written a book on ASP.MVC, so you might find him biased. I find his arguments compelling nonetheless.

Sven Künzler
Great link. Thanks.
Kris Krause
+3  A: 

I think that the DAL-less examples you're seeing are written that way for simplicity. Serious ASP.Net applications always use layers such as BLL and DAL. The separation of the DAL is just omitted in simple examples -- that does lead to the unfortunate mis-interpretation of the examples by people who don't know better.

I believe that MVC is more difficult to program, and that it is best used only when there is a specific reason for using it -- SEO optimization, TDD development. It ignores many of the sophisticated functionality available in ASP.Net WebForms and is often compared to classic ASP. And, I don't believe that MVC has become widely adopted in many corporate environments, so if you want to learn the approach used by everybody else, stick with the basic ASP.Net and save MVC for later.

As a .Net beginner with abundant experience in other programming languages, I would recommend that you continue your studies of ASP.Net using WebForms. If you're looking for a serious DAL example, I would highly recommend this lengthy tutorial on the ASP.Net website. It has all of the architectural refinements you seek, and may prove helpful in learning how to use the many data display controls.

DOK
+1 for the asp.net data access link. Very valuable info.
Reed Copsey
"MVC has[n't] become widely adopted..." -- it's only been released for a few weeks, what do you expect? MVC is much better suited to the web as evidenced by the heavy use of this pattern in nearly every other development framework. WebForms, with it's event-driven model was developed to make it easier for WinForms developers to translated their skills to the web. MVC is a much better fit for web development and will, IMO, eventually overtake WebForms as the web platform of choice for .NET.
tvanfosson
The initial preview release was in July 2008. It's been out for a while, and the general MVC concept has been around for decades.The two Microsoft presenters I have seen have been lukewarm about the general usefulness of this approach, one saying that 90% of ASP.Net developers won't ever use it and don't need it.The StackOverflow developers used it and ran into serious issues which cooled their ardor.
DOK
DOK,Do you have any links that highlight the issue SO developers ran into when using MVC?
Dhana
IIRC, they talked about it in a video that discussed how they developed the site.
DOK
Here's a link to the podcasts: http://blog.stackoverflow.com/category/podcasts/
DOK
And here's a link to a discussion of how StackOverflow was developed.http://blog.stackoverflow.com/2008/09/what-was-stack-overflow-built-with/
DOK
+11  A: 

ASP .net MVC will be closer to your rails experience.

ASP .net Web Forms (what is usually called ASP.net) is clearly different, but if you are learning for the sake of finding jobs, it's what will pay for a long time(there are lots and lots of sites, both internal and public-facing) built on ASP .net web forms. There are some emerging sites using ASP.net MVC, but it's a long way.

So, it depends on your goals. If you just need to know "a little .net", go with MVC because the concepts will be known to you. If you need to know "the .net web stack", then most people will thnik of web forms, not MVC...

And yes, samples in the microsoft world tend to be on the "lighter side". It's near impossible to find demos that do not have the "draggy-droppy" feeling, and it is a REAL problem.

Denis Troller
+1 for the last line.
chris
+5  A: 

I would choose ASP.Net MVC over ASP.Net WebForms for one reason: testing. MVC was designed from the ground up to be a pluggable and testable system. Testing is, or at least should be, an inseparable part of your development cycle. Testing MVC is orders of magitude easier than WebForms due to the ability to MOCK or replace parts of the core API. Doing the equivalent in WebForms is either not possible or very unwieldy.

JaredPar
+2  A: 

Recently read ASP.NET 3.5 Application Architecture and Design - it was a reasonable look into many different aspects of design within ASP.NET, including Data Access Layers, N-Tier architecture, Design Patterns and touched on MVC, amongst other topics. It was good as an overview of ASP.NET best practices, if looking for a book.

I would have to agree with others that you're best bet would be to look at going straight to ASP.NET MVC as your current skills will translate better to that framework. I would recommend taking a look at Professional ASP.NET MVC 1.0.

Russ Cam
+4  A: 

A colleague of mine has written up his experiences of using ASP.NET MVC on a real world project at http://www.mindscape.co.nz/staff/jeremy/index.php/2009/02/loving-aspnet-mvc/ and his comparisons to plain old ASP.NET. His conclusion is "I reckon MVC is the way forward for building web applications on the .NET framework."

He has also written up some detailed walkthroughs showing how to use ASP.NET MVC with an ORM which might help address your "putting the SQL straight in the example without a DAL" concern (he also covers things like unit testing). See http://www.mindscape.co.nz/staff/jeremy/index.php/2009/03/aspnet-mvc-part1/, http://www.mindscape.co.nz/staff/jeremy/index.php/2009/03/aspnet-mvc-part2/, http://www.mindscape.co.nz/staff/jeremy/index.php/2009/03/aspnet-mvc-part3/ and http://www.mindscape.co.nz/staff/jeremy/index.php/2009/03/aspnet-mvc-part4/. Disclaimer: These are written in terms of our commercial ORM, but will I hope be easy to translate to your own preferred data access technology.

itowlson