On Thu, 2002-07-25 at 20:08, Tom Sawyer wrote: > just a quick question. is the use of #missing_method kosher? should i be > happy to use it or should i try to avoid it? My advice would be to avoid using method_missing if you can achieve the same result using "normal" Ruby constructs, and keep method_missing for code that works at the meta-level. Method_missing adds implicit control flow to your program that is not easily discovered by reading the code. This makes it harder to understand and maintain the code, and is a source of subtle bugs that can be hard to track down. But, if you are writing meta-level code, method_missing is a powerful tool, and the easiest way of intercepting calls to arbitrary objects. For example, the Test::Mock package uses method_missing to easily mock the behaviour of arbitrary classes, and DRb uses method_missing to trap method calls on local proxies and send them over the network to remote objects. Method_missing makes this task very easy to implement. Cheers, Nat. -- Dr. Nathaniel Pryce, Technical Director, B13media Ltd. Studio 3a, 22-24 Highbury Grove, London N5 2EA, UK http://www.b13media.com