Friday, June 15, 2007


- allow a smooth transition from machine-centric to human-centric coding, on bytecode level, it is java. It builds on the basic idea of Java platform with a different interpretation of code appearance.
- Groovy is a dynamic language: generating classes transparently at runtime and able to seemingly modify classes at runtime. Groovy doesn't generate bytecode that reflects method call directly, but does something like
getMetaClass().invokeMethod(this, "foo", EMPTY_PARAMA_ARRAY); That way, method calls are redirected through the object's MetaClass. The MetaClass can now do tricks with method invocations such as intercepting, redirecting, adding/removing methods at runtime, and so on.
- run Groovy classes inside JVM in two ways: precompiled mode (with groovyc compiler to generate *.class file, loaded with normal Java classloader) and direct mode (no *.class files are generated, but rather class objects, loaded with groovy classloader)
- treat everything as an object and all operators as method calls, hence improves the level of object orientation. autoboxing for primitive types, 1+1 is interpreted as
- closure needed in: iterator for collections, and using resource in safe manner.

No comments: