Monday, December 17, 2007

Top 5 reasons why Groovy is the best dynamic language for Java

  1. Offers seamless integration with Java
  2. Groovy generates same bytecode as Java. Once compiled, Groovy classes are nothing but Java classes for the JVM.

  3. Java like syntax with flat learning curve
  4. Groovy has Java like systax. Groovy code is more concise and readable than Java code. It comes with dynamic language features that Java language is lacking. Also brings in scripting capabilities.

  5. Mix and match Groovy and Java classes
  6. A Groovy class can extend a Java class and vice versa. A Java class can implement a Groovy interface and vice versa. Groovy shares same object model, libraries ans same security model as Java.

    JetBrains "joint compiler" eliminates the need for cleverly chosing the order of compilation while mixing groovy and java classes when one extending another or one implementing another and vice versa. It offers compilation of both classes with one go without having to worry about dependencies between both types of classes.

    When compiling from command line through groovyc, just specify -j for joint compilation. For e.g.

    groovyc *.groovy *.java -j -Jsource=1.4 -Jtarget=1.4

    ANT task and Maven plugin is available for groovy project. Maven archetype is also available for rapid bootstraping your project.
  7. Brings in Dynamic language features to Java
  8. Run-time method dispatch is one of the core feature of a dynamic language. It happens at run-time instead of compile-time.

  9. Brings in Fun with Productivity
  10. Groovy is fun and lot more productive to code than Java. Your code can be more precise, expressive and readable than Java code.

Groovy 1.5 gets more groovier with...

  • Support for JDK 5 features including annotations, generics and enums
  • Syntactic enhancements
  • Enhanced dynamic capabilities through Expando meta-class (contribution from grails project)
  • Improved performance

Saturday, December 15, 2007

Grails Up(to)date

Grails is getting ready for release 1.0. The release candidate RC3 is the current stable release. It is worth giving it a try to know all significant additions, fixes and changes went into this release after the last major release 0.6.

Grails 1.0 RCn Ships with:
  • Groovy 1.5 (Grails 0.6 shipped with 1.1-beta-3-SNAPSHOT)
  • Spring 2.5 (Grails 0.6 shipped with 2.0.2)
Some of Noteworthy changes and additions include:
  • The generated Config.groovy (grails application configuration) under config has added mime type configurations and war dependency configurations in addition to log4j configurations. Also has added support to specify additional config files that get merged into this main config file.

  • The generated DataSource.groovy under config has added default hibernate cache configurations in addition to environment DataSource configurations.