Can anyone please make a comparison of ASP.NET MVC vs Spring MVC.

Which technology is better in performance, productivity, maintenance, features,...

Regards, sirmak


Solution 1:

It's hard to say which one is "better"....

First - there's the whole underlying "Java vs. .NET" argument - you can't really compare the frameworks ignoring this.

The whole history of web development in Java with "heavyweight" J2EE apps vs. "lightweight" Spring apps. That in Java there are a ton of web frameworks (MVC and not, open-source vs. Sun-developed) and that Spring MVC had a lot to be based on.

And on the ASP.NET MVC side - the whole history of ASP -> ASP.NET -> ASP.NET MVC. And the lack of widely-used non-Microsoft .NET frameworks - web or otherwise.

Now into the opinionated part...

I'm somewhat the opposite of @Luke101 as I've worked mostly with Spring MVC and very little with ASP.NET MVC.

I have to say I prefer MVC-style web development over component-based web development.

I have worked with JSF, which is similar to ASP.NET webforms. (I have to say I liked ASP.NET more than JSF - though this probably has more to do with the maturity of each framework when I used it, and tools available - I used JSF 1.0/1.1 and just Eclipse with no JSF specific support vs. ASP.NET 2.0/.NET 3.5 with Visual Studio 2008.)

As far as MVC frameworks I prefer Spring MVC - but that's entirely because I'm just more familiar with Java - language-wise and development-wise, as opposed to ASP.NET MVC / C# /.NET. Also, Spring MVC requires Spring, and I like to develop using Spring's whole IOC pattern and use things already integrated into Spring.

I haven't tried using Spring.NET and ASP.NET MVC - maybe this would be similar to Spring MVC / Spring / Java.

In the Spring.NET repo there are some examples of integrating Spring.NET into ASP.NET MVC version 3, version 4 and version 5.

Solution 2:

I've tried both Spring and ASP.NET MVC frameworks. I found ASP.NET MVC easier to use, mainly because of significantly less configuration code (both xml and java/c#) in ASP.NET framework required to get things worked. In Spring you can get all the features ASP.NET MVC has by default, but be prepared to write many xml/java configuration code and maybe use some third party tools.

Among strong benefits of Spring are integrated IoC, ORM (mainly Hibernate for me) and transaction managment support.

Solution 3:

This question has been around for a couple years, but I think you guys should stop thinking in terms of who is more familiar with asp or Java. In todays world it doesnt matter, I can hire a few code monkey's like us anywhere or I for example can write in both and anyone can pick up either in a matter of days, I think in a large scale scenario, what matters more is what is affordable, hosting on Windows/asp platform or Linux/Java, sure the easy of technology matters, but we arent comparing C programming to Java. I guess everyone agree they both are competing technologies. What do you rather invest into? Questions to that nature. For example I think hosting on a linux platform will be cheaper.