ExpandoMetaClass - Dynamic method/property name creation
Since Groovy allows you to use Strings as property names this in turns allows you to dynamically create method and property names at runtime. For example in Grails we have a concept of dynamic codecs, classes that can encode and decode data.
So what we do with these classes is to evaluate the convention and add "encodeAsXXX" methods to every object based on the first part of the name of the codec class such as "encodeAsHTML". The pseudo code to achieve this is below:
As you can see from the above we dynamically construct the names of the methods using GString expressions!