Best way to learn about .net MVC for a php programmer - asp.net-mvc

Ok i know theres a ton of questions around books and tutorials to learn MVC in dot net, BUT after I started reading some of that stuff i realized they are not oriented to people like me.
I have been working with php on Zend in a MVC configuration and done some ruby on rails so i do have a good idea of the pattern, but i have absolutly no idea about: IIS, Visual Studio and asp/C#... so, what is the best way(could be 1 book, a couple of tutorials, a guide, a manual, a blog-post) to get a very good idea of this technology.
At least i would except being able to know(first hand) the pros and cons of all this!

Screencasts help me more than anything. Seeing someone actually do something is many times more instructive than reading. Watch the screencasts on http://asp.net/mvc. Scott Hanselman's preview 3 videos are still relevant, as there haven't been many huge, sweeping changes since then. They show you how to drag data around, use LINQ, and other .NET specific things. After watching and coding along with those, check out the others.

If you're really starting from scratch, first step would be to download and install Visual C# 2008 Express Edition, Visual Web Developer 2008 Express Edition, and SQL Server 2008 Express Edition. Those are the free versions of Microsoft's Visual Studio and database products.
Then start with a basic C# tutorial like this one to get comfortable with the features of C# that differ from PHP. You will probably cruise through it but I think it will be valuable to have this foundation.
Find a LINQ to SQL tutorial as most of the MVC tutorials use this for data access and it is probably very different from what you've seen in PHP.
From there I think you would have enough to start the MVC tutorials. Spending some time learning plain ASP.NET would certainly help you transition to ASP.NET MVC, but you would also spend a lot of time working with concepts that are absent from MVC.
Also, have MSDN at hand as a reference for the .NET framework.

Your at a disadvantage because you have no formal training in C# and are unfamiliar with the .Net framework. Fortunately there is always time to learn. Here is what I suggest you do. Get a C# for beginners book and start learning some C#, once you are up on that flex your html and php skills to use the MVC Framework. Another thing that might help is getting a .Net job, seriously this is the best way to learn stuff!

Learn core C# skills 2.0 to 3.5 , thus generics / LINQ / Lambda Expressions / List / Keep on writing apps in visual studio express , console apps, winforms , and web apps.
You have got to get the fundamental core C# language down. If you know PHP, then at least you understand logic ... conditionals and html / jquery / css. However, you will really want to get decent with C# before really doing MVC as you will stare at generics and lambda expressions and be totally lost.
Attack it from all angles, mostly trial and error on hand coding from scratch, then some videos from pluralsight / microsoft etc.. The MVC 3 books are good too, but .NET C# book will be a big first.

Related

Is MVC easy for a Classic ASP guy to learn [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I've pretty much worked with Classic ASP for ever since it was released almost.. But i am having trouble adapting to the ASP.NET platform.
I have been suggested by many to move to PHP, since it's spaghetti code (I LIKE SPAGHETTI CODE), and it's just like classic asp.. But learning Apache servers and securing them i heard was another big project to learn by yourself.. And since i know more about MS servers, i prefer to stay with MS.
But, I really want to learn another platform, and i was looking at MVC framework and that MVC 1, 2 or 3 is like spaghetti code? Maybe i'm wrong. I assume MVC3 is the best now?
Anyway, From Classic ASP, which would be the easiest and most difficult to grasp you think? ASP.NET with all the compiling and using visual studio, reminds me of when i used to make apps in Visual Basic, but i really like spaghetti code more than compiling stuff..
If there is anyone who has done this switch over from classic asp before, what did you do and why, how easy was it to grasp the new platform? (Preferrably MVC)
Well, MVC is more like classic asp than webforms is. However, it uses structure and frameworks to reduce spaghetti code and make it more maintainable. You have to apply a lot of new concepts to not fight the framework.
For example, a strong seperation of view, model, and controller. This is not something you would do in classic asp, or even generic php (you can do mvc in php, but it requires more discipline and using frameworks as well).
Bottom line is, spaghetti will always bite you in the long run.
Asp.net supports a mode where you don't have to compile anything, you just edit the files on the server and it compiles them at runtime automatically. This is the so called "Web site" model. However, MVC does not work that way and requires the "Web application" model that does compiling (although you only have to compile code, not markup).
I'm currently smack in the middle of my first large ASP.NET MVC project after (and while still) programming in classic ASP for years. I have also programmed in ColdFusion and I have tried Python as an alternative to ASP.NET MVC.
If you want to stick to Microsoft technology MVC is the closest you will come to classic ASP. Webforms is really Microsofts way to make web-applications similar to application development. Microsoft has tried to abstract away the fact that the web is a stateless medium. However, this results in pretty ugly things such as the viewstate (a hidden form field that tries to keep the state of all form fields) and controls that generate HTML over which you have absolutely no control.
MVC gives you more control, and leaves you to handle the statelessness like classic ASP does.
I have still found there is a steep learning curve though; you will have to learn a lot of new things, if all you ever did was program vbscript/ASP:
C# or VB.Net Syntax
Object oriented programming in general (inheritance, dynamic versus static, etc.)
Concepts such as lambda expressions, delegates etc.
The MVC pattern
Most likely also a data-access technology like LINQ or Entity Framework
I'm still struggling with some of these, but I'm getting there. It does take a lot of work though, and perseverance. Not everything is better or easier than in classic ASP. Especially for me, as I have been using WSC's in classic ASP for years, which enables n-tier applications in classic ASP, and eliminates spaghetti code completely.
As I mentioned, I also looked into Python as an alternative; Although at the company I work for we now switched to ASP.NET MVC, I actually found the transition to Python a lot easier. The only reason we went with MVC is the fact that it seemed easier to get new developers when using C#/MVC. (In retrospect this wasn't actually true, we are having an incredible hard time finding a suitable C# programmer around where we are located)
Mind you, in Python you will still have to learn basic Object Oriented programming, but the implementation is much simpler to use than .NETs and the Python language is (IMHO) more like vbscript than VB.NET is.
Also I liked the fact that I don't have to define the type of every variable/function/parameter. This sometimes drives me crazy in C#; if the type of a function changes, it could affect a lot of other functions and variables, which all have to be changed. Also, the syntax is easier to pick up because the language is simple and there aren't a hundred ways to do the same thing.
You can choose between different frameworks, MVC or non-MVC and you can use Python in a lot of other fields as well (application programming, scripting-for example XBMC).
There are also ORM solutions available like Entity Framework for .NET and I found the one I looked into (SQLalchemy) a lot more powerful, and easier to pick up than EF.
So at work I'm currently learning ASP.NET MVC, at home I'm slowly picking up Python. I suggest you try a very simple project in different technologies, and pick the one you find easiest to get started with.
Hope this helps.
If you like your spaghetti served by Microsoft, try any Windows version that supports IIS7. PHP works perfectly and it's really easy to setup with Web Platform Installer.
With that in mind, there is no real reason you should choose any one web technology over the other. You can mix and match as needed, even within a single app.
If you want to get into MVC, forget about 1 and 2 and go straight to 3. MVC is much closer to the metal than ASP.NET WebForms. With your background in classic ASP, you'll probably like it once you get the hang of it.
Update:
If you're serious about learning either MVC, PHP, Ruby or whatever web platform you like. Get a good book. Sit down, read it and follow along with the sample code. I usually decide what book to buy based on the reviews at amazon.
Then, if you need more info on specific topics, go read authorative blogs on the subject. For ASP.NET MVC you'll probably want to look at blogs from Brad Wilsons and Phil Haack.
I started using Classic ASP back in the days but then moved to WebForms now using/learning MVC 4.
Here are my thoughts.
For me Classic ASP was fun and easy to learn as it was simple and did not have a large learning curve, data CRUDS were not difficult either and it did the job in a fairly efficient but messy manner.
WebForms required a higher learning curve but helped with a lot of 'plumbing' code with drag and drop controls, however these were sometimes difficult to modify and customise.
With MVC I have found it requires a larger learning curve than the other two, this is mainly due to it being driven by HTML5 and client frameworks like Knockout etc. To gain a good understanding also requires one to learn OO patterns, Entity Framework, LINQ, WebApi and initially these I did not find simple to digest.
What is easy for you? What part do you find difficult? Read up about a stateless nature of HTTP and find comparisons between web forms and MVC - this should make few things clear.
Do some reading about MVC pattern in general. MVC is a general term which appeared first time over 30 years ago. MVC in .NET 4 is a variation of this pattern, but we are all used to calling it MVC. Make sure you OO knowledge is up to scratch, as well as knowledge of basic design patterns, mainly SoC (Seperation of Concerns) and SRP (Single Responsibility Principle).
if you want to learn / start with the mvc framework I could recommend you do the Contoso University tutorial or the NerdDinner one ( http://www.asp.net/mvc/tutorials#NerdDinner )

What is the common .NET MVC workflow? Is there one portable between Rails?

I've been working as an apprentice/junior developer working in .NET web forms and dabbling in a ton of other stuff.
After tasting a ton of technologies I've settled on Ruby on Rails and ASP.NET MVC.
I'm struggling with workflow and I want to get into behaviour driven development.
What workflows work for you?
What tools do you recommend for testing etc?
Are there any tools I can use on both Rails and .Net?
Are there any concentration tips you recommend?
One of the tools that I use heavily in .NET is ReSharper. It costs a nice chunk of change but it enables me to easily and quickly change my code as it provides a quick and simple way to execute tests and refactor code. On top of that it also provides visual hints when I could be doing something better.
As far as portable between Rails and ASP.NET MVC, I have not seen anything. The closest you might get as far as tooling goes is using ReSharper on .NET and then RubyMine in Ruby as they are both written by JetBrains.
For testing in .NET you may want to check out mSpec as it is a BDD framework for .NET and then combine that with using some stuff from MvcContrib for automated UI testing and you might get a closer workflow to what you get out of box with Rails 3.
I am no expert and am continuing to refine my process. I recently blogged about it which should get you off to a great start: http://ntcoding.blogspot.com/2011/01/total-bdd-in-aspnet-mvc_16.html
Hope you like it. BDD helps you stay organised and make sure you are developing the right product.
Spend a lot of time learning gherkin too.
You can use IronRuby in .NET which means RSpec and lots of stuff the rails boys use.
Ciao for now :PPPPPPPPPPPPPPPP

mono or RoR for new application run on linux?

I have little experience with ruby itself. I am going to hire somebody to write a web based application and I wanted it to be written in RoR but I was recommend mono. I guess because they like mono and because they think the RoR is slow.
The whole application would be some kind of social media meta management tool. There will be front end web based part and then back end doing the 'real stuff'.
I have no experience with mono at all and I am not experienced enough to comfortably say that RoR is the best choice.
I understood that if RoR is configured properly it could be pretty fast. I read that RoR has some troubles with scalability. I will start the application small and if it's successful I need to scale it up.
What would you recommend?
in the light of
performance
scalability
easiness to test
easiness to maintain, develop code/project
( I like ruby but I am not going to be the developer myself. I prefer to choose the 'better' option if there is such answer to that question)
please feel free to suggest anything else ...
If you are not going to write it yourself, you may want to go with what the person who will write it is most comfortable with.
Full disclosure: I have developed several sites now using Mono and I love it. I have used Ruby-on-Rails but not for anything nearly as big as what I have done in Mono. Keep that in mind.
Quick answer: In the greater scheme of things, Ruby-on-Rails and ASP.NET MVC have more in common than not. My choice would be ASP.NET MVC on Mono but I doubt you would regret choosing either.
Architecture: If you want one way of doing it out of the box, choose Ruby-on-Rails. If you want to be able to choose what you feel are the best-of-the-best technologies from a range of choices, choose .NET (Mono).
Ruby-on-Rails is more of a turn-key solution in that it provides a standard way of doing pretty much everything you need out of the box. .NET (Mono) offers a lot more power (my opinion let's say) but there are a lot of different pieces to choose from and you have to choose a technology stack yourself. As an example, RoR has a standard way of accessing databases while .NET Mono let/force you to choose from a dozen different ways to do that.
Mono and .NET generally have a little better separation of concerns so the purist in you might like that. If not, you actually find the roll-up-your sleeves and get it done attitude of Ruby more to your liking.
Performance and Scalability: This should clearly go to .NET and Mono. In fact, I believe the fastest way to run Ruby-on-Rails is to use IronRuby to run it on .NET. StackOverflow is written in ASP.NET MVC and, given the amount of traffic, it obviously performs great. Proof is in the pudding. That said, the performance bottleneck will probably not be your choice of framework.
Testing: Old style ASP.NET (now called WebForms) is considered pretty hard to test. The newer ASP.NET MVC was designed to be easy to test and is similar to RoR. One major factor is that in Mono you will probably be using a statically typed language (like C#) while Ruby is of course a dynamically typed language. You have to write more tests in a dynamic language (because the compiler/interpreter will not catch type problems) but it can also be easier to write tests if you are not fighting the compiler. I think it is a matter of taste and style (I like static) but this is a major factor in answering this question.
Of course, since .NET/Mono is a multi-language platform, you could always write your ASP.NET MVC tests in a dynamic language. You could even do it in Ruby (IronRuby). Perhaps that would be the best of both worlds (static checking on your real code and flexible dynamism in your tests). I have considered doing this myself using IronPython for tests.
Maintenance and development: This is a tough one. It depends what you are writing, what third-party libraries you might need, and what tools you are going to use. I would say that RoR is probably the more advanced MVC framework. My own thoughts are that Ruby-on-Rails is probably a shade easier to write but a little bit harder to maintain.
Community: I like the Ruby community more than the .NET one but I think I like the Mono one the best. That makes it a little confusing. The core Mono guys (like Michael Hutchinson that answered here) are simply awesome. I really like MonoDevelop as a tool (IDE) as well. It just keeps getting better and better. Michael, thank you for Git support if you had anything to do with that. :-)
Tools: If you are writing for Mono you can use the whole universe of .NET tools (VisualStudio, ReSharper, Reflector, etc) so that is pretty hard to beat. That is assuming you develop on Windows of course. On Linux or Mac the tool of choice for Mono would be MonoDevelop. It supports version control, a software debugger, and NUnit tests right in the IDE and is completely cross-platform.
It seems like a lot of Ruby folks just use a simple text editor. This may just be because an IDE just does not have as much to offer a dynamic language as it does a static one. Here is a SO question on what people like for Ruby:
What Ruby IDE do you prefer?
EDIT: Just to make things confusing...there is another MVC framework for .NET/Mono that is even more like Ruby-on-Rails; MonoRail even has an implementation of ActiveRecord. MonoRail has actually been around longer than ASP.NET MVC but I would stick with ASP.NET MVC these days as that is where the future lies. ASP.NET MVC is open source by the way and ships with Mono out of the box (the actual Microsoft code).
I can speak more to Rails than Mono. RoR is pretty scalable these days with all of the cloud hosting services available. Web applications query data and render web pages using that data, which really isn't that big of a deal. Most performance issues are caused by database and schema design issues, not the web framework. Typically, database response times dwarf other portions of server processing. RoR is also very easy to test. Testing is a more natural part of development than in other languages that I use. When I started RoR programming I was used to the much more structured world of Java, and the more dynamic Rails won me over for web development.
Firstly, I work on MonoDevelop, a crossplatform IDE for Mono (including ASP.NET & ASP.NET MVC), so feel free to consider my answer biased, but hopefully it will be helpful anyway.
Performance: a decent JIT compiler (Mono) should be much faster than an interpreter (Ruby). But it depends on the programmer's skill too - well-written Ruby could be faster than really badly written C#. The libraries and database and caching mechanisms you use will be a big factor too, but these aren't fundamental to the languages/frameworks.
Scalability: AFAIK there is no magic bullet for web app scalability, and although I don't have practical experience in this field, here's some info I've picked up. It really depends on your database usage, how your session state is stored, and how caching is implemented. This isn't really fundamental to either framework - once you start scaling to multiple machines, you'll probably have many machines/processes for database servers, cache servers, message queues, frontends, servers for static content, etc. Likely only the frontends will be ASP.NET or ROR, and if they're stateless, you can simply clone them and handle the scalability problems on the backend.
Testing: I can't speak for Ruby, but ASP.NET MVC (but not vanilla ASP.NET) was designed to be easily testable using .NET testing tools such as NUnit (Mono's own unit tests use NUnit).
Maintenance and development: Again, I can't really speak for Ruby, but it's pretty much a given that it will be easiest to develop (at least initially) in the language & framework that the developer already has experience with. Also, .NET has some amazing development tools on Windows - Visual Studio, ReSharper, etc. - and there's a huge pool of experienced C# and ASP.NET developers you can hire, though few of them will know Linux/Mono.
Also, StackOverflow uses ASP.NET MVC :)
To introduce a little levity...
How about DOS on Dope: the last MVC web framework you will ever need?
There are of course a dizzying array of choices but another nice alternative is Django.
It is basically Ruby-on-Rails for Python so most of the comparisons of RoR vs. ASP.NET MVC would apply. Depending on what kind of site you are building, the really interesting feature of Django is the automatic admin interface.
If you need to be up and running quickly, I would go for RoR. Scaling rails is becoming easier with time and you have a big range of ruby runtime environments to choose from MRI 1.8, 1.9, REE 1.8, JRuby (run on java VM), Rubinius.
ASP.NET MVC is nice, but I still think it has some way to go before it offers the same speed of development as RoR.

ASP.Net MVC issues, meant for advanced developers only?

Just a random question. I've been in internship and then working as a software designer for almost a year now, mainly with SQL Server 2005 / 2008, and Visual Studio 2008 with ASP.Net VB / C#, web software development. We recently started a project with ASP.Net MVC, and I just don't get this stuff.
The concept of Views, Controllers, Models etc is clear. I'm still a bit confused with some of the syntax, but it doesn't seem impossible to get. My problem however, is with all the basic controls and functions you had with basic ASP.Net. Want a dropdownlist? Go browse through 15 tutorials one of which may actually work. How about a gridview with editable rows? Manually build the tables or helper classes with loads and loads of code also built from several different tutorials. What about panels or multiview indexes to easily control the visible user-interface on a page? Well, go learn another tutorial about how to do it all from scratch. Etc..
I do not argue the idea that MVC is worth it. It has to be, with so many people smarter and more experienced than I am saying so. But I've now fought with this beast for over a month and am getting increasingly frustrated at having to use hours to days of time to do the most basic tasks that were easy even when I was barely beginning with the whole programming thing almost a year ago.
So my question. Are there others out there like me? Are there perhaps nice blogs or articles opening all this up to people like myself? Is ASP.Net MVC just something that is so hardcore advanced that you NEED to have extensive experience and talent to actually master it?
Thanks for your time.
It's not for advanced developers. It is for good developers.
Most ASP.NET WebForms developers have made it somehow through years without having a slightest idea of HTML, CSS, JavaScript or HTTP. Drag and drop some control, set up some properties and here you go. It is not the way of a professional. You need to know the basics. It is only a matter of time until some situation arrives where a standard control cannot help and you need to work around the postback mechanism, viewstate etc.
I agree that it is definitely more work trying to implement an editable data grid, add persistance for controls, add some nice Ajax effects instead of relying on UpdatePanels, yes. But you really need to know this stuff if you wish to be working as web developer.
What you are experiencing is being overwhelmed at once by all those things you should have learned already but have managed to postpone thanks to very well done abstraction mechanism of WebForms. The best course of action is to start learning these things now, step by step. It will likely take you at least 6 months of intensive studies to feel more or less confident with doing stuff manually. But when you have done this, you will be looking back at your start and feeling glad you did it.
I was trying to work out what the problem was with MVC until I grasped the essential difference between the person asking the question and me - it would be this, I first laid hands to keyboard in 1979 whereas Zan has been "working as a software designer for almost a year now".
When I started one more or less had to do everything (at least in terms of presenting a UI) from scratch - or at least using far more limited toolkits than is the case today. The notion of constructing a drop down list by running a loop to create the options is in some respects considerably less alien to me than binding a datasource to a control and having the result appear as if by magic (notwithstanding 9 years of VB.OLD and over 6 years of .NET and C#)
And that is the core difference between Forms and MVC as it currently stands - the way you produce the presentation code and consequently the fact that you need to understand HTML and do seemingly more work to achieve similar results (and this is one of the reasons that people keep emphasising, quite rightly, that MVC is NOT an appropriate solution for every project). In terms of the structure of an application - MVC encourages a better (more testable) style but its not the only means to achieve that end - the majority of the techniques are as applicable using forms and alternative patterns.
And again this raises the challenge of contemporary frameworks and tools - they do a huge amount of work for you (go look at Dynamic Data for example) but they also hide so much from you that we lose track of the fundamentals and of an understanding of the basic building blocks from which our complex applications are constructed. In this case the problem sounds like one I've had which is learning about the nuts and bolts how a web page is actually constructed (HTML, CSS, Javascript) and how it interacts with the server as opposed to just having the whole client experience automagically generated for you.
MVC is no more a tool for "good developers" than Forms is - rather its a good tool for developers that wish to achieve a particular result albeit one that comes with a price just as forms is also a good tool but with different outcomes because you're accepting a different set of compromises.
A good developer is one that can adapt - can learn the new techniques necessary to work on a different platform, to target new environments, to use appropriate solutions for a particular task and ultimately that can apply solid patterns and methodologies to their work in so far as is possible whatever the dev environment...
i also spend one year on mvc what i learn till now is u can rely on client side as much as u can but in classic asp.net most of time u used server side controls like gridview. In asp.net mvc u can replace it with jquery controls like jQgrid and jquery datatable. you must have to spend some time to learn asp.net mvc the it might looks u better then asp.net classic.
for reference read asp.net mvc pro book
MVC is not a new concept; in fact other languages have this kind of framework long before Microsoft got it. Think about Ruby On Rails, Zend Framework, Symfony etc.
If you say that MVC is for the hardcore and the alpha geeks, then by your logic other language developers are much more advanced than .Net developers. I don't think this is true.
Your problem with MVC stems from your webform background; ASP.Net and ASP.NET MVC greatly differ in terms of concepts and approach. So some unfamiliarity is expected for those who are moving from one framework into another. Me, on the other hand, who has no webform experience ( although I do have winform experience), don't find MVC hard to grasp.
And I don't think I am smarter than anyone else.
All i can suggest is that you need to do more of it! The more you practise, the more it will become clear. That's how it was for me. I was fundamentally stumped by the MVC concept to start with but after much frustration i just decided i would need to force myself to start using it or i'd never get it.
I'd recommend actually completing one or two of the tutorials found on the asp.net/mvc site from start to finish. I can personally recommend the NerdDinner (and the book from which this example was birthed - Pro ASP.NET MVC 1.0) and Storefront tutorials.
ASP.NET MVC is built on top of bunch of old concepts - HTTP, HTML, CSS, JavaScript. And so on. The whole point is to bring their power directly to your hands. If you can't handle this power - for example, you're not familiar with HTTP statelesness, or how to build rich pages with HTML/CSS/JS - you can't do much with ASP.NET MVC.
If you say that you're in programming for only one year then you're most probably not familiar with those concepts and that's the problem, not in the MVC itself.
Maybe you take ASP.NET MVC as a refinement of ASP.NET. That's wrong. They're VERY different. Imagine yourself doing web development with only HTML, CSS, and jQuery [1]... can you? If you can't then you will have troubles doing MVC.
I personally worked with ASP.NET for couple of years, and ASP.NET MVC was a breath of fresh air. It's just so much simpler and cleaner.
[1] This can be done, for example with data fed via web services.
MVC is great but the argument that it makes you happy by finally giving you the power of HTML, CSS and Javascript is real crap. The same logic would say: code in pure SQL and forget nHibernate or Linq. Why is abstraction bad? I like MVC but please don't use such arguments. MVC needs something to be able to build complex rich user interfaces (which are browser compatible).
Finally, on HTML, CSS and Javascript. The fact that MVC forces you to go back to the basics does in now way mean that the developers do it right. Whether you use web forms or MVC, a bad JS developer stays a bad JS developer (and same for HTML or CSS).
Sometimes it is better to not give too much power to the weaker developers in a team.

Safe to jump on ASP.NET MVC bandwagon when building enterprise solutions?

Before I get pointed to one of those 'VS.' questions like below...
ASP.NET webforms + ASP.NET Ajax versus ASP.NET MVC and Ajax framework freedom
Should I pursue ASP.NET WebForms or ASP.NET MVC
ASP.NET MVC Web application vs ASP.NET Web Application
... please let me state that I'm not looking for a comparison.
Some of my concerns that I need answers for include:
Is the learning curve for doing crazy UIs (e.g. having UI for building a BOM tree online) steep? Lots of people posting questions seem to be having problems with some UI requirement or another which has me worried. Is the technology mature enough to handle those type of requirements?
Is there a pretty well developed community and how available is online literature? You can get tons of literature for WebForms.
Would the time to develop it be comparable or less to building a traditional enterprise WebForms site?
How long would it take to get a whole team of developers comfortable (if not enamored) with WebForms to become well versed in ASP.NET MVC?
The truth of it I think is that StackOverflow is Google-like product and ASP.NET MVC might be great for that. But I'm stuck developing software in the Your company's app category.
alt text http://stuffthathappens.com/blog/wp-content/uploads/2008/03/simplicity.png
So taking a plunge could prove very costly later on if something can't be done or it has to be hacked. Hope to hear from those that have taken the plunge.
Thanks.
About 3 months ago, I was told that I needed to develop an enterprise web-app (well, a series of small web-apps actually), but that I could choose whatever technology I wanted.
Since I'm most comfortable with VS/C#/.Net, the dilemma was whether to choose ASP.NET WebForms or ASP.NET MVC2 -- Unlike you, my only background was with Windows Forms (WinForms) and a little WPF. So I had to research (and try-out) both WebForms and MVC.
Just like you, I realized that my app would be neither Google nor Apple like, but your bog standard company app with thousands of buttons and boxes, etc. WebForms seemed like it would be the fastest to deploy, but hard to test and hard to maintain on a long-term basis. MVC seemed to have a much steeper learning curve, but once established, testing and maintenance would be a breeze.
I only fiddled with WebForms for a week, so I can't really comment on it. But MVC is definitely everything I was expecting it to be.
Yes, it's a steep learning curve. Concepts that were new to me:
Model-View-Controller (MVC)
Separation of Concerns (SoC)
Model Binding
Unit Testing and Test Driven Design (TDD)
Mocking and Stubbing
Dependency Injection (DI)
The books that helped me the most were:
Pro ASP.NET MVC2 by Sanderson (MVC, Model Binding, DI, TDD)
The Art of Unit Testing by Osherove (TDD, Mocking, Stubbing, DI)
I also had to brush up on my HTML, CSS, and Javascript.
Overall, there seems to be a fair amount of ramp-up work in the beginning, but maintaining and extending the existing application has been pretty painless. Whenever I've been asked to make changes, it's been fairly easy and I've typically been able to deliver on-time or even sometimes ahead of schedule.
In an ideal world, writing an MVC app would happen with 2 people. One person writing the core code and a second person writing the UI and the Views (HTML, CSS, Javascript.) Although it's entirely possible to do it all by yourself. (which is what I'm doing right now...)
I have run into some hitches deploying in the Enterprise, though. Internally, my company is running Windows Server 2003 and IIS6. Unfortunately, we have been unable to get the app to deploy properly on IIS6 when using Virtual Pathing. (All the references to and in the CSS files are broken.) If you plan on deploying MVC, I would recommend using IIS7 or higher. MVC supposedly works on IIS6, but requires that your IT department be willing to figure out how to get it to work.
Edit: I just realized I never directly answered your questions. Here goes:
My personal experience has said, that, yes, the learning curve is steep for building good Models and UIs, but I'm not really a web-developer so I've been working with that handicap. The good news is that the MVC technology is pretty mature.
Yes, the community is pretty well developed and growing. You'll get a lot of good answers from StackOverflow as well as MS's ASP.NET MVC sub-forum.
I have no personal experience coding WebForms, but I have coded plenty of WinForms apps and I feel like it's taken me approx. 3 times longer to build this MVC app. The initial investment is a bear, but regular maintenance and improvements seem to come WAY faster, especially as the app has grown... Since you seem to have a team of programmers, it may come faster for you guys as you can probably split up the learning/workload.
Again, no prior experience with WebForms, but what I can tell you is that as I was learning ASP.NET MVC, there were times when I was struggling to understand what was going on because I had no prior ASP.NET background. (Example: Membership and Role Providers -- I had to code my own recently. Boy was that fun...) On the plus side, I didn't have any "old ways of doing things" (aka. WebForms) to unlearn either. If you have a team of folks enamored with PostBack / CodeBehind, you can bet that MVC is gonna seem awfully strange at first. But hopefully your team will see the advantages that MVC brings and embraces it fully.
Oh, and it should be noted that you can blend MVC and WebForms. It's not an all-or-nothing proposition. Although, if I were in your shoes, I'd try to embrace MVC as much as possible and only use WebForms where it clearly makes more sense.
Ok, I hope this helps... :-)
I can answer half of your question. I've just dove into MVC from a WebForms background. There is (obviously) a learning curve, but it's really not very steep. I've been able to make the transition with little effort, and I find the whole thing to be a breath of fresh air.
However, I am quite capable with front-end technologies (HTML & Javascript), and I don't like the HTML the WebForms and Microsoft ajax framework generates. If you and/or your team are like this, you will love it. However, if you are proud of the in-depth knowledge you have of the event hierarchy, or if you love the simplicity of UpdatePanels, then you'll probably bridle against the changes.
The documentation is OK, enough to get going happily, anyway. Here's a few videos to whet your appetite:
http://videos.visitmix.com/MIX09/T49F
http://videos.visitmix.com/MIX09/T50F
http://videos.visitmix.com/MIX09/T44F
Here's your documentation home:
http://www.asp.net/mvc/
For a bit more info, the first chapter of the asp.net mvc 1.0 book is online and can be downloaded for free. See ScottGu's blog here:
http://weblogs.asp.net/scottgu/archive/2009/03/10/free-asp-net-mvc-ebook-tutorial.aspx
And, the full code for the chapter can be found here:
http://www.codeplex.com/nerddinner
Finally, in terms of development time, I think it might take a bit longer to develop apps using MVC (although I have no evidence of this), but I think supporting, maintaining, bugfixing and enhancing will take a lot less time. So, with a small up-front investment, I think you'll more than recoup that effort.
Anyway, like I said, these are my preliminary findings. I still have yet to hit a really hairy problem.
As you know its all about the people first, technology 2nd. You can simply build out a new functionality of your company app because they can co-exist, then you can answer all those questions yourself.
It's new stuff so it will of course take more time than what you're used to but heck its all fun so jump right in and start answering these questions for your own people and app.
Interesting that your question focused all on your concerns and not on any benefits. Have you asked yourself the "why" question? If you feel you can be successful with WebForms, why change to MVC? What is there in MVC that justifies the risks? If you were paying for the project, what would you do?
I'm not pitching WebForms over MVC by any means, but as an architect, you need to be able to come back very strong to the question of why you decided to go away from a very well-known quantity to a relatively new one. I think that there are many good reasons to do so, but it not my job on the line. :)

Resources