From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2001-11-30T07:15:25+09:00 Subject: [ruby-talk:26973] thoughts on virtual base classes, interfaces I want to pass around objects of a type which respond to a method called 'run'. Optionally, they might respond to a few other methods, let's call them get_serverTimeout and get_clientTimeout - but these last two are optoinal, I'll test for them with 'respond_to'. So I got to thinking that perhaps I could make something like a virtual base class where you raise an exception if 'run' isn't defined in the inheriting class. But then I thought, "why bother" - Ruby is dynamic, any object which responds to 'run' is going to work. So perhaps the best way of communicating this to users of the framework (a task distributor which distrubutes tasks to different clients). So it seems that philosophically, the best way to do it is just to document the required (and optoinal interface) for the classes of objects to be distributed. Any thoughts? How are others handling these types of issues? Phil