From: walter@... Date: 2003-06-09T00:55:44+09:00 Subject: run-time type evaluation and programming style Hi everyone, I have been using Ruby for a couple of months now and have done several simple utilities in it, and quite frankly I love it. Last week I wrote a simple Object persistence manager that would let me do simple crud to a db (apparently this is quite popular lately). One of the features it does have is that I encode the expected type of the data going to and from the database. I do this through the use of converter objects. I find that I need to use .class method to determine the type of object that I am dealing with, in a case statement, and then do what I need to based on that. Most any time that I need to use RTTI in Java it is almost certainly a violation of the Open/Closed principle (OCP) for that method. But having said that by using method overloading in essence I am doing the same thing, I am using RTTI to overload the method, but the Java language is doing it implicitly, in Ruby I need to do this via direct evaluation inside of a method. I guess what I am asking is this considered generally acceptable in Ruby, in Java it would not normally be. I am missing a better way to accomplish this. Thanks, Walt ***************************************************** Walter Szewelanczyk IS Director M.W. Sewall & CO. email : walter@mwsewall.com 259 Front St. Phone : (207) 442-7994 x 128 Bath, ME 04530 Fax : (207) 443-6284 *****************************************************