DLS
DLS

Reputation: 5491

.NET MVC or just plain old ASP.NET?

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.

Upvotes: 7

Views: 787

Answers (6)

itowlson
itowlson

Reputation: 74802

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.

Upvotes: 5

Russ Cam
Russ Cam

Reputation: 125488

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.

Upvotes: 2

JaredPar
JaredPar

Reputation: 754565

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.

Upvotes: 5

Denis Troller
Denis Troller

Reputation: 7501

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.

Upvotes: 13

DOK
DOK

Reputation: 32831

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.

Upvotes: 5

Sven Künzler
Sven Künzler

Reputation: 1650

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

Upvotes: 4

Related Questions