views:

1376

answers:

16

I was looking around to see if there is an equivalent to django/RoR in java.

I found:

Does anyone have ever tried those frameworks, or do you know any other? Are they faster than django/RoR?

+1  A: 

Hi,

I don't know about the Play Framework, but to answer the second question, we are doing some projects with Google's Webtoolkit. Could be worth checking out.
Good luck!

jhwist
A: 

I don't know about Play Framework, but Spring MVC or Struts together will Hibernate will offer similar functionality.

There are many other options available. Basically you need an MVC framework (Spring MVC, Struts, Wicket) and an ORM tool (Hibernate, iBatis). Of course you would need to integrate the needed components yourself, but this has been done already many times and you will be able to find plenty of information.

kgiannakakis
A: 

How about JRoR

jitter
JRuby on Rails is not a Java web framework! It's Ruby on Rails running on a JVM.
John Topley
The same mistake is made in the question itself, so presumably the asker doesn't mean only java :)
Bozho
yes I didn't know I'm editing now.
mnml
A: 

I'm not sure if Spring MVC and Hibernate provides the same ease of use that Ruby on Rails provides (actually, I'm sure it is much more complicated...). Play Framework is much more like Ruby on Rails I think, however I didn't us it myself and only watched the screencast and read some documentation on it, so if you want to have a similar experience to developing using RoR, I think you can better try something like Play instead of Spring MVC with Hibernate. The advantage of the latter is that it is very powerful and is able to adapt to an existing datamodel for example (from what I know on RoR, that is not very trivial in RoR). Another framework you could consider is Groovy on Grails. While it doesn't use Java (it uses Groovy), it is very RoR-like. It uses Spring and Hibernate under the hood (if I'm correct) and the advantage of Groovy is that you don't have the strict static typing of Java. Ruby on Rails and Django benefit heavily from the dynamic nature of the language in which it is implemented, a feature Java misses because of its static typing.

Edit: ah, you mentioned Grails already in your question...

Martin Sturm
A: 

if grails is an option (which is actually not a java but a groovy framework) then the Scala-based Lift framework would be an option, too.

bertolami
+1  A: 

Haven't tried it myself, but colleges of mine enjoy using stripes

There's a book and everything.

Buhb
A: 

Another option is RIFE, which tries to have the minimal configuration of RoR while still being in Java. On your list, only Play Framework has that feature, the others are on the JVM, but are not Java (if that is important to you at all).

Yishai
+2  A: 

Stripes seems to be quite lightweight and embraces Convention over Configuration.

John Topley
Stripes looks very interesting indeed. +1
JUST MY correct OPINION
A: 

What about VRaptor? - it uses Spring as DI Container and a Controller/View engine similar to Rails Action-Pack.

Lucas
+1  A: 

Having used struts, wicket, rails & Tapestry, I recommend you look into Tapestry 5.

It supports

  • in container class reloading (so you dont have to restart your webapp each time you make a change)
  • fast development time & increased productivity - it uses a component based model, with declarative wiring
  • minimal configuration, which is mostly in code anyway, convention over config - etc..
  • No base classes to extend
  • An expression language for use in template files
  • good ajax support
  • excellent debugging support, both client and server side
  • good data access integration
  • an active community
  • written from the ground up with performance in mind. e.g. page pooling (to minimise resource usage), page compression, whitespace elimination, all dynamic code is compiled to native.
  • good bean and form support - making common tasks simple. A sortable database backed drid can be coded with just one line of template code, and a minimal skeleton server backend.

the only downside is the documentation, which, is good, but a little terse, although the user groups/mailing lists are very active and most questions are answered well & eagerly.

(Also, be sure to only look at T5 - and not T4,3,2,1..... as these are very different to the current version)

More on why here.

Joel
+11  A: 

I discovered Grails about a year ago, and haven't looked back. It takes a lot of ideas from Ruby on Rails (original it was named Groovy on Rails), and has a rich ecosystems of plugins / extensions. Grails, and underlying Grails language (superset of Java) make it a joy to program - you can really focus on the essentials. Its GORM functionality (a layer on top of hibernate) is also very powerful, and in addition to the plugin system, is one of two huge reasons to check it out (you can use it in your java apps as well).

With version 1.2 about to come out, I feel it's feature-rich and mature enough to be something that any developer should have in their toolbelt.

As far as performance, it's definitely less than that of pure Java, but you have everything from spring / hibernate / J2EE available to you to optimize, and you can always drop into pure java for some critical pieces of code. There have been some recent experiments with allowing to run part of the Groovy code using static method resolution, which, coupled with invokedynamic support, should provide huge performance boosts.

Other ones to check out in Java are Spring Roo, and AribaWeb.

Update Based on Additional Qualifications

Scalability, Productivity, Documentation, and decent Resources consumption

  • Scalability - you get the proven Java / Spring / Hibernate stack, though I can't say Grails provides much itself.
  • Productivity - this is the main reason to use Grails. You do have a performance overhead, but Grails is what you use when development time / productivity is more important.
  • Documentation - the grails docs are great, and there are at least three good books written on Grails alone. The community is thriving and very helpful.
  • Resources Consumption - that is the one tradeoff. Grails (partially because of the underlying java stack) is resource-intensive. If I was building something like Google, Grails would not be the choice. However, in any web app of any sophistication, you'd do well for a caching solution, so same applies here.
Jean Barmash
Well yeah, grail seems great. But think I'm going to try "Play", it looks really attractive.. the only thing I'm worried about is Resources Consumption and whether is worse or better than php/python/ruby, I didn't manage to find much about it on google.
mnml
Sounds good - play looks cool. Also check out AribaWeb videos - looks very sweet. Just keep in mind that with Grails, you also get the power of Groovy, which in itself is an advantage (though of course performance is a tradeoff).
Jean Barmash
Ok, I'll have a look at AribaWeb. Play framework uses Groovy too for its templates ;-)
mnml
A: 

Spring Roo claims to be a solution.

ctron
+1  A: 

Consider trying Lift Framework. It`s really great.

folone
A: 

AribaWeb also supports Groovy. Check out our other features at http://aribaweb.org/ and find out our approach to making web development productive.

AribaWeb Team
+2  A: 

Anytime you are contemplating an application stack (language, framework, etc...) you also need to consider what are you trying to solve for and what kind of programming skills do you have at your disposal. I've found that more experienced Java programmers have been very productive with the Groovy and Grails stack when compared to more junior programmers.

You mention the following as areas of concern:

  • Scalability: in terms of what exactly? (page views/second, # transactions/second, etc...) In general, Groovy & Grails will scale when it comes to rendering pages, however as with any application stack using ORM (in the case of Grails you have GORM) there is some overhead to consider.
  • Productivity: one of the primary advantages here - quick prototyping, rapid development is a breeze with Groovy & Grails, though it helps to have folks on staff that have developed in Java or Ruby to understand what the Grails framework is actually doing "under the hood". There are tons of plug-ins for the UI that help with creating web 2.0-like pages very quickly.
  • Documentation: there is an increasing number of quality reference books being written for Groovy & Grails. Both are maturing very nicely over the last 2 years. Things are certainly not very well documented with respect to much of the inner working of the Grails framework when errors/issues are encountered (much of the output from the framework is obscure or non-existent at best when an error is faced). If you are willing to roll up your sleeves and be resourceful in walking through the inner workings, then you won't be disappointed with this stack. Again, experienced programmers will find this as second nature while more junior folks may throw up their hands in frustration at times.
  • Resource Consumption: there is overhead, however with most of the hardware found today (local or in a cloud) I wouldn't worry too much about physical resource consumption for a given application instance.

Hope this helps.

timarmandpour
A: 

We use Stripes framework extensively and it works really great. It's really lightweight and it directs you towards a clean design of your applications. It basically just hides the boring parts of development from you, so you can focus on the fun stuff (One such example are the indexed properties).

Anze