views:

87

answers:

2

Hey,

I'm a long time Java programmer and I'm digging into Django recently to see what it offers.

It looks to me that Django doesn't fit Java web developers taste.

I mean in MVC Java web frameworks we have usually a controller class that receives the request, do the logic and then forwards the request to another destination.

Rails also follows this paradigm.

Django on the other hand looks a little bit procedural, you map requests in a file, write your handlers in another, write your domain classes in another ...

So, I think Rails suits Java web developers taste and Django suits PHP folks.

If you are a Java web developer, how do you see Django?

Are you a Java programmer that is happy using Django?

(I'm not underestimating Django, Django framework is unquestionable).

+3  A: 

Django on the other hand looks a little bit procedural, you map requests in a file, write your handlers in another, write your domain classes in another ...

As a Java developer, how is this any different than a traditional Java MVC pattern? It's just different names: Django uses "view" for what is traditionally (in Java-land) called a Controller, "template" for View, etc.

Don't you have domain classes in your Java application as well?

In Java-land, when you have an MVC webapp, you have the same sort of splitting of logic:

  • You write the request-handling logic in your Controller
  • You represent the "domain" in your Model/domain classes
  • You write the display logic in your view templates/classes

I'm having a hard time understanding what you think is different about Django beyond the names.

matt b
Django uses single file for domain objects, single file to collect request handlers.In Java you write a POJO or you inherit a class, in Python you write plain methods, there is no feel of Object Oriented world.I don't feel there is kind of splitting or "clean layout".That what I meant by procedural nature.
El Gusto
@El Gusto - no one requires you to write your "domain classes" (by which I assume you mean Django models) in one file - in fact, it's a much better practice to split them up. I've no idea what you mean by Django not feeling OO. Do you mean you can't have object-oriented views? If so, you can (see http://stackoverflow.com/questions/742/class-views-in-django).
Dominic Rodger
Yes sorry I mean Django models (sorry I'm new in Django land).How to split models over multiple files?say I want each model to has its own file.Aren't all models supposed to be in models.py?
El Gusto
No, they don't need to be. In python there is no difference between having one `.py` file with many `classes` and having many `.py` files each with one class in them.
matt b
A: 

I'd have to really look at it to make a judgment, but just going on your description it sounds a lot like Struts or JSF. I may have to dig into it, thanks for the suggestion.

mezmo
Django is MVC framework (or MTV in Django culture) so yes it smells like Struts but not JSF, JSF is component-based framework.
El Gusto