Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Mastering the Grails Powerful Tiny Web Framework

kdawson posted more than 6 years ago | from the coffee-on-the-train dept.

Java 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."

cancel ×

89 comments

mirror (1)

larry bagina (561269) | more than 6 years ago | (#22196876)

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."

There's a podcast of Scott Davis.... (2, Interesting)

tcopeland (32225) | more than 6 years ago | (#22196894)

...getting interviewed about Groovy here [javaworld.com] .

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:There's a podcast of Scott Davis.... (-1, Troll)

Anonymous Coward | more than 6 years ago | (#22197112)

)
  ( \
    X
8====D

Re:There's a podcast of Scott Davis.... (1)

dozer (30790) | more than 6 years ago | (#22198592)

Michael Stonebraker sure sounds like a moron: http://stuffthathappens.com/blog/2008/01/19/mapreduce-reading/ [stuffthathappens.com]

Does anybody have an example of something Stonebraker has said that isn't vapid, patently obvious, or flagrantly wrong?

Re:There's a podcast of Scott Davis.... (0)

Anonymous Coward | more than 6 years ago | (#22200036)

Go read about Michael Stonebraker [wikipedia.org] before you accuse him of "sounding like a moron". He's a man that has been single-handedly responsible for some of the best database products ever. He was involved with the initial development of Ingres, Postgres (today's PostgreSQL), and Illustra. He has started numerous successful companies, and then sold them off to other successful companies like PeopleSoft and Informix.

He's done more for the study and implementation of database systems than virtually anyone else. Even Dr. Codd's contributions pale in compared to what Dr. Stonebraker has done. And compared to either of them, you've done nothing. Hell, I doubt you've even started your own company before, let alone ran it successfully, and then sold it off for profit.

Re:There's a podcast of Scott Davis.... (0)

Anonymous Coward | more than 6 years ago | (#22210644)

> Does anybody have an example of something Stonebraker has said that isn't vapid, patently obvious, or flagrantly wrong?
Ingres was a bit vapid, and I suppose you could say PostGres is obvious, but neither is flagrantly wrong.

Choose wisely (2, Funny)

Anonymous Coward | more than 6 years ago | (#22196974)

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

Re:Choose wisely (2, Funny)

smitty_one_each (243267) | more than 6 years ago | (#22197176)

Scalamouche, Scala [scala-lang.org] mouche, will you do the fandango [wikipedia.org] ?

Re:Choose wisely (1)

AndroidCat (229562) | more than 6 years ago | (#22197528)

Well, I'll ask him, but I don't think he'll be very keen. Uh, he's already got one, you see.

Re:Choose wisely (1)

palegray.net (1195047) | more than 6 years ago | (#22218150)

Only after you learn the secrets of coding a shrubbery. I debug in your general direction.

Rails set a milestone, what will be next? (4, Interesting)

filbranden (1168407) | more than 6 years ago | (#22197254)

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? (3, Interesting)

Shados (741919) | more than 6 years ago | (#22197384)

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)

I have just one "word" for you... (2, Insightful)

SanityInAnarchy (655584) | more than 6 years ago | (#22197568)

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.

Re:I have just one "word" for you... (4, Insightful)

Shados (741919) | more than 6 years ago | (#22197726)

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...)

Re:I have just one "word" for you... (0)

Anonymous Coward | more than 6 years ago | (#22199670)

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?"
Exactly what web frameworks and what features are you talking about?

Re:I have just one "word" for you... (1)

SanityInAnarchy (655584) | more than 6 years ago | (#22229710)

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....

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 instead of XML.

Of course, the other difference is that AJAX is a bit more nebulous of a concept. Rails is a concrete framework, and a nebulous cloud of ideas that people port to other languages, and either to the existing frameworks, or they create a new one.

*cough* (2, Interesting)

Balinares (316703) | more than 6 years ago | (#22199376)

> 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.

Re:*cough* (1)

catch23 (97972) | more than 6 years ago | (#22256934)

I don't know why Django is compared with Rails here. Normally Pylons would be compared with Rails. Pylons would be the "rails" equivalent in python. Pylons was created after the whole rails thing unlike django...

Re:Rails set a milestone, what will be next? (0)

Anonymous Coward | more than 6 years ago | (#22200940)

The idea of convention over flexibility is the big rails coup. The thing that tends to make J2EE difficult is that every component is designed to be super flexible and it results in having to configure a bunch of XML files a bunch of different ways. With Rails, Grails, Django, and seaside you pretty much do it the same way as everyone else and they've produced little programs to do the configuration for you. If you're working on a disposable application or an application where presentation is more important than function (a la consultants or pragmatics) then it's a huge win, you practically don't have to do any "configuration."


There are downsides though, one of the biggest things the J2ee folks have been pushing is to separate the view from the controller and get them fairly code homogeneous. With Rails it is very easy to comingle javascript, html, and ruby/rails DSL in single files. They have some templating too but every rails app I've seen had views with all of those mixed together. This isn't terrible but if you're working on a team with a fairly large app it is almost always a mistake in the longer term. Even though it's "more work" and requires some amount of "repeating your self" abstraction can pay off hugely on large projects over time, it's not a bad thing. Again, if it's your blog or something that will not be in use for that long, why would you care? just make it work and move on.


The use of convention over configuration also makes it easier to do some of the more complicated web dev things, like doing AJAX in an intelligent way, which again adds more sexy to it which helps to make it more popular. In Rails you can fairly easy enable AJAX by doing things exactly like everyone else, j2ee apps all seem to have different ideas and mechanisms to do it which again, makes for more work and possibly more complexity, but also more flexibility, if only you can ever leverage it.


Word is Rails has about peaked in terms of the media hype, here [tiobe.com] , I'm not sure how credible this is though, if it is accurate then it will be a matter of technical merits going forward. It's clearly changed the rules some. Look at how long struts has been around and still a lot of people don't know how to really use it, the world might have been different if there was a definitive "this is how to use struts" kind of how-to or framework.

Grails? answer me these questions three! (0)

Anonymous Coward | more than 6 years ago | (#22197268)

Bridgekeeper: Stop. Who would cross the Bridge of Death must answer me these questions three, ere the other side he see.
Sir Lancelot: Ask me the questions, bridgekeeper. I am not afraid.
Bridgekeeper: What... is your name?
Sir Lancelot: My name is Sir Lancelot of Camelot.
Bridgekeeper: What... is your quest?
Sir Lancelot: To seek the Holy Grail.
Bridgekeeper: What... is your favourite colour?
Sir Lancelot: Blue.
Bridgekeeper: Go on. Off you go.
Sir Lancelot: Oh, thank you. Thank you very much.
Sir Robin: That's easy.
Bridgekeeper: Stop. Who would cross the Bridge of Death must answer me these questions three, ere the other side he see.
Sir Robin: Ask me the questions, bridgekeeper. I'm not afraid.
Bridgekeeper: What... is your name?
Sir Robin: Sir Robin of Camelot.
Bridgekeeper: What... is your quest?
Sir Robin: To seek the Holy Grail.
Bridgekeeper: What... is the capital of Assyria?
[pause]
Sir Robin: I don't know that.
[he is thrown over the edge into the volcano]
Sir Robin: Auuuuuuuugh.
Bridgekeeper: Stop. What... is your name?
Galahad: Sir Galahad of Camelot.
Bridgekeeper: What... is your quest?
Galahad: I seek the Grail.
Bridgekeeper: What... is your favourite colour?
Galahad: Blue. No, yel...
[he is also thrown over the edge]
Galahad: auuuuuuuugh.
Bridgekeeper: Hee hee heh. Stop. What... is your name?
King Arthur: It is 'Arthur', King of the Britons.
Bridgekeeper: What... is your quest?
King Arthur: To seek the Holy Grail.
Bridgekeeper: What... is the air-speed velocity of an unladen swallow?
King Arthur: What do you mean? An African or European swallow?
Bridgekeeper: Huh? I... I don't know that.
[he is thrown over]
Bridgekeeper: Auuuuuuuugh.
Sir Bedevere: How do know so much about swallows?
King Arthur: Well, you have to know these things when you're a king, you know.

Grails? (5, Funny)

Loconut1389 (455297) | more than 6 years ago | (#22197402)

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

Re:Grails? (0)

Anonymous Coward | more than 6 years ago | (#22197488)

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

That would sound Jtupid!

Re:Grails? (1)

jo42 (227475) | more than 6 years ago | (#22198148)

At least they didn't call it Jrails.

Re:Grails? (0)

Anonymous Coward | more than 6 years ago | (#22198152)

The Grails framework is based on the "Groovy" language, hence the "G". Groovy is a dynamically-typed language that supports advanced features such as closures and metaprogramming. But it compiles down to Java bytecode to run alongside proper Java classes.

Re:Grails? (0)

Anonymous Coward | more than 6 years ago | (#22198402)

whoosh!

Java + Rails = Jails

Re:Grails? (2, Informative)

jma05 (897351) | more than 6 years ago | (#22201776)

> 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.

Nice framework, slashdotted after 15 clicks (2, Funny)

sticks_us (150624) | more than 6 years ago | (#22197520)


Our apologies

The IBM developerWorks Web site is currently under maintenance.

Please try again later.

Fail (1, Flamebait)

Wiseman1024 (993899) | more than 6 years ago | (#22197530)

This sounds like a poor man's Rails. Why would I want to develop smartly using such a limited, powerless, unexpressive language? 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.

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 some ugly so-called glue.

Re:Fail (1)

sticks_us (150624) | more than 6 years ago | (#22197586)

Agreed--I'd subscribe to your newsletter. Java is a major scourge of the industry.

Java Sucks (1)

Bill, Shooter of Bul (629286) | more than 6 years ago | (#22198020)

... except when it doesn't. Java doesn't have to be over engineered,and I would hardly call its object model a toy ( cough perl/php objects are toys cough cough). Now is Java overkill for your simple blog app demo thats done so quickly in rails? Probably. You know right tool right project.

Re:Java Sucks (1)

chromatic (9471) | more than 6 years ago | (#22198134)

Java doesn't have to be over engineered,and I would hardly call its object model a toy ( cough perl/php objects are toys cough cough).

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:Java Sucks (1)

Bill, Shooter of Bul (629286) | more than 6 years ago | (#22198676)

I was thinking of method overloading specifically when I wrote that comment without thinking too much about it. I'll let you take up the Toy label with the good folks at Sun, IBM, or Apache.

Re:Java Sucks (0)

Anonymous Coward | more than 6 years ago | (#22199656)

I'll have to agree with chromatic on this one. Not to mention, for perl you can take up the toy label with this very site.

Re:Java Sucks (0)

Anonymous Coward | more than 6 years ago | (#22200404)

typesafe through collections
To be fair, Java has included generic typing as of version 1.5.

dynamic invocation
Well, through the reflection API... though Java reflection is so convoluted and hacked-in that it's ugly and nobody likes to use it...

method missing
I... ok, you win.

Re:Java Sucks (1)

chromatic (9471) | more than 6 years ago | (#22201138)

To be fair, Java has included generic typing as of version 1.5.

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:Java Sucks (2, Interesting)

Wiseman1024 (993899) | more than 6 years ago | (#22199970)

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.

Re:Java Sucks (1)

Raenex (947668) | more than 6 years ago | (#22200972)

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:Java Sucks (2, Insightful)

Wiseman1024 (993899) | more than 6 years ago | (#22202088)

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

Re:Java Sucks (1)

Raenex (947668) | more than 6 years ago | (#22202756)

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 for my own code that I want to change project wide, including all existing references.

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
For a vast amount of code, even Python code, you need and expect certain properties to exist. There are times when you want some dynamic fu, and I fully admit that, but I also understand that it comes at a tradeoff.

Re:Java Sucks (2, Informative)

leighklotz (192300) | more than 6 years ago | (#22210852)

> 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 [printf.net]

Re:Java Sucks (1)

Raenex (947668) | more than 6 years ago | (#22213174)

Looks spiffy, but I have my doubts when it comes to the dynamic typing of Python. For example, looking at the screenshot, could I click on the "buildscript" parameter and go to its definition? Inside the def, could I type buildscript.set<auto-complete>, and get only the completions that apply to whatever buildscript is? Or does it put all the names into one big namespace?

Re:Java Sucks (1)

Sweep The Leg (925950) | more than 6 years ago | (#22206862)

Where to start... I'm no fan of Java, in fact I'd wager to say it's one of my least favorite languages, but it does have its strengths. As a typed language, it's pretty good considering the options. Many of the existing and older libraries might suck, but most major things have since been corrected or there is a better 3rd party library available. There is pretty much no reason to ever use multiple inheritance. Many languages such as Smalltalk are far more expressive and OO than C++, Ruby, and Java and have never needed it. Multiple inheritance is an anti-pattern. You can achieve the same results with simple code. Mixins are a Ruby feature and are not needed either. It is a crutch for a poorly designed language. Mind you I like Ruby and use it daily, but it's still very immature and has serious problems. Functional properties? Why do you need these? They are sugar at best. It's an inconvenience but hardly something that cripples the language. Operator overloading? Why would you want to do this 99.9% of the time. C style languages proved this was a bad idea. True, there are some mathematical cases where it is incredibly useful, but in that case I think you made the wrong choice using something like Java anyway if you're dealing with most of the things that require this feature. It seems to me you hate Java because it is a typed language. I too hate typed languages but they have their place and uses. Like anything, you pick the best tool for the job. C# has a lot of what you want but I think if you tried to use it, you'd still complain, Microsoft hate aside. The fact that you propose that Python is a great fix is laughable. I love Python as well but the language has almost as many serious issues as Ruby. Just ask google and the numerous mods they've made to things internally. Much of the language is confused and disorganized, but thankfully many of these things have been fixed in the past few years. Python is an incredibly bad tool for certain things. Threading comes to mind as a major issue in Python *STILL*. Why is it that whenever anyone bashes a language, they suggest some other language is the panacea? Further, why does everyone forget some of the older, better architected, and well-tested languages such as Lisp and Smalltalk? It seems if it doesn't have a wiz-bang framework attached and you actually have to lift a finger to code anything, it's no good. That argument isn't even valid anymore with Smalltalk given the emergence of Seaside. If you think Java sucks and Python is so elegant, try Smalltalk in particular. Look through the standard libraries. You will rarely find any method over 5 lines and everything is built on decades of computer science knowledge, design patterns, and object-orientation. It makes Python's libraries look like filth. The same can be said for Lisp and the myriad of functional programming languages out there as well (albeit they are for a different task).

Re:Java Sucks (1)

Wiseman1024 (993899) | more than 6 years ago | (#22207004)

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 you say so? I've used them in Python for several reasons. Any language that is decently powerful (i.e. dynamic) can do them.

Functional properties? Why do you need these? They are sugar at best.
Because it sucks to write lol.getSuxorz() and it's even worse to write lol.setSuxorz(many) if I can just use lol.suxorz. Remember the object.method notation is also syntactic sugar. I'm not one to prefer overcomplicated, hackish syntax (Perl, Ruby), but I do like a decent amount as long as it makes me work faster and doesn't hurt readability (Python). If you want as little syntactic sugar as possible, use Lisp.

Operator overloading? Why would you want to do this 99.9% of the time.
I would like to overload "+" for the same reason I would like to overload "add". What makes "+" so distinct from the word "add"? If you allow people to choose any method names, they should be able to choose any operator; at worst they'll do the same damage either way. Furthermore, not being able to overload operators means your classes are toys that cannot compare with builtin classes, and you cannot take advantage of polymorphism and infix syntax at the same time, because the language doesn't allow you to use operators in your custom objects. Explicitly omitting operator overloading is a braindamaged decision made thinking people would be too stupid to make a "+" method with strange side effects and results, but they wouldn't be just as stupid to make an "add" method that does the same.

C style languages proved this was a bad idea.
It's not a better or worse idea than to allow you to define a function that's named "add".

Things aren't good or bad because they are in Java or not.

True, there are some mathematical cases where it is incredibly useful, but in that case I think you made the wrong choice using something like Java
If you call lists, collections, sets, dictionaries and the like a "mathematical case", then I guess Java is good for nothing, because pretty much anything requires these.

It seems to me you hate Java because it is a typed language.
Almost every language is a typed language. What you probably meant is statically typed. And yes, this is one of the worst limitations of Java, but by no means the only one. It wouldn't be nearly as bad if it were just this alone.

C# has a lot of what you want but I think if you tried to use it, you'd still complain, Microsoft hate aside.
While I hate Microsoft (and I'm not falling for Mono either), I'd take working on C# over Java any day. C# has a lot of the Java philosophy and is statically typed, but it at least tries to be powerful and useful, implementing features such as properties, generators or reflection, and LINQ, which kicks ass.

I love Python as well but the language has almost as many serious issues as Ruby.

Much of the language is confused and disorganized
Enlighten me.

Python is an incredibly bad tool for certain things.
Other than device drivers and operating systems, enlighten me.

Threading comes to mind as a major issue in Python *STILL*.
The GIL is going to be a problem of CPython in some cases where you need simultaneous Python code execution (it's not a problem if some threads are running extensions which release the GIL, such as the heavy processing or the I/O ones, which is usually where you want threads), but it's not an issue or part of the language. IronPython, for example, does not have a GIL.

Why is it that whenever anyone bashes a language, they suggest some other language is the panacea?
Did I? I also mentioned Lua, Common Lisp, and so on.

Further, why does everyone forget some of the older, better architected, and well-tested languages such as Lisp and Smalltalk?
Because I didn't? I've been mentioning Lisp in almost every post.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22198258)

uh, I think Grails uses Groovy as its programming language, not Java. Groovy has a lot of the same features as Ruby.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22198318)

Groovy is a cluster fuck with absolutely no direction and no vision. They've taken a lot of interesting ideas from various languages and displayed an astounding disregard for how these features actually fit in with Groovy as a whole.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22198304)

Maybe because the JVM is the highest performance execution environment for web applications? We all know Ruby and Python are rocking for performance (not!). And arguably the Java has the best libraries of any language, both closed and open source. That is in terms of breadth, modernness, and technical quality. There are libraries for stuff you and I have never heard of for Java, and a lot are written by some pretty smart people. I don't know who writes PHP stuff, but I'm going to guess they all wish they could do their jobs with Dreamweaver instead of having to program.

Or because if you want to find a paying job there are thousands of Java positions and maybe dozens for Ruby. Or if you want to staff your project there are thousands of Java programmers to hire and maybe a few dozen Ruby programmers.

But yeah, I don't see why anyone chooses Java over Ruby.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22198390)

And arguably the Java has the best libraries of any language, both closed and open source. That is in terms of breadth, modernness, and technical quality.
Most Java libraries, including the standard libraries, are absolutely horrible in terms of breadth, modernness and technical quality.

Re:Fail (1)

Wiseman1024 (993899) | more than 6 years ago | (#22200018)

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 with Java.

There are libraries for stuff you and I have never heard of for Java, and a lot are written by some pretty smart people.
The ones I consider "pretty smart people" (Hal Abelson, Gerry Sussman, Paul Graham, etc.) that can be seen discussing programming features and paradigms most haven't ever heard about don't precisely enjoy Java.

I don't know who writes PHP stuff, but I'm going to guess they all wish they could do their jobs with Dreamweaver instead of having to program.
The main problem with PHP is its community. So? Does pointing out that Java sucks automatically make me a PHP fanboy that posts ugly aborts of code on PHP's online documentation comments? Or it's that you worship Java and believe anything else is crap and pretty much the same?

Or because if you want to find a paying job there are thousands of Java positions and maybe dozens for Ruby.
If you're programming in, and what's worse, defending a language just because it has the most job positions or pays the best, then my personal opinion is that you're not suitable to discuss which language is better, because programming is not something you like or care about -- you just want money. (Tip: if you want more money, become a lawyer. It's actually similar to using the Java standard library in some ways.)

Or if you want to staff your project there are thousands of Java programmers to hire and maybe a few dozen Ruby programmers.
A dozen functional programmers equipped with a powerful language (Python, Ruby, Common Lisp, Lua, Haskell, Erlang, etc.) are worth a thousand Java programmers in productivity, maintainability, code reusability and correctness, and sure as hell they cost less.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22233440)

If you're programming in, and what's worse, defending a language just because it has the most job positions or pays the best, then my personal opinion is that you're not suitable to discuss which language is better, because programming is not something you like or care about -- you just want money.

<3

Grails is greater than Rails! (0)

Anonymous Coward | more than 6 years ago | (#22198334)

This is misinformation.
Grails is based on Groovy, a language that is probably more powerful than Ruby, with optional static-typing.
It is built on solid and widely adopted frameworks, such as Spring and Hibernate, and yet still lets you tap into the underneath frameworks. So it can talk to legacy systems, such as CICS, and do message queues and lots of other stuff that CRUD-only Rails cannot do without further development or extensions...

So dare I say, Grails is better than Rails!

Re:Grails is greater than Rails! (0)

Anonymous Coward | more than 6 years ago | (#22200580)

Grails is ... probably more powerful than Ruby
OK can I just say something here? A big pet peeve of mine is when people talk about whether certain languages are "more powerful" than other languages.

According to the Church-Turing thesis, all languages with a certain minimum of features are identical in terms of WHAT they can do. This means that no modern language is more powerful than any other. Ruby is as powerful as assembly is as powerful as BASIC is as powerful as PHP is as powerful as brainfuck is as powerful as FORTRAN is as powerful as Lambda Calculus.

So please stop talking about how powerful languages are because you make yourself look silly in doing so.

Now, the expressiveness of a language, i.e. what how many things it can do elegantly with a small amount of readable code, is certainly measurable and is probably a better benchmark for "judging" a language. Whether it is more expressive than Ruby I can't say because I haven't played with it.

Frankly I couldn't care less about static typing. It's an unnecessary measure carried over from weakly typed languages like C and C++ where everything is just ones and zeroes at runtime and the compiler, which can't figure out the type of things ahead of time, has to figure out how to wire everything up. If all your types are known at runtime why the hell would you want to restrict a method call to only work with one kind of object? Static typing does zilch for the expressiveness of a language.

As for Rails not being able to tap into legacy systems... I invite you to take a look at JRuby.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22198478)

RTFA. Grails uses Groovy, a language for the JVM which is on par with Ruby as far as features and expressiveness. Your other comments are unsubstantiated flame bait.

Re:Fail (5, Insightful)

fireboy1919 (257783) | more than 6 years ago | (#22198524)

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."

Re:Fail (1)

chromatic (9471) | more than 6 years ago | (#22198586)

There is nothing I know like [Inversion of Control] for any other language...

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:Fail (1)

fireboy1919 (257783) | more than 6 years ago | (#22199692)

"I only know Java"
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 that IoC is a 20 year old pattern"
How old was OOP when it started being used for real development? 80 years old or so? 20 years is new for a design pattern. This isn't really relevant, though, is it? It isn't implemented many places, even if it is really old.

"I don't know that IoC and event-driven programming are almost completely isomorphic"
This can be said about OOP and functional programming, and about iteration and recursion, and is often used as an argument against using OOP. But the point isn't if they work the same way. The point is that it's easier for humans to do things that way.

But I know that you're wrong about IoC. IoC's functionality is a superset of traditional event-driven programming's. There's also the ways that you use it to handle cross-cutting concerns that can't really be done just using events. For that matter, most languages don't let you define events like "entering a function in class X" or "leaving a function in class X," but the availability of these "events" are an automatic side-effect of using an IoC system (pretty darn useful, too).

Re:Fail (1)

DragonWriter (970822) | more than 6 years ago | (#22210614)

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?


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 framework uses it or not is a bigger question, though there are plenty of frameworks that do. The Wikipedia article on the type of IoC you are talking about that Spring provides for Java (dependency injection [wikipedia.org] ) lists 35 different frameworks (for ActionScript, C++, ColdFusion, Java, .NET, PHP4, PHP5, Perl, Python, and Ruby) providing that kind of IoC.

How old was OOP when it started being used for real development? 80 years old or so?


OOP isn't -- and digital computers aren't -- that old now. OOP, AFAIK, as a coherent paradigm emerged pretty much simultaneously to its use for practical development in the field of simulation in the 1960s.

Re:Fail (1)

catch23 (97972) | more than 6 years ago | (#22256974)

wow, has the computer been around for 80 years already? Unless you're talking about OOP in God's language, in which case OOP existed the day organisms existed and were capable of creating proteins via RNA.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22198626)

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.

More like a rich man's rails - where "rich" means "well educated in design pattern theory."
This comment is comedy gold. Fucking Java programmers are clueless.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22198758)

Do you not realize that most of these "design patterns" are only required because of deficiencies in the Java language? The fact that you think IoC is an advanced concept and that no other language has anything like it speaks volumes about your exposure to other languages.

Re:Fail (3, Insightful)

Cyberax (705495) | more than 6 years ago | (#22199196)

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.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22200858)

Spring blows almost everything out of water - it's very powerful and easy to use,
LOL. Oh God. Yeah, I want to maintain five million lines of XML and force all my objects into isolation just to *fix* Java's deficiencies...

One of the nice things about Rails is it doesn't *need* eighteen additional frameworks just to get anything done. When I was a Java programmer, I found myself writing my own lightweight MVC frameworks because none of the zillion J2EE frameworks available did exactly what I needed easily or well.

Re:Fail (1)

DragonWriter (970822) | more than 6 years ago | (#22227306)

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.


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 requiring external configuration (Spring, though I've only looked at descriptions of it, seems to be, in the typical Java-framework way, very XML-configuration heavy to get around the limitations of Java.)

Of course, there's less demand for dynamic-language IoC frameworks because some of the problems IoC is intended to solve are a less pressing (though not at all absent) when using many dynamic languages, and because those languages make it less painful to do "good enough" IoC without a framework, both of which reduce the motivation to build such frameworks in dynamic languages.

Re:Fail (1)

Cyberax (705495) | more than 6 years ago | (#22227516)

Yes, I'm comparing Spring to all other IoC frameworks (Spring also can be used with annotation-based configuration requiring zero XML configuration files, BTW).

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 guaranteed consistency in transactions involving several data sources (several databases, for example).

Re:Fail (1)

DragonWriter (970822) | more than 6 years ago | (#22228936)

The biggest Spring feature - it can use the whole gamut of Java technologies.


That's true of most Java frameworks, and many non-Java frameworks that happen to run on the JVM.

But I was not even able to _find_ a distributed transaction manager for RoR!


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 application framework that happens to provide IoC/AOP features as well as lots of specific services. But nothing of what you've said really explains what makes it a good IoC framework.

But, yeah, that Spring provides a distributed transaction manager that Grails can leverage is an advantage for Grails over Rails for some use cases; it is only tangentially related to IoC, though.

In fact, when it comes to IoC, many have argued (including Jamis Buck, who wrote two of the best known Ruby IoC frameworks) that Ruby doesn't need frameworks at all, because it can do all the things done by such frameworks directly, simply, and naturally, and that "frameworks" don't generally simplify things more than what the language already provides: in Java, bulky IoC frameworks are needed to work around the inflexibility of the language. In Ruby, if you want to use inversion of control you can just do it fairly directly and naturally.

But, yes, the Java platform has been around the enterprise for quite a while, and has more mature libraries for lots of enterprise-desirable tasks, like distributed transaction management. And integration with existing Java technologies like that is a strength of Grails.

Re:Fail (1)

Wiseman1024 (993899) | more than 6 years ago | (#22200072)

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 design patterns reminds me of those C64-era Basic programs that had runs of 20 lines of gibberish code that looked the same, replacing a variable or a line number. The difference is that, back then, few professionals questioned that it was a bad thing.)

Re:Fail (1)

John Courtland (585609) | more than 6 years ago | (#22200806)

You seem to have an awful lot of angst and misguided ideas about java development. Did James Gosling touch you in your 'no-no' spot when you were a kid? You also either aren't grasping the concept of design patterns, or you're not capable of adequately communicating your ideas.

Re:Fail (1)

Wiseman1024 (993899) | more than 6 years ago | (#22202006)

It's hilarious how you keep talking about design patterns after I've pointed out that they're just glorified copypasta Java programmers jerk off to (and add to their immense collection of buzzwords). And it's not just their fault Java is full of copypasta wankery - the language is far too much of a toy to allow enough abstraction to turn them into library elements.

Re:Fail (1)

John Courtland (585609) | more than 6 years ago | (#22203470)

You're obviously too ignorant to have any sort of real conversation with. The message you replied to was the first one I've written in this thread. You also seem to love the phrase "copypasta". It sounds ludricous. Seriously, stop.

Re:Fail (1)

Wiseman1024 (993899) | more than 6 years ago | (#22205880)

"You" can also refer to several people. For example, "You java programmers".

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:Fail (1)

John Courtland (585609) | more than 6 years ago | (#22208194)

You're obviously either a child or socially retarded. Either way, you still don't grasp the concept of design patterns. You're crying about shitty programming, not design. Go read "Design Patterns: Elements of Reusable Object-Oriented Software," then come back and perhaps we can have a real conversation.

Re:Fail (1)

Sweep The Leg (925950) | more than 6 years ago | (#22206916)

You may not have noticed, but a good amount of the things any decent programming will do normally are design patterns. Just because you didn't write a block of code and say to yourself, "it looks like I am using the visitor pattern!" does not mean you aren't already using design patterns. Last time I checked, many core libraries in several languages comes to mind. The Visitor Pattern as I mentioned is the basis of many Smalltalk methods in the standard libraries in just about every flavor. Have fun writing an interpreter or playing back a series of commands/undo list without design patterns. How do you propose to solve some of the glorious C/C++ pointer issues without things like double-dispatch? It seems to me you are likely one of those people who is bitter that some stupid co-worker decided that every connection known to man must be created using something like the factory pattern. There is a lot more to patterns than cutting and pasting. The reason they work is because they are object-oriented. A good majority of design patterns existed long before Java as well, so are you saying that all languages that use design patterns suck? It seems like you have some buried desire to work in a procedural language rather than an object-oriented one.

Re:Fail (1)

Wiseman1024 (993899) | more than 6 years ago | (#22207706)

Again, repetitive patterns need to be generalized. If your language does not allow you to do this, it fails. The trivial ones that existed since forever are mere trivialities, not worth talking much about, but the hordes of Java programmers, book writers and managers have given all of them (both the trivialities and the ungeneralized lumps of copypasta) spectacular names just to sound smart and write more buzzwords.

The "factory pattern" is a good example. "Factory classes" are a stupid wart of limited languages. "Factory functions" existed since forever, and are no more special than anything else. Wait, I think I've invented the "factory dictionary"! f = {option1: class1, option2: class2, ...}; obj = f[option](); Oh, I should write a book about this. Too bad it can't be done in Java because the language sucks.

"Design patterns" are not specially related to object-oriented programming. They're more related to working around limitations and flaws of some so-called object-oriented languages. They could very well be present in languages not called object-oriented, such as C, only that fewer people wanted to write books about the ugly hacks you need to do with it. Check GNU software source code, you'll recognize lots and lots of patterns, but I haven't wasted my memory memorizing a name for them.

If you have a good enough language, almost all of these patterns (the non-trivial ones, and even some of the trivial ones) can be implemented with higher-order functions or macros, never to be repeated again (other than the function/macro call).

Re:Fail (1)

DragonWriter (970822) | more than 6 years ago | (#22227500)

There is a lot more to patterns than cutting and pasting.


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 abstracting many common patterns out for Java often rely on non-Java constructs (most often XML) to do so, because Java doesn't provide the needed features at the language level to usefully abstract out those patterns.

This is also why dynamic languages that have more of the needed flexibility (whether "generic" ones like Ruby or Python, or ones developed for the JVM like Groovy) are likely to play an increasingly important role in development for the Java platform: they let these patterns be supported at the language and library level without resort to XML or something similar.

A good majority of design patterns existed long before Java as well, so are you saying that all languages that use design patterns suck?


Any language in which a task is best handled repeated use of a particular design pattern that does not allow that pattern to be elegantly factored out is, in that respect, less than ideal for that task. It may still be the best choice because of other reasons that outweigh that kind of consideration -- particularly performance reasons for relatively low-level system languages (ASM, C, arguably Java as the core language on the JVM, if not necessarily Java for application development.)

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22200740)

Incidentally, if you've got legacy data with a compound key, how hard is that to deal with in Rails?
Actually there's a plugin [rubyforge.org] for that. So the answer is, not terrible.

As someone who's actually tried to tie Hibernate to a legacy DB with abysmal referential integrity, including stuff like dangling references, duplicate ids, 5-column primary keys on tables that are referenced by two of the columns in some cases and three of them in others, replication of data all over the place, five tables to represent a single model, whole tables with a single column containing nothing but data for dropdowns, and oh by the way I'm not to mess with existing data, just select and insert... I cry foul on your claim that Hibernate is easy.

Re:Fail (0)

Anonymous Coward | more than 6 years ago | (#22257026)

Hibernate is not easy... but GORM is. GORM is part of Grails. GORM is a DSL on top of Hibernate.

Re:Fail (1)

smellotron (1039250) | more than 6 years ago | (#22201362)

..."well educated in design pattern theory."

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:Fail (0)

Anonymous Coward | more than 6 years ago | (#22202102)

1) Hibernate makes Active Record look like a toy.

A real object database makes any ORM look like a toy. If you're dealing with objects, why are you still dorking around with tables?

Those are the modern sensibilities - design patterns that haven't yet caught on in any other language.

"Design patterns" is just [norvig.com] a cool-sounding way to say "repetition that my language is too wimpy to be able to represent in source code". You don't hear Lisp programmers talking about The Visitor Pattern, or Smalltalk programmers discussing The Abstract Factory Pattern.

More like a rich man's rails - where "rich" means "well educated in design pattern theory."

Too bad it's built on top of Java, which isn't well-educated in language design (thus requiring extensive use of a hack called "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."

I've worked on both Java and Ruby projects, and I can't say one was generally "less buggy". It is true that you do tend to need to pay people more to work on Java programs, but I wouldn't exactly go around bragging about that!

Disclaimer: I've got no particular love of either Ruby or Java. It simply pains me to hear any argument that is "we got it all right, and you got it all wrong (for these few specific reasons, which are the only things that matter)".

Re:Fail (1)

Zarf (5735) | more than 6 years ago | (#22198982)

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] :

def joinTwoWordsWithSymbol = { symbol, first, second -> first + symbol + second }
assert joinTwoWordsWithSymbol('#', 'Hello', 'World') == 'Hello#World'

def concatWords = joinTwoWordsWithSymbol.curry(' ')
assert concatWords('Hello', 'World') == 'Hello World'

def prependHello = concatWords.curry('Hello')
// def prependHello = joinTwoWordsWithSymbol.curry(' ', 'Hello')
assert prependHello('World') == 'Hello World'
In Groovy typing is optional.

Re:Fail (1)

DragonWriter (970822) | more than 6 years ago | (#22209814)

This sounds like a poor man's Rails.


Its almost exactly the opposite: its more of Rails, repackaged to appeal to enterprise users.

Why would I want to develop smartly using such a limited, powerless, unexpressive language?


What makes you say that Groovy is a "limited, powerless, unexpressive language"?

Nice for quick simple web apps (1)

hattig (47930) | more than 6 years ago | (#22197578)

Bah! I want to write my own DAOs, and worry about customising each one for different backend databases because their JDBC implementations handle things differently, never mind the SQL differences!

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 know what's happening inside that framework.

These things make developing web applications easier for cheap Java programmers. You have to hope that the generated database schema is decent. I've seen frameworks generate schemas that were a complete brain-fuck to navigate using traditional methods, basically tying you into accessing the database via that framework only.

And "tiny" - it seems to include its own application server, database engine, several parent frameworks ...

Of course the important issue is when the Eclipse support is ready.

Does Grails allow the export of a Java .jar file for the data model and database access, so you can access the schema from traditional Java applications, not via the application server? All with nice Javadoc of course...

I will give this a play however. It seems perfect for small intranet applications. I assume it has a module for user accounts, etc?

Re:Nice for quick simple web apps (1)

CastrTroy (595695) | more than 6 years ago | (#22197870)

Everybody seems to rave about how great these new frameworks are, but they don't do a lot of things that are important at the enterprise level. One thing you mentioned was accessing the data layer from some other application. They came up with n-tier architecture a long time ago because it made a lot of sense. Put all your data access in 1 component, all your business logic in another component, and put your presentation logic in a third component. That way, if you want to access your data or business logic from some other program, you won't be completely screwed.

Re:Nice for quick simple web apps (0)

Anonymous Coward | more than 6 years ago | (#22198998)

Using EJB3 inside Grails: http://www.infoq.com/articles/grails-ejb-tutorial [infoq.com] ... and Grails can use Java services via RMI, JNDI, or IoC.

Re:Nice for quick simple web apps (1)

Shados (741919) | more than 6 years ago | (#22198294)

Bah! I want to write my own DAOs, and worry about customising each one for different backend databases because their JDBC implementations handle things differently, never mind the SQL differences!
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:Nice for quick simple web apps (1)

hattig (47930) | more than 6 years ago | (#22199368)

I'll grant Grails one thing - having read the documentation - it does allow you to specify the database mappings within the "class" that you write. I once worked with JDO and the mappings from the model to the database were done in the motherf*cker of XML files, and the automated schema it generated was pretty damn dire if you wanted to work in the psql command line.

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 indexes and views and basically making full use of the database's own optimised implementations for functionality. They should also understand how it maps to and from the equivalent model in the programming language - not the fields, but how the relationships work and things you need to do to handle collections, etc. The Grails Object-Relationship-Model actually looks quite reasonable to me.

One constraint it appears to be missing is "maxlength" for strings - which is clearly useful for when you generate the database structure (nvarchar2 or clob?) and the web forms, and validation of data. However it does have "types" like email, postcode, etc, which will incorporate some of this checking (Note that I haven't used Hibernate or Springs, so these features could be inherited.)

Re:Nice for quick simple web apps (1)

Shados (741919) | more than 6 years ago | (#22200548)

it does allow you to specify the database mappings within the "class" that you write
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.

If you want to change the class, you need to have the mapping redone too. A nice in between, for example, in the .NET World is LLBLGEN Pro. The mapping is computed from the schema, and is defined in a graphical IDE, and it generates the classes for you. Using .NET's partial classes you can add stuff to those classes without touching generated code, or you can alter the templates the generator use... All around, making a data access layer from an existing schema is a matter of minutes, even if it is a legacy database that isn't normalized...

Good object relational mappers will map to an existing schema, they will NOT create one, as that makes for some amazingly shitty interop. Make the DB first, then map your classes to it. Or better yet, auto-generate your data access layer and data objects, then make sure that layer is not tightly coupled to the rest of the application, removing the need to map anything at all (yourself). A while it would be great if all developers were good database architects, it isn't realistic. Knowing the basics (like its important for a Java developer to know how pointers work) is a must, and knowing how to work with a database also is, but being able to create a good schema is a world apart.... It isn't uncommon for a an average enterprise database to spawn thousand of tables, fusing several business domains together... You need to be a top notch functional analyst, and know all of the quirks and reasoning behind each design choice...

Thats a job that usually requires much more qualified people (that also happen to be paid quite a bit more than your "good developer"). Making a schema for a little blog site is something...but thats not what a database architect will do from one day to the next :)

See Scott in person if you can (1)

mgkimsal2 (200677) | more than 6 years ago | (#22197744)

If you're at all interested in Groovy or Grails, see Scott in person. His writing is good, but his speaking is better (obviously imo). He exudes an enthusiasm for and mastery of the subject which is lacking in many speakers in the tech circuit these days.

Nothing to see here... (1)

rdean400 (322321) | more than 6 years ago | (#22198482)

IBM's dW website always goes down Saturday evening for maintenance. I think it goes down a little early, but it's always down for at least some time.

Grails... (1, Interesting)

Anonymous Coward | more than 6 years ago | (#22199018)

So one day several years ago the suits came to me and told me I had to stop using Perl and start using Java. It was hell. I lived in J2EE hell, JSF hell, Portlet hell, Workflow engine hell, Seam hell, then I spent some time with EJB3 and that felt less like hell.

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 easier to set up and run than a full application server. I was so much happier... and I was able to use any of the Java stuff I wanted and I could even write shell scripts in Groovy. I could use Grails tools to automatically generate so much code I would have had to write in any other framework... Perl included... I was so happy that the pain had stopped. The confusion lifted! The buzzword acronym laden pea soup had stopped. Life began to make sense. I actually began to prefer working in Groovy and Grails to working with Perl, CGI.pm, and Template engines.

This is shocking but Groovy and Grails might actually be better than Perl, Ruby, or Python. No really. I'm sure this will start a flame war. But honestly you need to look at it. You really do. My IDE of choice working with Groovy and Grails? vi. really. vi. I don't need a big heavy IDE like I do with Java.

i'll give it a try (1)

evariste.galois (1205072) | more than 6 years ago | (#22202968)

I have long been awaiting for something like this. Having all the server functionality in a small java framework I will definitively give it a try.. http://www.developeronline.blogspot.com/ [blogspot.com]
Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...