A few comments about Grails from a Rails && J2EE person

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

A few comments about Grails from a Rails && J2EE person

Gregory Pierce-2
I've just started messing around with Grails and it looks pretty  
interesting, but there are a few things that I wanted to bring up to  
the group as initial feedback.


Installation
On OSX version 0.1 simply didn't work. Kept talking about a bad  
interpreter. Grabbing 0.2 and following the install instructions for  
0.1 (save updating the path) worked fine. The grails command worked  
without a hitch.

Getting Started
The whole process of having ant prompt me for stuff seems kinda  
clumsy. In rails it was very nice to just type in the name of the  
thing I wanted to create and rails did the right thing. Is there any  
reason why grails doesn't just do "grails create-app fooapp" ? Same  
goes for create model objects, or at least I call them model objects  
though you guys call them domain objects. Everyone (newbies) know  
what MVC is, but using different lingo "domain" may confuse some that  
aren't up on software architecture and know them as domain objects.  
If you're targetting the rails crowd maybe calling them model object  
wouldn't be such a bad idea?

The original sin
When creating the first domain class I was expecting the  
documentation to tell me to create my test data in a TEST case. But  
instead it tells me to put it in a bootstrap class which is evil evil  
evil stuff IMO. Why not just follow the tactic "put this in your test  
case here and run this and see your model objects are created and  
persisted to the database". If you want to get people doing more  
agile stuff, why instruct them to do something inherently NOT agile  
in the getting started?

Controller confusion
Once I made it through the controllers I was a little confused. Much  
of this likely comes from me becoming more familiar with rails (I'm  
just getting past being a novice rails user and am somewhere in the  
intermediate state). I know you guys don't want to xerox rails for  
your API, but I think their syntax is a lot easier to follow starting  
off. The first thing that bugged the hell out of me is "why is there  
an @Property sitting in front of what appears to be the same thing as  
a def index() in rails?" I suspect that this is an implementation  
issue with having to specify the return, but I wouldn't know that if  
I didn't have some idea of what closures are or what you were trying  
to accomplish. I think the target folks will look at that and be  
confused as to what you're doing :) There is a lot of "groovy magic"  
going on that isn't really clearly explained.

Overloaded constructor intercept?
Would absolutely love the syntax:

def b= new Book( params )
b.save()

Seems that would be more "to the point"


"Effects" integration
What are the plans for coupling with an effects library? One of the  
things that makes rails such a joy to use is that I can from the ruby/
rails layer control all of my effects on the client side. While you  
guys have integrated Prototype (and that's cool and while I  
understand the desire to have a generic interface to other Prototype-
type libraries is that really important at this point), there doesn't  
seem to be a similar integration with an effects library out of the  
box. This unfortunately makes the whole thing feel somewhat  
incomplete at this point as the sites that I can create are somewhat  
generic, well not really - but the aren't on par with what I can  
create in rails and scriptaculous.


Conclusion
Anyways what you guys have done is cool. Its almost tempting to  
consider replacing a new rails app with it, but java webhosting is so  
poor at the moment that I cannot consider doing it.

Reply | Threaded
Open this post in threaded view
|

Getting started comment and questions (yeah I'll have a lot of those)

Gregory Pierce-2
Scaffolding suggestion

I think it would make a lot of sense to expose people to scaffolding  
during the getting started as opposed to dropping them right into  
creating views. It will allow people to get up and running with the  
absolute minimum amount of work.

View questions

One thing that rails does is "precreate" some directories and such.  
For example, where is the index for the entire website I am creating?

When I create a controller, why doesn't grails create a directory  
into which I should store my view code?

Does Grails do any templating around my content piece like rails  
does? In other words if my template is just a piece of a larger page,  
do I have to shove the entire page into the gsp or is it inserted the  
same way it is done in rails?
Reply | Threaded
Open this post in threaded view
|

Re: A few comments about Grails from a Rails && J2EE person

graemer
In reply to this post by Gregory Pierce-2
On 4/19/06, Gregory Pierce <[hidden email]> wrote:
> I've just started messing around with Grails and it looks pretty
> interesting, but there are a few things that I wanted to bring up to
> the group as initial feedback.
Thanks there is some great feedback here :-)

>
>
> Installation
> On OSX version 0.1 simply didn't work. Kept talking about a bad
> interpreter. Grabbing 0.2 and following the install instructions for
> 0.1 (save updating the path) worked fine. The grails command worked
> without a hitch.
Yeh this was an unfortunate bug that went out with the release.
rectified in the snapshots as you've discovered

>
> Getting Started
> The whole process of having ant prompt me for stuff seems kinda
> clumsy. In rails it was very nice to just type in the name of the
> thing I wanted to create and rails did the right thing. Is there any
> reason why grails doesn't just do "grails create-app fooapp" ? Same
> goes for create model objects, or at least I call them model objects
> though you guys call them domain objects. Everyone (newbies) know
> what MVC is, but using different lingo "domain" may confuse some that
> aren't up on software architecture and know them as domain objects.
> If you're targetting the rails crowd maybe calling them model object
> wouldn't be such a bad idea?
grails uses ant and passing arguments to ant via the command line is
surprisingly not trivial. you can do it with java -D arguments but
thats not very neat.

domain objects is java lingo, grails is targeted at java developers
mainly, not rails developers.

>
> The original sin
> When creating the first domain class I was expecting the
> documentation to tell me to create my test data in a TEST case. But
> instead it tells me to put it in a bootstrap class which is evil evil
> evil stuff IMO. Why not just follow the tactic "put this in your test
> case here and run this and see your model objects are created and
> persisted to the database". If you want to get people doing more
> agile stuff, why instruct them to do something inherently NOT agile
> in the getting started?
fair comment, but then grails doesn't require you to configure a db to
get started. it creates an in-memory database. the downside of this is
that the data is lost when you stop the db. So creating the data in a
test case and the running the app would have no effect.

>
> Controller confusion
> Once I made it through the controllers I was a little confused. Much
> of this likely comes from me becoming more familiar with rails (I'm
> just getting past being a novice rails user and am somewhere in the
> intermediate state). I know you guys don't want to xerox rails for
> your API, but I think their syntax is a lot easier to follow starting
> off. The first thing that bugged the hell out of me is "why is there
> an @Property sitting in front of what appears to be the same thing as
> a def index() in rails?" I suspect that this is an implementation
> issue with having to specify the return, but I wouldn't know that if
> I didn't have some idea of what closures are or what you were trying
> to accomplish. I think the target folks will look at that and be
> confused as to what you're doing :) There is a lot of "groovy magic"
> going on that isn't really clearly explained.
actions are javabean properties of type closure. this was a design
decision as javabean properties are more easily configured using
introspection and are mutable which makes for some interesting uses.
plus it will make creating the IDE a breeze ;-)

>
> Overloaded constructor intercept?
> Would absolutely love the syntax:
>
> def b= new Book( params )
> b.save()
Yeh this is on the todo list.

>
> Seems that would be more "to the point"
>
>
> "Effects" integration
> What are the plans for coupling with an effects library? One of the
> things that makes rails such a joy to use is that I can from the ruby/
> rails layer control all of my effects on the client side. While you
> guys have integrated Prototype (and that's cool and while I
> understand the desire to have a generic interface to other Prototype-
> type libraries is that really important at this point), there doesn't
> seem to be a similar integration with an effects library out of the
> box. This unfortunately makes the whole thing feel somewhat
> incomplete at this point as the sites that I can create are somewhat
> generic, well not really - but the aren't on par with what I can
> create in rails and scriptaculous.
Again on the todo list, but grails tags are really easy to write.. why
not have a go! ;-)

>
>
> Conclusion
> Anyways what you guys have done is cool. Its almost tempting to
> consider replacing a new rails app with it, but java webhosting is so
> poor at the moment that I cannot consider doing it.
Really? I've not found that, in fact rails hosting was much harder to find.

Cheers
Graeme
>
>
Reply | Threaded
Open this post in threaded view
|

RE: A few comments about Grails from a Rails && J2EE person

Eric Williams-3
In reply to this post by Gregory Pierce-2
I can comment quickly on the OS X install... this was very frustrating
for me, as well. In order to get it to work you have to fix the "grails"
and "ant" shell scripts that ship with Grails:

First you need to fix newlines:

tr "\r" "\n" < grails > grails
tr "\r" "\n" < ant > ant

This is what causes the "bad interpreter" issue you saw. Next you need
give the scripts execute permissions:

chmod 774 grails
chmod 774 ant

I gave owner & group read, write and execute, and everyone read. Set
permissions as you see fit.

After doing this I was able to run grails w/o problems.

I hope this helps OS X users...

-----Original Message-----
From: Gregory Pierce [mailto:[hidden email]]
Sent: Wednesday, April 19, 2006 12:43 PM
To: [hidden email]
Subject: [grails-user] A few comments about Grails from a Rails && J2EE
person

I've just started messing around with Grails and it looks pretty  
interesting, but there are a few things that I wanted to bring up to  
the group as initial feedback.


Installation
On OSX version 0.1 simply didn't work. Kept talking about a bad  
interpreter. Grabbing 0.2 and following the install instructions for  
0.1 (save updating the path) worked fine. The grails command worked  
without a hitch.

[many lines snipped]
Reply | Threaded
Open this post in threaded view
|

Re: A few comments about Grails from a Rails && J2EE person

graemer
On 4/19/06, Eric Williams <[hidden email]> wrote:

> I can comment quickly on the OS X install... this was very frustrating
> for me, as well. In order to get it to work you have to fix the "grails"
> and "ant" shell scripts that ship with Grails:
>
> First you need to fix newlines:
>
> tr "\r" "\n" < grails > grails
> tr "\r" "\n" < ant > ant
>
> This is what causes the "bad interpreter" issue you saw. Next you need
> give the scripts execute permissions:
>
> chmod 774 grails
> chmod 774 ant
>
> I gave owner & group read, write and execute, and everyone read. Set
> permissions as you see fit.
>
> After doing this I was able to run grails w/o problems.
>
> I hope this helps OS X users...

Thanks Eric, this has been corrected in the 0.2 dev snapshots too so
users can download that if they prefer

Graeme

>
> -----Original Message-----
> From: Gregory Pierce [mailto:[hidden email]]
> Sent: Wednesday, April 19, 2006 12:43 PM
> To: [hidden email]
> Subject: [grails-user] A few comments about Grails from a Rails && J2EE
> person
>
> I've just started messing around with Grails and it looks pretty
> interesting, but there are a few things that I wanted to bring up to
> the group as initial feedback.
>
>
> Installation
> On OSX version 0.1 simply didn't work. Kept talking about a bad
> interpreter. Grabbing 0.2 and following the install instructions for
> 0.1 (save updating the path) worked fine. The grails command worked
> without a hitch.
>
> [many lines snipped]
>
Reply | Threaded
Open this post in threaded view
|

Re: Getting started comment and questions (yeah I'll have a lot of those)

graemer
In reply to this post by Gregory Pierce-2
On 4/19/06, Gregory Pierce <[hidden email]> wrote:
> Scaffolding suggestion
>
> I think it would make a lot of sense to expose people to scaffolding
> during the getting started as opposed to dropping them right into
> creating views. It will allow people to get up and running with the
> absolute minimum amount of work.
Yes I've been thinking about updating the docs to reflect this. They
were written when scaffolding was not implemented

>
> View questions
>
> One thing that rails does is "precreate" some directories and such.
> For example, where is the index for the entire website I am creating?
its a JSP in the web-app directory called index.jsp..

>
> When I create a controller, why doesn't grails create a directory
> into which I should store my view code?
fair point.. could you raise an issue?

>
> Does Grails do any templating around my content piece like rails
> does? In other words if my template is just a piece of a larger page,
> do I have to shove the entire page into the gsp or is it inserted the
> same way it is done in rails?
yes see the docs on layouts:
http://grails.org/Views+and+Layouts

And the render tag and method:
http://grails.org/Tag+-+render
http://grails.org/Controller+Dynamic+Methods#ControllerDynamicMethods-render

Graeme
>
Reply | Threaded
Open this post in threaded view
|

Re: A few comments about Grails from a Rails && J2EE person

Gregory Pierce-2
In reply to this post by graemer

On Apr 19, 2006, at 4:22 PM, Graeme Rocher wrote:

>
>>
>>
>> Conclusion
>> Anyways what you guys have done is cool. Its almost tempting to
>> consider replacing a new rails app with it, but java webhosting is so
>> poor at the moment that I cannot consider doing it.
> Really? I've not found that, in fact rails hosting was much harder  
> to find.
>
> Cheers
> Graeme
>>
>>


Could be. When I started I just clicked on the link on the rails  
website which took me to textdrive and had some links to dreamhost  
and a few others. I was up and running in a few minutes. Maybe there  
could be a list of places that support Grails hosting or a guide to  
deploying Grails web-apps at a 'reasonably affordable and popular  
java webhost'.

Once I get things understood well enough I'll chat with my friends at  
Javalobby about trying to provision myjavaserver.com to be a good  
testing server for these types of applications. If I read the  
documentation correctly once I'm finished my development phase I just  
run the webapp task/command and I will get a war file that I should  
be able to just drop into an application server. Would that be accurate?