After the initial release, the Groovy language continued to evolve and progress. Below are key features with each major release, not including pending releases.
Groovy 1.5
- Added support for key conventions added in Java 1.5, including
- Annotations - syntactic metadata added to classes and methods for use by the compiler and at runtime.
- Enumerations (enum) - named lists of pre-defined constants
- Static Imports - importing static methods from other classes into a class o Generics
- Classical for loop
- Domain Specific Language - the ability to extend the language with domain specific naming, allowing programmers to work with language and structures that are specific to their domain and have them mapped to the appropriate Groovy code
- Elvis Operator - a simple conditional of <test> ? <ifTrue> : <ifFalse>
Groovy 2.0
- Static type checking - while Groovy is an optionally typed language, version 2.0 added the ability to indicate that static type checking is required for a class
- Static compilation - added the ability to compile objects as native Java classes rather than using the meta object protocol
- Implemented additional Java 1.7 features
- Binary literals
- Underscore literals
- Multi-catch blocks
- Extension Modules
- Contributing instance and static methods (similar to adding to a JS prototype)
Groovy 2.1
- Compile time meta-annotations
- The GPars 1.0 concurrency and threading library was included
- Definable custom base classes, allowing a programmer to select which base class to extend for a Groovy object rather than the language defined one
Groovy 2.2
- Better interaction with Java 8 lambdas
Groovy 2.3
- Official JDK 8 support
- Traits
- Template markup engine - a mechanism for formatting text output
Groovy 2.4 (current)
- Support for writing Android apps in Groovy
- Other enhancements
No comments:
Post a Comment