Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

just curious to know the difference between spring mvc vs django [closed]

Tags:

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?

like image 776
Maverick Avatar asked Dec 17 '11 19:12

Maverick


People also ask

Which is better Spring or Django?

Both Spring Boot and Django are famous frameworks. Both frameworks have almost identical characteristics. So, if you're excellent with Java, Spring Boot is a good choice for your project. But, if you're good with Python, Django is a fantastic choice.

What is difference between Spring and Spring MVC?

Spring Framework is an open source application framework and inversion of control container for the Java platform. Spring MVC (Model–view–controller) is one component within the whole Spring Framework, to support development of web applications.

What should I learn first Spring or Spring MVC?

In short, yes. Spring MVC borrows a lot of concepts like dependency injection from Spring, so you need to burn these concepts in before learning Spring MVC.


2 Answers

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.

like image 120
Filip Dupanović Avatar answered Sep 28 '22 11:09

Filip Dupanović


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.

like image 44
duffymo Avatar answered Sep 28 '22 13:09

duffymo