Spring MVC vs ASP.net MVC

This is my first blog, yes surprising for someone who has worked as an Internet Technology strategist for almost a decade, so I decided to write about something that I’ve been grappling with (on and off) for about a year now. I haven’t programmed commercial software since 2004, so when I decided that I really wanted to maintain this skill I needed to spend a lot of time playing catch-up, I spend a lot of time understanding technology trends and it’s impact on business. I understand the fundamentals of most major development environments and have a very good understanding of what is needed to develop an effective e-commerce application. Armed with this knowledge I felt that it wouldn’t be long before I was knocking out high quality web applications. Yeah right!

Having switched from Windows Vista to an Apple Mac the obvious choice was to start looking at Java frameworks ( even though my commercial development experience was with .net), so I evaluated the many Java Frameworks that I could use to develop web applications (Tapestry, Struts 2, Spring MVC, etc) but finally decided that Spring MVC as it felt like the best framework for me, it was intuitive, dependency injection made sense and I liked the Aspect oriented programming, and most importantly the developers I worked with were using this to develop my e-commerce product.

So i downloaded Spring STS and got cracking, In 3 minutes I had configured spring and got the Hello world application running. Simple, so I started playing more and then wrote a contact form controller, developed a contact model, and then started to configured hibernate and annotated my model. This is where i hit my first major hurdle. I was getting these obscure Classnotfound errors. It was obvious that my Maven dependencies where not correct, simple problem to fix…. so I went to my favourite search engine and looked for documentation that described all the dependencies that were required. Unfortunately this took quite some time as I kept on getting the same error but for different class. It was getting late and i had a meeting the next day so decided to call it quits.

Towards the end of the next day I asked one of the developer at the office to help me debug my issue and after about 2.5 hours we had the example up and running. I tried a few more examples to make sure i was comfortable that I grasped the concepts. I decided to move on to something more complex, so i started developing a real world application. The first thing I started doing was the user registration (easy enough even with transactions as I was writing info to 3 tables) and the security features (authentication and authorization).

I did some research and found that spring mvc security was exactly what I needed so I started configuring it into my application. This is where I hit my next stumbling block; it took me the entire weekend and Monday evening to get it working.

This is when i realized that Spring MVC documentation is almost non-existent and the web tutorials that are available are either difficult to follow for beginners or just too simple so you don’t really grasp the concept. I added the code to SVN so I could share it with a colleague, hoping that he would reduce some of the learning curve. I also wondered what hurdle would I next encounter, and how long will it take to configure support for the next module. At this point I also started getting issues with my spring STS project (even though the project works fine from the command line).

Through all this I recall doing research on ASP.net and recalled that .net had built MVC support into the framework as well. So I loaded VMWare on my Mac installed Windows 7 and Visual Studio 2010. I read a quick tutorial on the ASP.net website and realized that the concepts where similar to Spring MVC, so I fired up VS 2010 and got to coding my first application. Within a day I had the registration, and security features developed and after a week already have the skeleton of a really nice web application.

So I’m now wondering why would I go through the steep learning curving of developing a web application Spring MVC if I could build the application with ASP.net.

I’m open to comments……. but please don’t focus on costs and security as both of these can be managed away or are non-issues (see security vulnerabilities of non-Microsoft environments).

What are the fact based benefits of Spring MVC over ASP.net?

Has anyone built an ASP.net MVC 3 application that have 2+ million users, could you please share your experience?

Declaration: Before downloading Spring STS i was using Eclipse to develop Android applications.

[UPDATE: I joined Skype in Nov 2011 as a product manager, Skype was acquired by Microsoft and my dev team has been building a product using c# and asp.net MVC 4 on Azure that deals with 20000+ tps. I have answered my own question. ASP.net MVC 4 is really powerful and we are able to build applications rapidly that deal with large transaction volumes with sub 50ms processing times.]

For me ASP.net MVC 4 helps with productivity as the documentation is good, and people new to the platform don’t have to go through the same steep learning curve as Spring MVC and you not really sacrificing anything apart from platform lock-in, but is this really a big deal?


6 thoughts on “Spring MVC vs ASP.net MVC

    • hey, I forgot I wrote this blog and was reminded when I had to approve your comment. I’ve updated the article and agree with you supporting millions/billions of users is not a problem with ASP.net MVC4.

      • Regarding your update. If you’re working on a company that’s not willing to pay for licenses to Microsoft, then platform lock-in is pretty big. BTW, your update really gives a good impression of ASP.NET.

  1. I’m here to give justice to your statement on Spring MVC.

    I agree with most of the debugging issues you’ve encountered. Spring MVC is XML based which makes it very difficult to debug (wrong wiring anyone?). Also, Spring MVC’s strength is an achille’s heel. Why? Auto-wiring removes the responsibility of knowing Classes and Types from the developer. This is good for flexibility but bad for debugging. Unless you start logging religiously, you will keep getting out-of-nowhere errors. Errors that sprung (no pun intended) form Spring’s auto-wiring. You have no idea where it came from. Add that to tons of dependencies and you’ve got yourself a development nightmare.

    I’m currently starting on ASP.NET and I’ll see if I can shed more light to this rivalry.

  2. I am experiencing the same, but upside down. I learnet ASP.NET MVC first, now I have to make a project in Spring MVC and I am stuck, because of all the same reasons you exposed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s