5 ms·
Play 2 vs. Grails 2 Smackdown
- zoowar 14y agoI enjoyed the mechanics of traversing this slide show with my mouse wheel.
- supersaiyan 14y agoI didn't realize that the site could scroll and just closed it, until I saw your comment
- eranation 14y agoNote it also scrolls down, I nearly missed half of the presentation at first, look for a green down arrow
- Cbasedlifeform 14y agoI have to confess I found this the most confusing navigation interface ever. I quit after a half dozen slides. Was there a "home" option somewhere I stupidly missed?
- Posibyte 14y agoIf you want to know the presentation software, it's Reveal.js http://lab.hakim.se/reveal-js/ http://lab.hakim.se/reveal-js/
- moondowner 14y agoSorry, but I'd go with Spring MVC (with Thymeleaf) + Spring Data JPA :)
- jaytaylor 14y agoWhy are you sorry? Different frameworks have different strengths (and weaknesses!). When in doubt, going with what you are most comfortable with is frequently a good bet.
- stuff4ben 14y agoThanks for mentioning Thymeleaf! May start rewriting one of my projects for my day job to use it. Much nicer than JSP.
- mgkimsal 14y agoPartial to Grails - would liked to have seen the 'demo data' approach in Grails call an external service method instead of inline in the bootstrap process. It's the default way that's shown, but doesn't allow for too much growth. It's one of those 'default' things that you see everyone doing because it's what's promoted, but it's not really a great practice - having a separate service method that can rebuild initial or sample data (which can also be invoked from other locations, not just the bootstrap) would be preferable. Or, perhaps better, use one of the 'sample data' plugins which provide DSLs for that sort of thing.
- bstar77 14y agoIt's unfortunate that the benchmarks are hidden behind links. I'm not sure most people checking this presentation out will notice that.
- eranation 14y agoA relevant recent JVM framework poll: http://www.infoq.com/research/jvm-web-frameworks http://www.infoq.com/research/jvm-web-frameworks (tl;dr Spring MVC first, then Grails, then Play)
- jlward4th 14y agoDepends on how you read the numbers, so here are the results for those 3: Option Adoption Ready Importance Votes Spring MVC 85% 82% 851 Play 71% 78% 735 Grails 77% 76% 711
- eranation 14y agoYep, thanks for the comment (And thanks for the great presentation!) I'm personally going to try Play next actually, mostly due to Scala being typed
- babs474 14y agoGrails is decent in my experience but I have two major gripes after working on a large Grails project 1. code reloading (ie change code, see results) doesn't work reliably and server restarts are slow 2. The ORM is still based on hibernate. Is it just me or does anyone else have an incredibly difficult time with hibernate? I've wasted many stressful days debugging weird flush exceptions. I've never had trouble with ActiveRecord. I think it boils down to the concept of a "session" in hibernate, which is essentially a giant global variable begging you to touch it or look at it wrong, whereupon it will plot its revenge by deciding which obscure exception to throw at flush time.
- mbell 14y agoHibernate is useful in one situation: you have a transaction that has to exist across actions taken by multiple disparate services, and you still need the container to manage this for you. In my opinion, if your in that situation, you either have an application that is an edge case, or you've architected your application poorly. My rule of thumb: If it has the word 'enterprise' anywhere in it's name or description. Avoid it like the plague, only use it if its the last available option.
- babs474 14y agoCouldn't agree more about the enterprise sentiment. That is why I like things like Grails, that try and drag the enterprise java world, kicking and screaming into the modern era of ruby on rails style mvc and such. I think Grails mostly succeeds at this modernization, but I have to give fair warning that there are still some enterprisey bits (Spring, which isn't so bad and Hibernate, which will bite you) down in the guts. edit: Forgot to mention that Groovy is a fantastic, under-appreciated language with some neat features that should get more attention. Groovy is a major selling point for using Grails.
- mbell 14y agoI love groovy. Anytime I have something 'Java-JVM' that isn't performance critical, I write it in groovy. But even that mindset is falling away given the ability to use @CompileStatic. The best part of groovy to me is that I can use it where I want, when I want, with a single POM dependency and without (generally) having to think about how it interacts with existing Java code. When I write a Jersey controller, I start in java, if I hit a point where I'm thinking "this would be easier with a closure" or "defining an entire inner class here is stupid", I stop, change the file ending from .java to .groovy, and code away.
- M4N14C 14y agoIs Rails on JRuby not considered a productive JVM web frameowrk? Edit: Based on this claim: "Play 2 and Grails 2 are often hyped as the most productive JVM Web Frameworks." Slide 2
- mark242 14y agoSince June, when the presentation was created, Play has gone through a few big revisions. The primary method of accessing a database is Anorm (which, if you aren't a Hibernate fan, Anorm is a huge win) although you can also use Hibernate, or you also have the choice of using Slick, which is Typesafe's ORM (and a lot easier to use). IntelliJ 12 has better support for Play as well, and the overall performance has improved a great amount. It's too bad that the presentation doesn't include sample Scala code for Play; imho this is the number one reason to use Play. The saveRating() controller method that they use as Play's example, which is some twenty lines of Java code, could be done in one or two lines of Scala code. Similarly, running a job in Play is essentially just spinning up an Akka actor and scheduling messages to send to it-- very very straightforward. Play has been extremely easy to work with, especially with writing Scala code, and it's much more lightweight compared to, say, the Lift framework.
- mbell 14y agoHas play stopped using Ebean? It's my favorite Java ORM and I've never heard of Anorm.
- jaytaylor 14y agoYou can of course use whatever ORM you want, but it comes with Anorm.
- jiggy2011 14y agoCan Play 2 be made to work well with hibernate+JPA? I know many people don't like it , but I invested a fair amount of time into understanding hibernate and if I stick with the JVM I would want to be able to apply that.
- mark242 14y agoYes, it will work. There's no magic sauce about adding whichever ORM you want; just declare it as a dependency in your build file and you're ready to go.
- rockyj 14y agoI don't know why JRuby + Rails gets no love. JRuby is similar to Groovy but the Rails ecosystem is far far better than Grails. I have worked on all three frameworks and I think - - The Rails ORM (ActiveRecord) is far more superior and mature than ANORM or anything out there - The Rails templating system is super easy and feature rich - Rails has awesome libs like Devise (Authentication), Cucumber (BDD) and Capybara (UI Testing) - The argument that Ruby is slow is not really valid with JRuby + Torquebox. Yes, it cannot match Java but for most apps it is sufficiently fast. All in all, I have been trying to find a better combination than Rails + JRuby but I cannot find any. If pushed against a wall I would only say that for large projects some sort of type safety helps which Scala can provide but prepare for some pain while development (when compared to JRuby + Rails ecosystem).
- eeperson 14y agoI'm really surprised that you would consider ActiveRecord more mature and superior to anything else. I've always considered it the weakest part of Rails. It doesn't include support for foreign keys (you can ad it with a 3rd party plugin but I was really surprised that it wasn't included) and it gives you no control over which fields are lazy loaded. Am I missing something? Why do you consider it superior to everything else?
- rockyj 14y agoAbout foreign keys - http://guides.rubyonrails.org/migrations.html#active-record-and-referential-integrity http://guides.rubyonrails.org/migrations.html#active-record-... About Lazy Loading at field level it is not really needed in most scenarios. You can do it with your own code if you wanted it that way. Edge case scenarios may be handled differently in most ORMs however with Active Record I never felt the need to write SQL ever. Also for simple checks I use the Rails console to see data whereas with other ORMs I had to open a SQL console.
- jlward4th 14y agoIn case anyone wants to check out the live demos of the apps that Matt Raible and I built for this presentation check out the Grails app: http://bike.ubertracks.com/ http://bike.ubertracks.com/ And the Play app: http://hike.ubertracks.com/ http://hike.ubertracks.com/ The code is at: https://github.com/jamesward/happytrails https://github.com/jamesward/happytrails Both apps are a bit dated at 7 months old because Grails and Play have been progressing pretty quickly. With Play 2.1 on the horizon it's probably time for a refresh. And as someone pointed out, I've need to do a Scala + MongoDB + Single Page App version. Just haven't had the time. But in case anyone is interested, someone did create a Spring MVC version of the app: https://github.com/brentlemons/runhappy https://github.com/brentlemons/runhappy
- jiggy2011 14y agoI started using Play! when it was at about v1.0 because it was a simple light framework and an easier alternative to grails or spring. I'm not going to use it for any new projects though. Play 2.0 is a whole different thing which seems targetted at Scala mainly (which I don't have time to learn) , and is not very backwards compatible with play 1.x at all.
- eranation 14y agoIn my opinion it's worth the time spent learning, I think Scala is much less complex than its reputation and doesn't take much time to learn the basics, and once I did, I didn't want to go back to Java which seems to me now much more complex and cumbersome than Scala. It's really starting to become my favorite general purpose language.
- jiggy2011 14y agoI'm sure it's a decent language. It's that I have only so much learning time available and Ruby/JRuby , JS and ObjC seem like they would be a more practical use of it. If I wanted to learn something for personal interest I would probably want to do Scheme,Haskell or Go.
- ndeverge 14y agoI don't know if Scala is a good programing language, but it makes me a better programer.