just curious to know the difference between spring mvc vs django


I would like to ask the masters out there as what are the main differences between java spring mvc and django? and also..which one is preferred most?

12/17/2011 7:07:22 PM

Accepted Answer

From the perspective of developing Web applications, there's only the big difference in the approach towards the architecture of your applications.

Django tends to impose a lot of constraints and depends heavily on a fixed set of solutions that are provided internally. What you get from that are conventions and a streamlined approach to how you're developing your applications. Most of the framework solutions work for everybody and when they don't, you have plenty of opportunities to either extend or reuse certain components differently. This works out so well that, really, once you've seen one good Django project you've seen all of them.

Spring, on the other hand, tends to impose as little constraints as possible. Aside from satisfying Java EE platform requirements, you're at the liberty to pretty much wire your application in any way you'd see fit. The components that you write to provide actual behavior are intended to be as loosely tied to the framework itself and you'd just end up using certain components provided by Spring to manage how they're discovered, wired, managed and consumed. The problem is that you're at the liberty to customize even the most minute aspect of the application, which means that you'd be making a lot of decisions and every Spring Web application will be uniquely designed.

11/15/2013 10:31:53 PM

Spring has its own web MVC framework, but it's much more:

  1. A dependency injection/inversion of control factory
  2. Aspect oriented programming.
  3. Modules for persistence, remoting, and other features.

Django is a Python web MVC framework for creating browser UI CRUD applications.

I would say that Grails, a Ruby on Rails-like web CRUD framework for Java that's based on Spring, Hibernate, and Groovy, would be a better analogy for Django. Both use "convention over coding" to speed development along.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow