Slashdot Mirror


Mastering the Grails Powerful Tiny Web Framework

Someone from IBM tips this article on their Developerworks site about Grails, a modern Web development framework that mixes familiar Java technologies like Spring and Hibernate. "Grails gives you the development experience of Ruby on Rails while being firmly grounded in proven Java technologies. This article show you how to build your first Grails application with the lessons learned from Rails and the sensibilities of modern Java development."

16 of 89 comments (clear)

  1. There's a podcast of Scott Davis.... by tcopeland · · Score: 2, Interesting

    ...getting interviewed about Groovy here.

    There's some other good stuff there too, although the interview with Dr. Stonebreaker about column-oriented storage is kind of light on technical detail.

  2. Choose wisely by Anonymous Coward · · Score: 2, Funny

    I've heard that while the true Grail will bring you life, the false one will take it from you.

    1. Re:Choose wisely by smittyoneeach · · Score: 2, Funny

      Scalamouche, Scalamouche, will you do the fandango?

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  3. Rails set a milestone, what will be next? by filbranden · · Score: 4, Interesting

    It seems that Rails set a milestone for development frameworks, and nowadays everything new has to be based or inspired or copied from Rails. Seems that Rails really made a breaktrough there, in fact, it seems to be responsable for most of Ruby's popularity. Rails has been translated several times to other languages, like Python (Django, also TurboGears to a lesser extent) and Java (Groovy to a lesser extent, now Grails that it's a ripoff even on the name).

    This makes me think that sometime ago the buzzword of the moment was J2EE, and everything everyone made had to be J2EE compliant. Even C# and .NET was a big Microsoft ripoff of Java and J2EE to fight against the big migration of programmers to Java.

    Which leads me to the fact that soon the buzz around Rails will be over, as much as nobody creates a new J2EE-based framework, now everything is taken for granted. So, what will be the next milestone? The next technology that will have people talking? Have everyone trying to clone its own?

    1. Re:Rails set a milestone, what will be next? by Shados · · Score: 3, Interesting

      Who knows. The thing with Rails though, is that it brought a bunch of technologies that were big standards in the enterprise world, and packaged it as one...

      Its not much more than an MVC framework, an OR Mapper, and a 4th Gen tool wrapped as one... But in many circles, like in the PHP world, or in the more hobbyist groups of the other platforms, these things were not known. Basically, the people that browsed internet forums weren't used to it, and Rails brought it to them ine one buzzword compliant package... Its still not very special...

      So now, you have a bunch of frameworks in Python, PHP, .NET, or Java, that were really just derivative of the J2EE-based world, package themselves, tweak one or two "conventions", and change their name to BlahRail... but the tool is really the same as it used to be. Its just more buzzworld compliant now.

      So I guess Rails did set a milestone. A "buzzy" one. My current employer trips in his feet all over Rails (we're a .NET shop), and every few days shows me yet another "OMG!" feature of Rail...that actually was already implemented in our main product long before that buzzword came out... Oh, aside ActiveRecord::Migration. That we actually added after Rail. Thank god it brought to light that hugely complex and powerful feature! (That took exactly 6 hours to reimplement)

  4. Grails? by Loconut1389 · · Score: 5, Funny

    I guess they didn't want to call it Jails?

    1. Re:Grails? by jma05 · · Score: 2, Informative

      > whoosh!

      > Java + Rails = Jails

      No whoosh! The GP's joke was not a perfect match. Grails is a *Groovy* framework. Jails, as a joke, is better applied for something like Trails, which is a Java clone of Rails.

  5. Nice framework, slashdotted after 15 clicks by sticks_us · · Score: 2, Funny


    Our apologies

    The IBM developerWorks Web site is currently under maintenance.

    Please try again later.

    --
    "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth
  6. I have just one "word" for you... by SanityInAnarchy · · Score: 2, Insightful

    AJAX.

    Not that AJAX is a bad idea, but that it needed a word. And that word irritates the hell out of those of us who knew it as DHTML, or simply as Javascript.

    Or, how's this: "Blog".

    It's a journal, or it's a column. Either way, the only thing that makes it special is that it's on the Internet.

    Or how about this: "Myspace".

    This one makes me absolutely livid. It's Geocities 2.0, and you can just hear the resounding SMACK of a million programmers at once wondering why they didn't do it first. Not "think of it", because we already had Geocities, but do it.

    I'm with you, somewhat, but that doesn't mean Rails is worthless.

    --
    Don't thank God, thank a doctor!
    1. Re:I have just one "word" for you... by Shados · · Score: 4, Insightful

      and you can just hear the resounding SMACK of a million programmers at once wondering why they didn't do it first
      Here's where its different. With Rails, you have thousands of hobbyist and wannabes going "Why the hell didn't I think of that?!?!", and the rest of us looking at our existing frameworks going "Check...check...check...OH WAIT I don't have this...oh wait, I didn't WANT it because last time we tried we lost a 5 million$ in wasted time.... check...check....hrm...so what is it exactly?"

      Again, I remember bursting out laughing when my boss bragged about how superior Rails was because it had... a unit testing framework! "We don't have to make our own! It can even generates the base unit tests!!!!. Oh, and it can actually handles the Data Access Layer on its own!!!".

      Or the priceless one: "Rail puts MVC on the map!". I mean, thats even WORSE than your Ajax example.... its like if 3 years from now some framework came out with Ajax, and everyone thought it made Ajax mainstream... MVC has been a buzzword (and an overrated one) for so long, I've been wanting to cry even BEFORE Rail...

      Rails is definately great stuff, not saying any different... but really, it only makes a buzz among people who didn't know much before... At least Ajax mainstreamed async http requests in javascript (even though we were doing it in 2001ish here, we didn't have all the ajax framework available and had to do it on our own...but what Rails offer...we haven't had to do it for almost a decade...)
  7. Re:Fail by fireboy1919 · · Score: 5, Insightful

    Couple of things:
    toy object model that gets forced upon you all the time
    1) Hibernate makes Active Record look like a toy. If you have to deal with database systems that don't fit all the constraints of active record, you're pretty much out of luck. Not so with Hibernate. Hibernate basically converts a relational database into an object oriented database because of the availability of HQL. It's very different from just getting an OOP API on top of a relational database - which is essentially what Active Record is.

    Incidentally, if you've got legacy data with a compound key, how hard is that to deal with in Rails? It's pretty easy with Hibernate. (hint: extremely difficult)

    2) Spring eliminates glue more than anything else. Inversion of control is an advanced concept to do this, and unless your system has something like it, you have to write glue code (usually in your controller). There is nothing I know like it for any other language (ironically, there are several Java projects that do this. That alone makes it worth using languages that compile to Java bytecode even if you aren't using Java.

    Those are the modern sensibilities - design patterns that haven't yet caught on in any other language.
    As to the bloated, overengineered bit, I'm not entirely sure what you're referring to. Why don't you tell the whole class?

    3) This sounds like a poor man's Rails.

    More like a rich man's rails - where "rich" means "well educated in design pattern theory." For that matter, Java projects tend to be better funded and less buggy than rails projects, so rich man's rails probably fits in the traditional sense of "rich."

    --
    Mod me down and I will become more powerful than you can possibly imagine!
  8. Re:Fail by Cyberax · · Score: 3, Insightful

    IoC is nothing new. However, good IoC _frameworks_ is a relatively new development.

    Spring blows almost everything out of water - it's very powerful and easy to use, and it can be integrated easy enough with _everything_. Even for very complex applications.

  9. *cough* by Balinares · · Score: 2, Interesting

    > Rails has been translated several times to other languages, like Python (Django...)

    Absolutely not. Django preexisted the Rails buzz by years (it was an internal application at LJworld initially), and one of the reasons it's so good is that, unlike many, it is precisely not trying to mimic Rails.

    That doesn't invalidate your point, though. I just thought I'd point it out, because, you know, to reach the next milestone, you first need to stop targetting the current one, and as you point out, not many are doing that right now.

    --

    -- B.
    This sig does in fact not have the property it claims not to have.
  10. Re:Java Sucks by Wiseman1024 · · Score: 2, Interesting

    Java has to be overengineered, because you need to use its API (or rework it all from scratch). Its object model is a toy: it lacks countless of features such as multiple inheritance, mixins, dynamic modification, parametric polymorphism, functional properties, introspection, operator overloading, and the list goes on and on. If you want an example of a non-toy object model, i.e. one that doesn't get in your way, but actually allows you to build powerful abstractions, supplant builtins and reuse code that might even not yet exist, take a look at Python's.

    Also, I was not particularly defending Rails, nor claiming it can solve every problem.

    --
    I was about to say 13256278887989457651018865901401704640, but it appears this number is private property.
  11. Re:Java Sucks by Wiseman1024 · · Score: 2, Insightful

    Where's the compiler-checked documentation in Python? It's supposed those using Python seriously aren't supposed to need that kind of babysitting.

    Where's the keystroke or mouse-click to get to the implementation? What? That's not a feature of Python, nor Java, nor any language that I know of. You are talking about editors. And again, there's a point to make: a good language shouldn't require any special editor features because it's a mess. You can edit large Python programs with anything you want, as it never gets as bloated and complicated, and the abstraction capabilities are much better.

    Back to the language, can you in Java start a thread with a console so you can introspect into objects in real time, have access to a function's internals, the stack frames and anything else, update code in real time, and so on?

    To find all references? You can only do this reliably in a language that's so limited as to not have first-class functions, among other things. And I consider this lame. If we start omitting abstraction features to make things easier, we might as well end up with assembly. (Wait, you can dynamically alter code from assembly.)

    To rename things? Renaming symbols is as easy in Python as it would be in Java, only that you don't even have to go through all of it if you want something renamed just for you. For example, if you don't like the "pow" builtin function to be "pow" and want it named "power", just do power = pow. It's actually shameful that you can't do such a simple thing in Java. Perhaps that's one of the reasons why you're so concerned about renaming.

    Where's the IDE that finds errors while I'm typing? Do you really like all those babysitting features? There are lints for Python, as well of syntax highlighting, and that's more than you should need.

    More importantly, you shouldn't want to know, for example, whether a property you're trying to use actually exists, or whether an object you're passed is of a particular class. That breaks abstraction and reusability
    --
    I was about to say 13256278887989457651018865901401704640, but it appears this number is private property.
  12. Re:Java Sucks by leighklotz · · Score: 2, Informative

    > Where's the keystroke or mouse-click to get to the implementation?
    EMACS and tags; Meta-.
    > For auto-completion?
    EMACS and dabrev; I bind it to Meta-Space.

    > Where's the IDE that finds errors while I'm typing?
    EMACS and flymake; It works for Java, PHP, perl, python, etc.

    Here are screenshots of it working with python, all candy-colored for your editing pleasure, with mouseovers or minibuffer reports of errors as you type:

    http://blog.printf.net/articles/2007/10/15/productivity-a-year-on