Fwd:Re: [grails-user] H2

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

Fwd:Re: [grails-user] H2

Stephan.Schmidt

>> I could say something about how Grails is better than
Rails (did some
>> Rails projects :-)
>
>Yes? Then go on, because when speaking about Grails to Rails
people it
>is always a little difficult to explain the differences and
possible
>benefits.
>
>bye blackdrag

Most arguments might be subjective and special to me.

Rails and Grails are more or less the same, in the sense that
other frameworks differ much more from Rails/Grails than
Rails and
Grails differ. What I like in Rails is the domain specific
language,
which is nicer (less noisy, potentially less powerfull)
than in Grails (@Property). Rails also contains
more AJAX features and has migrations, which are nice to have.

What I don't like in Rails is the DB -> Rails application way
of defining data. This works great for small applications,
but imho doesn't scale very well. Rails applications make
it hard to understand them, because lots of code is
burried in the database, which usually is only accessible
from a DB frontend while your application contains empty
domain classes. The situation gets absurd when you use
migrations, where you define your data in Ruby, then export
the data to the database and then back into your Rails
application. Hard to understand. (Grails could do the
migration stuff by diffing domain classes and annotations,
which would be much cleaner. This is a feature request :-).
A Grails domain class makes it clear what fields it contains,
which makes it easier to read and understand.
The Grails way is also totally backend
agnostic (you could implement other backends in the future,
JNDI, XMLDB, ...). I also assume hibernate scales better
than ActiveRecord, especially for applications outside
the 1 Class = 1 Table modell of Rails.

Other things like service integration, better layout support,
builders etc speak for Grails.

But the main difference is in the language, Groovy (Java)
versus Ruby.
I really like Ruby and started several projects (the first 7
years ago).
But everytime I come to a point where I have problems with
libraries
in Ruby.

1.) Sometimes I can't get the C part compiled and installed
(We use
MacosX/Linux servers for deployment and Windows/MacosX for
development)
on one,more or all plattforms.

2.) Sometimes there is no library for the problem and I had
to write
it on my own

3.) Documentation for most libraries in Ruby is scarce (Rails
being the
exception). Interesting libraries have their documentation
written
in Japanese (my 2 years of Japanese at the university are not
enough
for that :-)

Groovy (Java) has nearly no problems in those areas, the
libraries are JARs
and run everywhere (in 10 years of Java development I didn't
get a JAR lib
which didn't work), there are lots and lots of libraries
(sometimes a
problem, e.g. web frameworks) and documentation is usually in
English and
good enough. Usually in Groovy/Java you don't do development,

In Groovy/Java you assemble apps from existing libraries and
containers.

Just see Xfire, XBeans, James Mail Server,
ServiceMix/ActiveMQ, JavaSVN,
Jakarta, Drools, Jaxen, Drone and much more for excellent
libraries. There
are also excellent tools (IDEA, Yourkit,...)

So despite the fact that Ruby is less noisy and shorter than
Java (but less
so than Groovy with it's closures and builders) productivity
goes down when
your web application needs to interface with backends or
existing
technology. We also do web projects, server projects,
business projects
and GUI projects in Java/Groovy... IDEA and Eclipse are
written in Java
not in Ruby ;-)

I'm currently developing a bigger app with Grails and one
with Rails and one
with CakePHP. All are similar on the productivity I'd say,
Grails a litte
less because reloading controllers/services/... sometimes
doesn't work
and startup times are LOOOOOOONG (like those EJB startup
times around 2000 :-)

bye
-stephan

Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

tugwilson

On 26 Mar 2006, at 17:20, [hidden email] wrote:

> What I like in Rails is the domain specific
> language,
> which is nicer (less noisy, potentially less powerfull)
> than in Grails (@Property).


There's a proposal to get rid of @Property in Groovy outstanding at  
the moment.

See http://jira.codehaus.org/browse/GROOVY-1275


John Wilson
The Wilson Partnership
web http://www.wilson.co.uk
blog http://eek.ook.org


Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

Stephan.Schmidt
Looks better :-)

But overall,  this is a minor issue and @Property  is already much  
better than Java (field, setter, getter)

And the

@Property  x = { closure  } is so much less noisy  then any  
equivalent in Java

bye
-stephan

>
> On 26 Mar 2006, at 17:20, [hidden email] wrote:
>
>> What I like in Rails is the domain specific
>> language,
>> which is nicer (less noisy, potentially less powerfull)
>> than in Grails (@Property).
>
>
> There's a proposal to get rid of @Property in Groovy outstanding at  
> the moment.
>
> See http://jira.codehaus.org/browse/GROOVY-1275
>
>
> John Wilson
> The Wilson Partnership
> web http://www.wilson.co.uk
> blog http://eek.ook.org
>
>

--
   Stephan Schmidt
   [hidden email]

   PRESS ON. Nothing in the world can take the place of persistence.
   Talent will not; nothing in the world is more common than  
unsuccessful
   men with talent. Genius will not; unrewarded genius is almost a  
proverb.
   Education will not; the world is full of educated derelicts.  
Persistence
   and determination alone are omnipotent. - Calvin Coolidge


Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

Stephan.Schmidt
In reply to this post by tugwilson
Executing such properties on class/object construction ala Ruby would
be the next step to a more powerfull  language (DSLs).

bye
-stephan

>
> On 26 Mar 2006, at 17:20, [hidden email] wrote:
>
>> What I like in Rails is the domain specific
>> language,
>> which is nicer (less noisy, potentially less powerfull)
>> than in Grails (@Property).
>
>
> There's a proposal to get rid of @Property in Groovy outstanding at  
> the moment.
>
> See http://jira.codehaus.org/browse/GROOVY-1275
>
>
> John Wilson
> The Wilson Partnership
> web http://www.wilson.co.uk
> blog http://eek.ook.org
>
>

--
   Stephan Schmidt
   [hidden email]

   PRESS ON. Nothing in the world can take the place of persistence.
   Talent will not; nothing in the world is more common than  
unsuccessful
   men with talent. Genius will not; unrewarded genius is almost a  
proverb.
   Education will not; the world is full of educated derelicts.  
Persistence
   and determination alone are omnipotent. - Calvin Coolidge


Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

tugwilson

On 26 Mar 2006, at 19:16, Stephan J. Schmidt wrote:

> Executing such properties on class/object construction ala Ruby would
> be the next step to a more powerfull  language (DSLs).


We already do something like this

class MyClass {
@Property x
@Property y
}

new MyClass(x: 1, y: 2)

so if a class has a zero parameter constructor and the constructor is  
called with as Map the Map contents are used to set the properties on  
the Bean.

Was this what you had in mind or were you looking for something else?


John Wilson
The Wilson Partnership
web http://www.wilson.co.uk
blog http://eek.ook.org


Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

Stephan.Schmidt

>
> new MyClass(x: 1, y: 2)
>
> so if a class has a zero parameter constructor and the constructor  
> is called with as Map the Map contents are used to set the  
> properties on the Bean.
>

No I didn't mean that, although this is one of the  features of  
Groovy I really like
(overall, but  especially for unit tests)

> Was this what you had in mind or were you looking for something else?
>

No, as far as I can tell,  Ruby executes code when one writes:

belongsTo: author

Then the code after belongsTo is executes  which then meta-manipulates
the created  class (adding methods, fields, registering the object etc.)

Thats powerfull :-)

bye
-stephan

>
> John Wilson
> The Wilson Partnership
> web http://www.wilson.co.uk
> blog http://eek.ook.org
>
>

--
   Stephan Schmidt
   [hidden email]

   PRESS ON. Nothing in the world can take the place of persistence.
   Talent will not; nothing in the world is more common than  
unsuccessful
   men with talent. Genius will not; unrewarded genius is almost a  
proverb.
   Education will not; the world is full of educated derelicts.  
Persistence
   and determination alone are omnipotent. - Calvin Coolidge


Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

graemer
On 3/26/06, Stephan J. Schmidt <[hidden email]> wrote:

>
> >
> > new MyClass(x: 1, y: 2)
> >
> > so if a class has a zero parameter constructor and the constructor
> > is called with as Map the Map contents are used to set the
> > properties on the Bean.
> >
>
> No I didn't mean that, although this is one of the  features of
> Groovy I really like
> (overall, but  especially for unit tests)
>
> > Was this what you had in mind or were you looking for something else?
> >
>
> No, as far as I can tell,  Ruby executes code when one writes:
>
> belongsTo: author
>
> Then the code after belongsTo is executes  which then meta-manipulates
> the created  class (adding methods, fields, registering the object etc.)

This would be possible in Grails if we followed the same path of rails
and forced the user to subclass a class like ActiveRecord.

And in fact as this instance initialiser (ie non static and called by
the constructor on the instance) we could still do this.

Cheers
Graeme

>
> Thats powerfull :-)
>
> bye
> -stephan
>
> >
> > John Wilson
> > The Wilson Partnership
> > web http://www.wilson.co.uk
> > blog http://eek.ook.org
> >
> >
>
> --
>    Stephan Schmidt
>    [hidden email]
>
>    PRESS ON. Nothing in the world can take the place of persistence.
>    Talent will not; nothing in the world is more common than
> unsuccessful
>    men with talent. Genius will not; unrewarded genius is almost a
> proverb.
>    Education will not; the world is full of educated derelicts.
> Persistence
>    and determination alone are omnipotent. - Calvin Coolidge
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

graemer
In reply to this post by Stephan.Schmidt
On 3/26/06, [hidden email] <[hidden email]> wrote:

>
> >> I could say something about how Grails is better than
> Rails (did some
> >> Rails projects :-)
> >
> >Yes? Then go on, because when speaking about Grails to Rails
> people it
> >is always a little difficult to explain the differences and
> possible
> >benefits.
> >
> >bye blackdrag
>
> Most arguments might be subjective and special to me.
>
> Rails and Grails are more or less the same, in the sense that
> other frameworks differ much more from Rails/Grails than
> Rails and
> Grails differ. What I like in Rails is the domain specific
> language,
> which is nicer (less noisy, potentially less powerfull)
> than in Grails (@Property). Rails also contains
> more AJAX features and has migrations, which are nice to have.
The AJAX features in Grails are on the roadmap.. we're just playing
catchup a bit ;-) but I do think ours will be slicker due to dynamic
tag libraries..

>
> What I don't like in Rails is the DB -> Rails application way
> of defining data. This works great for small applications,
> but imho doesn't scale very well. Rails applications make
> it hard to understand them, because lots of code is
> burried in the database, which usually is only accessible
> from a DB frontend while your application contains empty
> domain classes. The situation gets absurd when you use
> migrations, where you define your data in Ruby, then export
> the data to the database and then back into your Rails
> application. Hard to understand. (Grails could do the
> migration stuff by diffing domain classes and annotations,
> which would be much cleaner. This is a feature request :-).
> A Grails domain class makes it clear what fields it contains,
> which makes it easier to read and understand.
> The Grails way is also totally backend
> agnostic (you could implement other backends in the future,
> JNDI, XMLDB, ...). I also assume hibernate scales better
> than ActiveRecord, especially for applications outside
> the 1 Class = 1 Table modell of Rails.
I agree with this, model classes in rails are one of the few areas i
dislike as  you have to go digging into the db to decipher their
meaning

>
> Other things like service integration, better layout support,
> builders etc speak for Grails.
>
> But the main difference is in the language, Groovy (Java)
> versus Ruby.
> I really like Ruby and started several projects (the first 7
> years ago).
> But everytime I come to a point where I have problems with
> libraries
> in Ruby.
>
> 1.) Sometimes I can't get the C part compiled and installed
> (We use
> MacosX/Linux servers for deployment and Windows/MacosX for
> development)
> on one,more or all plattforms.
>
> 2.) Sometimes there is no library for the problem and I had
> to write
> it on my own
>
> 3.) Documentation for most libraries in Ruby is scarce (Rails
> being the
> exception). Interesting libraries have their documentation
> written
> in Japanese (my 2 years of Japanese at the university are not
> enough
> for that :-)
>
> Groovy (Java) has nearly no problems in those areas, the
> libraries are JARs
> and run everywhere (in 10 years of Java development I didn't
> get a JAR lib
> which didn't work), there are lots and lots of libraries
> (sometimes a
> problem, e.g. web frameworks) and documentation is usually in
> English and
> good enough. Usually in Groovy/Java you don't do development,
>
> In Groovy/Java you assemble apps from existing libraries and
> containers.
>
> Just see Xfire, XBeans, James Mail Server,
> ServiceMix/ActiveMQ, JavaSVN,
> Jakarta, Drools, Jaxen, Drone and much more for excellent
> libraries. There
> are also excellent tools (IDEA, Yourkit,...)
>
> So despite the fact that Ruby is less noisy and shorter than
> Java (but less
> so than Groovy with it's closures and builders) productivity
> goes down when
> your web application needs to interface with backends or
> existing
> technology. We also do web projects, server projects,
> business projects
> and GUI projects in Java/Groovy... IDEA and Eclipse are
> written in Java
> not in Ruby ;-)
>
> I'm currently developing a bigger app with Grails and one
> with Rails and one
> with CakePHP. All are similar on the productivity I'd say,
> Grails a litte
> less because reloading controllers/services/... sometimes
> doesn't work
We have a page about reloading quirks (or bugs) here:
http://grails.codehaus.org/Auto+Reloading

Please update it if you find any and report JIRA issues, reloading
should be treated as a bug in Grails and will slowly be improving this
area but I acknowledge at the moment it does require a restart now and
again.

> and startup times are LOOOOOOONG (like those EJB startup
> times around 2000 :-)
There's a lot of runtime configuration happening :-)

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

Re: Fwd:Re: [grails-user] H2

Stephan.Schmidt
In reply to this post by graemer
>> No, as far as I can tell,  Ruby executes code when one writes:
>>
>> belongsTo: author
>>
>> Then the code after belongsTo is executes  which then meta-
>> manipulates
>> the created  class (adding methods, fields, registering the object  
>> etc.)
>
> This would be possible in Grails if we followed the same path of rails
> and forced the user to subclass a class like ActiveRecord.
>
> And in fact as this instance initialiser (ie non static and called by
> the constructor on the instance) we could still do this.
>

Ah, I see.

But I thought not costructor in AR executes the belongsTo code,
but the Ruby interpreter, independently of the class
constructor. So this  should work without inheriting
from an AR base clase?

bye
-stephan

> Cheers
> Graeme

Reply | Threaded
Open this post in threaded view
|

Re: Fwd:Re: [grails-user] H2

graemer
On 3/26/06, Stephan J. Schmidt <[hidden email]> wrote:

> >> No, as far as I can tell,  Ruby executes code when one writes:
> >>
> >> belongsTo: author
> >>
> >> Then the code after belongsTo is executes  which then meta-
> >> manipulates
> >> the created  class (adding methods, fields, registering the object
> >> etc.)
> >
> > This would be possible in Grails if we followed the same path of rails
> > and forced the user to subclass a class like ActiveRecord.
> >
> > And in fact as this instance initialiser (ie non static and called by
> > the constructor on the instance) we could still do this.
> >
>
> Ah, I see.
>
> But I thought not costructor in AR executes the belongsTo code,
> but the Ruby interpreter, independently of the class
> constructor. So this  should work without inheriting
> from an AR base clase?

I'm not 100% sure how it works in Ruby, but in Groovy this is equally
possible as the line

@Property belongsTo = Author

Is executed on intialisation of the object, which could potentially
then add dynamic methods to the meta class if necessary

Cheers
Graeme
>
> bye
> -stephan
>
> > Cheers
> > Graeme
>
>