Dynamic Reception

Handle messages without defining them in the receiving class.

aka Overriding method_missing or doesNotUnderstand

Any object has a limited set of methods defined for it. A client of an object may attempt to invoke a method that isn't defined on the receiver. A statically typed language will spot this at compile time and report a compilation error. As a result, you know you won't get this kind of error at runtime (unless you do some clever fiddling to get around the type system). With a dynamically typed language, you can invoke a nonexistent method at runtime, which usually gives you a runtime error.

Dynamic Reception allows you to adjust this behavior, which means you can respond differently to an unknown message.

For more details see chapter 41 of the DSL book

| Catalog of DSL patterns |