O'Reilly logo

Domain Specific Languages by Martin Fowler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 41. Dynamic Reception

Handle messages without defining them in the receiving class.

image

Also known as: 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required