In Scala 2.10 class
Dynamic would be enabled by default, so I think that it’s the right time to look at it in more detail. This class can be used for many different purposes. I think, that an integration with dynamic languages is the most obvious one, but I would like to show you something different. I will demonstrate you how to create parameterizable extractors, that can be parametrized directly within
Dynamic works very similar to Ruby’s
method_missing or Groovy’s
propertyMissing. So you can call non-existing methods on classes that extend
Dynamic. Such calls would be rewritten by compiler to following method invocations:
updateDynamic. I will describe each of these methods in the next sections.