Mastering the Grails Powerful Tiny Web Framework 89
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."
mirror (Score:1)
There's a podcast of Scott Davis.... (Score:3, Interesting)
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.
Re: (Score:2)
Does anybody have an example of something Stonebraker has said that isn't vapid, patently obvious, or flagrantly wrong?
Choose wisely (Score:2, Funny)
Re: (Score:3, Funny)
Re: (Score:1)
Re: (Score:1)
Rails set a milestone, what will be next? (Score:5, 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?
Re:Rails set a milestone, what will be next? (Score:4, Interesting)
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,
So I guess Rails did set a milestone. A "buzzy" one. My current employer trips in his feet all over Rails (we're a
I have just one "word" for you... (Score:3, Insightful)
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",
Re:I have just one "word" for you... (Score:5, Insightful)
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...)
Re: (Score:2)
Maybe that happened with AJAX, too. But like Rails, it's possible (though not necessarily easy) to leave out the parts you like.
Example: Call it "AJAX", use that style of programming, but use JSON ins
*cough* (Score:3, Interesting)
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
Re: (Score:2)
Grails? (Score:5, Funny)
Re: (Score:2)
Re: (Score:3, Informative)
> 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.
Nice framework, slashdotted after 15 clicks (Score:2, Funny)
Our apologies
The IBM developerWorks Web site is currently under maintenance.
Please try again later.
Fail (Score:1, Flamebait)
The sensibilities of modern Java development? What a poetic way to say "we've dumbed it down and made it a living toy-OOP hell". Besides, modern Java development is usually Google code search copypasta with so
Re: (Score:1)
Java Sucks (Score:2)
Re: (Score:1)
I'm not an expert on PHP objects, but Perl objects are typesafe through collections, they do support dynamic invocation, and they do support the method missing operation.
Are you claiming that Java's lack of those features makes it not a toy?
Re: (Score:2)
Re: (Score:1)
Can you really call that type safety? I have the impression that real type safety requires type information to exist. If your preprocessor erases it, it's not there.
Re: (Score:2, Interesting)
Re: (Score:2)
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.
Python is dynamically typed -- all that flexibility comes at a price. Where's the compiler-checked documentation in Python? Where's the keystroke or mouse-click to get to the implementation? To find all references? To rename things? For auto-completion?
Where's the IDE that finds errors while I'm typing?
Re: (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 J
Re: (Score:2)
It's supposed those using Python seriously aren't supposed to need that kind of babysitting.
One man's productive facilities are another man's "babysitting". Of course the C++ guys talk like this too, and would say the same thing about Python when it comes to stuff like garbage collection. Engineering is all about tradeoffs.
You are talking about editors.
Static typing makes the stuff I'm talking about easy to implement.
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.
There is no limit on complexity, and even for a small project it's nice to have easy one-click access to stuff instead of grepping through code or poking around documentation.
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.
I frequently find better names f
Re: (Score:3, Informative)
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 [printf.net]
Re: (Score:2)
Re: (Score:1)
As a typed language, it's pretty good considering the options.
It has no type inference. It leaves a lot to be desired, even for a statically typed language.
most major things have since been corrected or there is a better 3rd party library available
Some of the newer stuff is also bloated and overengineered. And you end with two sets of classes, the lower-quality older ones and the ENTERPRISE BUSINESS BEST-PRACTICES but more correct newer ones. For example, the date stuff.
There is pretty much no reason to ever use multiple inheritance.
This translates to "I have never needed to use multiple inheritance". Others might. But even so, there's more of a reason to use mixins, and Java doesn't support these either.
Mixins are a Ruby feature and are not needed either.
Why? Because
Re: (Score:1)
Maybe because the JVM is the highest performance execution environment for web applications? We all know Ruby and Python are rocking for performance (not!).
OMG OPTIMIZED! Why not write an Apache module in C with inline assembly? (Tip: your time and insight costs more than hardware.) Also, Python is not performing too bad. Ruby is currently slow. Not that I care much either way.
And arguably the Java has the best libraries of any language
Best libraries? You call that piece of bloat "best"? A good library shouldn't waste more time to learn and use than it'd take you to do without, and this is often the case with Java. A good library is simple, intuitive, and easy enough to remember. And this is almost never the case wit
Re:Fail (Score:5, Insightful)
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."
Re: (Score:1)
I'm not sure if you mean "I only know Java", "I didn't know that IoC is a 20 year old pattern", "I don't know that IoC and event-driven programming are almost completely isomorphic", or something else. Can you elaborate?
Re: (Score:2)
I've used 14 languages and counting for development projects, including at least one of each of the interesting language types I know about (script, HDL, functional, pure imperative, assembly, compiled, bytecode compiled, purely graphical), . Ruby is among them. If you know another language or VM that gives IoC capability, why not share with the whole class? Java is heavy for my development tastes, and if I could get IoC in a 5MB footprint, I'd be all over that language.
"I didn't know t
Re: (Score:2)
It would probably be shorter to list the languages that don't give IoC capability; just about every modern language does that. Whether a particular fra
Re: (Score:2)
Re:Fail (Score:4, Insightful)
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.
Re: (Score:2)
Are you comparing it to other Java IoC frameworks, or other IOC frameworks regardless of language? To me, some of the dynamic language IoC frameworks (though generally younger and somewhat less mature) seem to have a lot of desirable features, particularly many of them tend to be very well integrated into the host language without requir
Re: (Score:2)
The biggest Spring feature - it can use the whole gamut of Java technologies. For example, my current application can be used in EJB container or standalone with Atomikos distributed transaction manager. With zero changes in code.
But I was not even able to _find_ a distributed transaction manager for RoR! And it's absolutely essential if you need gua
Re: (Score:2)
That's true of most Java frameworks, and many non-Java frameworks that happen to run on the JVM.
I'm not sure what this has to do with Spring's superiority to other IoC (in the dependency injection sense) frameworks since RoR is not an IoC framework, and distributed transactions are a service, not an element of IoC. Really, Spring is a pretty big applicatio
Re: (Score:1)
More like a rich man's rails - where "rich" means "well educated in design pattern theory."
I was going to reply with something else, but this just made my day. Are all Java programmers this funny?
Tip: "Design patterns" are circle-jerk material for Java copypast- I mean programmers. "Design patterns" are fundamentally wrong. If you see a pattern of *any* kind, you need to make it a function, a macro, or some other kind of abstraction, not copypasta it over and over. And if your language does not allow you to do this, then you need to look for a better language.
(In a way, this modern jerk off of d
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
And... copypasta! Copypasta! Copypasta! I hope it's annoying enough; this way you'll feel worse the next time you need to copypasta some "professional best-practices scalable enterprise business design pattern". I'm tired of having to maintain crappy code that needs to be modified in the same way in several different places because they didn't generalize (or the language didn't allow generalizing) properly.
Re: (Score:2)
Re: (Score:1)
The "factory pattern" is a good example. "Factory classes" are a stupid wart of limited langu
Re: (Score:2)
That's true. The right thing to do with patterns is use them as observations of needs in language and library design: anything that is frequently repeated in code should be abstracted out. Unfortunately, Java doesn't have the kind of flexibility that makes abstracting a lot of common patterns out, and so instead of being observations that serve as the basis for abstraction, they become guidelines. This is why frameworks that do manage to support abstr
Re: (Score:1)
Stop hyping design patterns so much (you and the rest of the world, because I've been seeing it showing up on resumes more and more). The patterns themselves don't matter. Nobody cares if something uses 13 different design patterns to get a job done. They care about understanding how a system works, and design patterns provide the necessary vocabulary to talk about it, nothing more.
Re: (Score:2)
All the productivity you could want gets lost by working with Java and its bloated, overengineered, god awful API and toy object model that gets forced upon you all the time.
Um, Grails works with Groovy not Java. Groovy does Functional Programming [codehaus.org] stuff like code currying [wikipedia.org]:
Re: (Score:2)
Its almost exactly the opposite: its more of Rails, repackaged to appeal to enterprise users.
What makes you say that Groovy is a "limited, powerless, unexpressive language"?
Nice for quick simple web apps (Score:1)
Actually at least you are in control when you do that. Somebody else's programming and database schema paradigm are quite often quite different from your own. It is good for everyone to have to all the parts so that they know how it works. Sure, they might use an off-the-shelf framework later on, but they need to k
Re: (Score:2)
Re: (Score:2)
Besides, on top of everything you said, there ARE things like Hibernate...your own schema, and no need to worrie about the JDBC stuff! And I don't know about Hibernate, but many similar tools will handle stored procedures just as cleanly to boot, so it will even work at the enterprise level.
Re: (Score:1)
Note that I think that a good developer - in any language - should also be a good database architect and be able to create a good schema with i
Re: (Score:2)
Yeah, once upon a time that was the more common way of doing it, and most homebrew OR mappers used that (since its a lot easier to code really). As far as I can tell, the issue with that comes from separation of concern and dependency injections and all that.
.NET World is LLBLGEN Pro. The mapping is computed
If you want to change the class, you need to have the mapping redone too. A nice in between, for example, in the
See Scott in person if you can (Score:2)
Nothing to see here... (Score:2)
Grails... (Score:1, Interesting)
Then the clouds parted, the angels sang, and there before me stood Groovy and Grails.
Groovy is pure joy in a bucket. It was so much less painful to transition to Groovy. Grails made so much more sense than JSF and Seam. Jetty was so much easie
i'll give it a try (Score:1)