• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Spring Roo Advantages

 
Ranch Hand
Posts: 400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As some of the other posters mentioned ,it is a crowded field of JVM derived languages out there.

It all seems to boil down to one thing: Java and java frameworks are often cumbersome for simple web projects.
What advantage does Roo have over other JVM languages and non java based languages such as php ?

Does it perform operations/actions faster ,require less code per action ,etc,.. or is it just people prefer the coding style of certain languages and Roo is just another option?

Thanks,
Paul

 
author
Posts: 63
Mac OS X Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

paul nisset wrote:
It all seems to boil down to one thing: Java and java frameworks are often cumbersome for simple web projects.
What advantage does Roo have over other JVM languages and non java based languages such as php ?

Does it perform operations/actions faster ,require less code per action ,etc,.. or is it just people prefer the coding style of certain languages and Roo is just another option?



Ok, I think I can take that on...

One java framework is not the same as another... Some are more performant than others, some are more flexible, etc... So I don't want to generalize and say that a Java framework-based application will out-perform PHP.

I would say that developing an application in an object-oriented language gives you the ability to build object-oriented frameworks, which is how all of this innovation comes about.

Rails is an object-oriented framework, written atop a dynamic language (meaning that we don't compile the code, but interpret it at runtime). Same with Grails (language is Groovy). The performance hit you take is the interpretation of the code (which has of course been parsed and can be optimized at runtime by internal algorithms, etc) and so certain applications are at a disadvantage in those platforms - are you going to get a zillion dynamic language calls in the same amount of time as a zillion Java compiled, bytecode calls? Nope, but then again, where is the time being spent? Is the time being spent waiting on a database result? If that is 99% of your execution time, but 1% is the dynamic language indirection, then who cares?

In some ways, Grails and Rails have an advantage in that you can write "domain specific languages". Here's an example of a GORM (Grails' object query language, fitted atop Hibernate):


Now, if you spend enough time parsing this, you can probably read it easily. Can you do the same amount of conciseness in Java? Almost, using JPA or hibernate...



But it's still Java-like.

Let's face it, Java isn't pretty. It's not beautiful code. Ruby creates beautiful code, so does Groovy. It's focused on productivity (look at the looping in the first example, it's really cool to use closures).

But...

The Groovy stuff is really calling Spring APIs, but doing so with a dynamic language in front.

Roo will have you taking another approach. You pull out the boilerplate and put it in AspectJ "mix-ins".

Read the free chapter - I go into Aspects - "What is Spring Roo?" it's a good overview and it's free

Basically, here is what you'd see in a Roo application:

Customer.java
Customer_Roo_JavaBean.aj
Customer_Roo_ToString.aj
Customer_Roo_JPAEntity.aj
Customer_Roo_Json.aj

etc...

How did the .aj files get there? We've annotated the class with special @Roo annotations that generate the AJ files when the Roo shell fires up.



For simple web projects, I'm not sure Roo is an advantage - same as Grails - do you really need a Java footprint? But Java scales very well, can be load balanced, has lots of integration options, and has a ton of APIs available for it ranging from everything from Serial Port APIs to complex UI APIs such as Spring MVC.

Roo has an advantage in the code generation end because you're compiling those aspects into the class bytecode (using the AspectJ compile time weaver). So it should perform just as fast as if you include that code directly inside of your class.

Then all I have in my class is the member fields, and anything non-boilerplate.
 
paul nisset
Ranch Hand
Posts: 400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your explanation Ken.
I'll check out the free chapter.
 
Space pants. Tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!